我试图使用memcache-client连接创建的amazon elastiCache集群端点.但我得到了错误
MemCache::MemCacheError: No connection to server (testcachecluster.u098ed.cfg.us
e1.cache.amazonaws.com:11211 DEAD (Timeout::Error: execution expired), will retr
y at 2013-06-21 11:34:15 +0530)
from C:/ProgramData/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/me
mcache-client-1.8.5/lib/memcache.rb:863:in `with_socket_management'
from C:/ProgramData/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/me
mcache-client-1.8.5/lib/memcache.rb:370:in `block in set'
from C:/ProgramData/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/me
mcache-client-1.8.5/lib/memcache.rb:886:in `with_server'
from C:/ProgramData/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/me
mcache-client-1.8.5/lib/memcache.rb:361:in `set'
from (irb):5
from C:/ProgramData/RailsInstaller/Ruby1.9.3/bin/irb:12:in `<main>'
Run Code Online (Sandbox Code Playgroud)
但是正确使用amazon elastiCache集群端点的localhost instread.
irb(main):006:0> m = MemCache.new('localhost:11211')
=> <MemCache: 1 servers, ns: nil, ro: false>
irb(main):007:0> m.set 'abc', 'xyz'
=> "STORED\r\n"
irb(main):008:0> m.get 'abc'
=> "xyz"
irb(main):009:0>
Run Code Online (Sandbox Code Playgroud) 有没有办法从本地开发环境访问缓存节点?虽然可以从EC2实例访问相同的缓存节点.
我正在使用带有C#的Enyim memcache客户端库.我发现很少有文章说这是不可能的,那么什么应该是最好的方法.我是否需要在本地设置memcache以进行开发工作?
我有一个maxmemory-policy设置为的redis服务器volatile-lru.文档表明,这将从已达到内存限制时设置了过期的条目集中逐出.
在这种情况下,redis是否仅在过期后逐出项目?如果内存中的所有内容都设置了过期,但没有超过过期时间,那么在达到最大内存时会有什么东西被驱逐吗?
我正在使用Jedis连接到AWS中的Redis实例/集群,但是我一直收到此错误,这是代码,我在SO上进行了广泛搜索,发现最接近的是:属性文件中的字符串主机名:Java
我尝试了两种方式,都没有为我工作。所以请帮忙。
这是我的Java代码:
public static void main(String[] args) {
AWSCredentials credentials = null;
try {
credentials = new ProfileCredentialsProvider("default").getCredentials();
} catch (Exception e) {
throw new AmazonClientException("Cannot load the credentials from the credential profiles file. "
+ "Please make sure that your credentials file is at the correct "
+ "location (/Users/USERNAME/.aws/credentials), and is in valid format.", e);
}
AmazonElastiCacheClient client = new AmazonElastiCacheClient(credentials);
client.setRegion(Region.getRegion(Regions.AP_NORTHEAST_2));
DescribeCacheClustersRequest dccRequest = new DescribeCacheClustersRequest();
dccRequest.setShowCacheNodeInfo(true);
DescribeCacheClustersResult clusterResult = client.describeCacheClusters(dccRequest);
List<CacheCluster> cacheClusters = clusterResult.getCacheClusters(); …Run Code Online (Sandbox Code Playgroud) 昨天我启动了我们的第一个AWS Elasticache Redis实例,但是还不能通过JAVA API使用它(尽管HTTP API似乎很容易使用)
我首先尝试通过在pom.xml文件中包含以下内容来使用可用的库:
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.11.86</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
然后我意识到我只需要:
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-elasticache</artifactId>
<version>1.11.86</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
但也有:
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>elasticache-java-cluster-client</artifactId>
<version>1.1.1</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
我在以下位置找到了Javadoc:
但是由于我还没有在库中找到任何实际的说明,因此无法真正从缓存中放入/获取数据,有人可以指出正确的方向吗?
我正在使用无服务器使用nodejs模板创建lambda函数。
serverless.yml。当我尝试时serverless invoke local -f functionName,它总是超时,因此我必须部署它进行测试。
是否可以在本地进行测试serverless?
amazon-web-services node.js amazon-elasticache aws-lambda serverless-framework
我在 AWS ECS 上运行 apache-airflow 1.8.1,并且有一个 AWS ElastiCache 集群 (redis 3.2.4),运行 2 个分片/2 个启用多可用区的节点(集群 Redis 引擎)。我已经验证气流可以毫无问题地访问集群的主机/端口。
这是日志:
Thu Jul 20 01:39:21 UTC 2017 - Checking for redis (endpoint: redis://xxxxxx.xxxxxx.clustercfg.usw2.cache.amazonaws.com:6379) connectivity
Thu Jul 20 01:39:21 UTC 2017 - Connected to redis (endpoint: redis://xxxxxx.xxxxxx.clustercfg.usw2.cache.amazonaws.com:6379)
logging to s3://xxxx-xxxx-xxxx/logs/airflow
Starting worker
[2017-07-20 01:39:44,020] {__init__.py:57} INFO - Using executor CeleryExecutor
[2017-07-20 01:39:45,960] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python2.7/lib2to3/Grammar.txt
[2017-07-20 01:39:45,989] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt
[2017-07-20 01:39:53,352] {__init__.py:57} INFO - …Run Code Online (Sandbox Code Playgroud) 我试图连接到elasticache来放置数据,但我还没有找到执行放置数据的方法.如何在aws的elasticache resdis上输入和获取数据?我的代码
mySession := getAWSSession()
svc := elasticache.New(mySession)
input := &elasticache.CreateCacheClusterInput{
AutoMinorVersionUpgrade: aws.Bool(true),
CacheClusterId: aws.String("my-redis"),
CacheNodeType: aws.String("cache.r3.larage"),
CacheSubnetGroupName: aws.String("default"),
Engine: aws.String("redis"),
EngineVersion: aws.String("3.2.4"),
NumCacheNodes: aws.Int64(1),
Port: aws.Int64(6379),
PreferredAvailabilityZone: aws.String("us-east-1c"),
SnapshotRetentionLimit: aws.Int64(7),
}
result, err := svc.CreateCacheCluster(input)
var data = Logo{}
data.name = "test1"
data.logo = "test2"
// how to put and get data from elasticache
Run Code Online (Sandbox Code Playgroud) 我有一个相当简单的测试应用程序:
import redis
import os
import logging
log = logging.getLogger()
log.setLevel(logging.DEBUG)
def test_redis(event, context):
redis_endpoint = None
if "REDIS" in os.environ:
redis_endpoint = os.environ["REDIS"]
log.debug("redis: " + redis_endpoint)
else:
log.debug("cannot read REDIS config environment variable")
return {
'statusCode': 500
}
redis_conn = None
try:
redis_conn = redis.StrictRedis(host=redis_endpoint, port=6379, db=0)
redis_conn.set("foo", "boo")
redis_conn.get("foo")
except:
log.debug("failed to connect to redis")
return {
'statusCode': 500
}
finally:
del redis_conn
return {
'statusCode': 200
}
Run Code Online (Sandbox Code Playgroud)
我已将其部署为无服务器的 HTTP 端点
#
# For full config options, …Run Code Online (Sandbox Code Playgroud) 我是 Elastic Cache 概念的新手。请原谅我对这个概念的了解。
目前,我想在我的 Postgres RDS 前面设置一个弹性缓存。
我有弹性缓存功能的理论知识。
我正在谈论如何设置连接到我的 RDS 实例的弹性缓存?
需要与开发人员共享哪些端点才能访问弹性缓存?
或者我完全错误地理解了这个概念
有人能帮我解决这个问题吗?