2017-03-21 10 views
1

를 내가 membase 서버를 주석에 대한 aspymemcached 자바 클라이언트를 사용하고 있습니다 :spymemcached 자바 클라이언트 실패가 제대로 작동하지 취급 : membase 서버

public static void main(String[] args) throws Exception{ 
     MemcachedClient client = null; 
     try { 
      URI server1 = new URI("http://192.168.100.111:8091/pools"); //primary 
      URI server2 = new URI("http://127.0.0.1:8091/pools"); //secondry 
      ArrayList<URI> serverList = new ArrayList<URI>(); 
      serverList.add(server1); 
      serverList.add(server2); 
      client = new MemcachedClient(serverList, "bucketName", ""); 
      client.set("spoon", 50000, "Hello World!"); //after this line i am going to down server 1 (192.168.100.111:8091/pools) 
      Thread.sleep(35000); 
      Object obj = client.get("spoon"); // on excetuting this line value should returns from server 2 
     } catch (Exception e) { 
      log.error("Exception in initializing membase connection:" + e.getMessage(), e); 
     } 
} 

나는 2 membase 서버가 복제를들이받은 있습니다. 이제 기본 (서버 1) 노드가 다운 후 클라이언트가 보조 노드 (서버 2)에서 값을 읽는되지 않고, 나는 다음과 같은 오류가 무엇입니까가는 경우 :

내 예상되는 동작입니다
2017-03-20 07:51:55,655 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) 
2017-03-20 07:51:55,655 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) 
2017-03-20 07:51:55,655 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:407) 
2017-03-20 07:51:55,655 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:275) 
2017-03-20 07:51:55,655 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) at net.spy.memcached.MemcachedClient.run(MemcachedClient.java:2030) 
2017-03-20 07:51:55,656 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) 2017-03-20 07:51:55.656 WARN net.spy.memcached.MemcachedConnection: Closing, and reopening {QA sa=/192.168.100.111:8091, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0}, attempt 5. 
2017-03-20 07:52:04,549 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) 2017-03-20 07:52:04.549 INFO net.spy.memcached.MemcachedConnection: Reconnecting {QA sa=/192.168.100.111:8091, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} 
2017-03-20 07:52:05,542 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) 2017-03-20 07:52:05.542 INFO net.spy.memcached.MemcachedConnection: Connection state changed for [email protected] 
2017-03-20 07:52:05,542 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) 2017-03-20 07:52:05.542 INFO net.spy.memcached.MemcachedConnection: Reconnecting due to failure to connect to {QA sa=/192.168.100.111:8091, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} 
2017-03-20 07:52:05,542 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) java.net.ConnectException: Connection refused: no further information 
2017-03-20 07:52:05,542 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) 
2017-03-20 07:52:05,542 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) 
2017-03-20 07:52:05,542 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:407) 
2017-03-20 07:52:05,542 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:275) 
2017-03-20 07:52:05,543 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) at net.spy.memcached.MemcachedClient.run(MemcachedClient.java:2030) 
2017-03-20 07:52:05,543 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) 2017-03-20 07:52:05.543 WARN net.spy.memcached.MemcachedConnection: Closing, and reopening {QA sa=/192.168.100.111:8091, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0}, attempt 5. 
2017-03-20 07:52:20,356 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) 2017-03-20 07:52:20.356 INFO net.spy.memcached.MemcachedConnection: Reconnecting {QA sa=/192.168.100.111:8091, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} 
2017-03-20 07:52:21,356 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) 2017-03-20 07:52:21.356 INFO net.spy.memcached.MemcachedConnection: Connection state changed for [email protected] 
2017-03-20 07:52:21,356 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) 2017-03-20 07:52:21.356 INFO net.spy.memcached.MemcachedConnection: Reconnecting due to failure to connect to {QA sa=/192.168.100.111:8091, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} 
2017-03-20 07:52:21,356 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) java.net.ConnectException: Connection refused: no further information 
2017-03-20 07:52:21,356 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) 
2017-03-20 07:52:21,356 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) 
2017-03-20 07:52:21,356 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:407) 
2017-03-20 07:52:21,356 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:275) 
2017-03-20 07:52:21,356 ERROR [stderr] (Memcached IO over {MemcachedConnection to /127.0.0.1:8091 /192.168.100.111:8091}) at net.spy.memcached.MemcachedClient.run(MemcachedClient.java:2030) 

는, 클라이언트가 secondry 서버 (서버 2)에서 값을 읽어야을 주 서버를 다시 연결해야합니다.

+0

심판에서보세요 사용하여 처리 :은 https : //forums.couchbase.com/t/java-client-dont-connect-another-cluster-node-when- 일등석/10573 –

답변

0

우리는 ConnectionObserveranswer