我試圖用AutoDiscovery測試Amazon的新Memcached客戶端。我有一個可以使用XMemcached 1.3.5連接到的memcached節點以及標準的SpyMemcached庫。Amazon ElasticCache Autodiscovery - 客戶端未初始化
我這裏的操作說明: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)
- 我在本地和在EC2實例嘗試這(我可以連接使用其他庫的節點)
- 我已經試過:當我嘗試設置值發生錯誤同時使用1.4.5和1.4.14的Memcached引擎
- 我放鬆了對安全組的限制,以及萬一
爲什麼在配置端點將超時有什麼想法?
我找到了解決我自己的問題。看起來我的安全組沒有正確設置。一旦我修復了我的安全組並將我的代碼部署到了我們的EC2實例中,就可以進行連接。 – Moemars
請問您如何修復您的安全組?我面臨同樣的問題,我是亞馬遜服務的新手。謝謝 – Sam
@Sam我也面臨同樣的問題,並會對你如何修復你的安全組感興趣。我試圖打開它們到世界但它仍然不起作用 – Phil