我正在尝试用AutoDiscovery测试亚马逊新的Memcached客户端。我有一个memcached节点,可以使用XMemcached 1.3.5连接到它,以及一个标准的SpyMemcached库。
我按照这里的说明:http://docs.amazonwebservices.com/AmazonElastiCache/latest/UserGuide/AutoDiscovery.html
该代码与示例几乎相同,如下所示:
String configEndpoint = "<server name>.rgcl8z.cfg.use1.cache.amazonaws.com";
Integer clusterPort = 11211;
MemcachedClient client = new MemcachedClient(new InetSocketAddress(configEndpoint, clusterPort));
client.set("theKey", 3600, "This is the data value");在创建连接时,我会在日志中看到以下内容。当我试图设置一个值时,会发生错误:
2013-01-04 22:05:30.445 INFO net.spy.memcached.MemcachedConnection: Added {QA sa=/<ip>:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue
2013-01-04 22:05:32.861 INFO net.spy.memcached.ConfigurationPoller: Starting configuration poller.
2013-01-04 22:05:32.861 INFO net.spy.memcached.ConfigurationPoller: Endpoint to use for configuration access in this poll NodeEndPoint - HostName:<our-server>.rgcl8z.cfg.use1.cache.amazonaws.com IpAddress:<ip> Port:11211
2013-01-04 22:05:32.950 WARN net.spy.memcached.MemcachedClient: Configuration endpoint timed out for config call. Leaving the initialization work to configuration poller.
Exception in thread "main" java.lang.IllegalStateException: Client is not initialized
at net.spy.memcached.MemcachedClient.checkState(MemcachedClient.java:1623)
at net.spy.memcached.MemcachedClient.enqueueOperation(MemcachedClient.java:1617)
at net.spy.memcached.MemcachedClient.asyncStore(MemcachedClient.java:474)
at net.spy.memcached.MemcachedClient.set(MemcachedClient.java:905)
at com.thinknear.venice.initializers.VeniceAssets.main(VeniceAssets.java:227)对于配置端点为什么要超时有任何想法吗?
发布于 2013-01-17 07:17:35
客户端没有初始化:您不能通过本地机器直接连接到亚马逊弹性缓存节点,只能通过您的ec2 machiene.If访问它,您想要检查您可以从本地机器上进行远程访问,它不会连接,我也从相同的问题上提出了建议,.You可以从您的Ec2 machine.so中调用它,在ec2机器上尝试您的代码。
发布于 2013-07-26 05:39:41
在memcache服务器上做telnet检查连接,在我的情况下它没有被列出,所以无法进行连接,通过将我的服务器列表到memcache来解决问题。
https://stackoverflow.com/questions/14169189
复制相似问题