Amazon ElasticCache Autodiscovery - client not initialized

I am trying to test Amazon's new Memacached client with AutoDiscovery. I have one memcached node with which I can connect to XMemcached 1.3.5, as well as the standard SpyMemcached library.

I follow the instructions here: http://docs.amazonwebservices.com/AmazonElastiCache/latest/UserGuide/AutoDiscovery.html

The code is almost identical to this example:

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"); 

I see the following in the logs when I create a connection. The error occurs when I try to set the 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) 
  • I tried this both locally and in an EC2 instance (I can connect using other libraries to the nodes)
  • I tried using the 1.4.5 and 1.4.14 Memcached engines.
  • I relaxed the security group’s limitations, just in case

Any thoughts on why the configuration endpoint will fail?

+6
source share
2 answers

The client is not initialized: you cannot directly connect to the amazon node elastic cache through a local machine, which you can only access through your ec2 machine. If you want to check that you can connect to telnet from your local computer, it will not be connected, and I will be satisfied with the same problem too. You can telnet it from your Ec2 computer. Try your code on ec2 machine, it will work.

+8
source

Make telnet on the memcache server to check the connectivity, in my case it was not specified, so the connection could not be established, the problem was solved by listing my server in memcache.

0
source

All Articles