简体   繁体   English

Couchbase群集 - 1个节点关闭时的异常

[英]Couchbase cluster - exception when 1 node is down

I have a Couchbase cluster with 3 nodes. 我有一个有3个节点的Couchbase集群。 I have a java process that writes to this cluster. 我有一个写入此集群的java进程。 When one of the nodes is down I'm getting this exception: 当其中一个节点关闭时,我遇到了这个异常:

2013-12-30 14:03:23.259 WARN com.couchbase.client.CouchbaseConnection:  Node expected to receive data is inactive. This could be due to a failure within the cluster. Will check for updated configuration. Key without a configured node is: 980d330b2a96656a93bd08e48e6fc759135e6e6f.
Dec 30, 2013 2:03:23 PM com.couchbase.client.CouchbaseConnectionFactory resubConfigUpdate
INFO: Attempting to resubscribe for cluster config updates.
Dec 30, 2013 2:03:23 PM com.couchbase.client.CouchbaseConnectionFactory$Resubscriber run
INFO: Reconnect attempt 1, waiting 0ms
2013-12-30 14:03:24.020 INFO com.couchbase.client.CouchbaseConnection:  Reconnecting {QA sa=10.223.224.79/10.223.224.79:11210, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0}
2013-12-30 14:03:24.261 WARN net.spy.memcached.protocol.binary.BinaryMemcachedNodeImpl:  Operation canceled because authentication or reconnection and authentication has taken more than one second to complete.
2013-12-30 14:03:24.263 WARN com.couchbase.client.CouchbaseConnection:  Node expected to receive data is inactive. This could be due to a failure within the cluster. Will check for updated configuration. Key without a configured node is: 980d330b2a96656a93bd08e48e6fc759135e6e6f.
2013-12-30 14:03:25.265 WARN net.spy.memcached.protocol.binary.BinaryMemcachedNodeImpl:  Operation canceled because authentication or reconnection and authentication has taken more than one second to complete.
441016302 [pool-5-thread-1] ERROR com.polimo.rtb.writer.CouchbaseWriter  - Error while trying to write to couchbase
java.util.concurrent.CancellationException: Cancelled
        at net.spy.memcached.internal.OperationFuture.get(OperationFuture.java:176)
        at net.spy.memcached.MemcachedClient.mutateWithDefault(MemcachedClient.java:1842)
        at net.spy.memcached.MemcachedClient.incr(MemcachedClient.java:1788)
        at com.polimo.rtb.writer.CouchbaseWriter.incrementCounterInDb(CouchbaseWriter.java:107)
        at com.polimo.rtb.writer.CouchbaseWriter.write(CouchbaseWriter.java:90)
        at com.polimo.rtb.consumer.ConsumerThread.run(ConsumerThread.java:40)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)

I'm using a standard java client and with the described behavior I feel I'm missing the whole point of using a cluster, I mean, if one node is down everything should be working still. 我正在使用一个标准的Java客户端 ,并且在描述的行为中我觉得我错过了使用集群的全部意义,我的意思是,如果一个节点出现故障,一切都应该工作。

Is there some configuration I'm missing (server or client)? 是否有一些我缺少的配置(服务器或客户端)?

Replication is configured on a per-bucket basis. 复制是基于每个桶配置的。 If no replicas are configured then when a node goes down the vBucket(s) hosted by that node will be no longer be available, and hence any attempt to perform operations on that data fail as you saw. 如果没有配置副本,那么当节点关闭时,该节点托管的vBucket将不再可用,因此任何对该数据执行操作的尝试都会失败,如您所见。

See the Creating and Editing Data Buckets in the Couchbase Manual for details on configuring replicas (specifically the Replicas section of the "Create Bucket" process and the Failover Nodes section). 有关配置副本的详细信息,请参阅“Couchbase手册”中的“ 创建和编辑数据存储桶” (特别是“创建存储桶”过程和“ 故障转移节点”部分的“副本”部分)。

How is your client configured. 您的客户如何配置。 Do you have in the configuration all cluster nodes IP addresses? 您是否在配置中拥有所有群集节点的IP地址? If you have only one IP address in your configuration and this node crash your cluster is not accessible for your application. 如果配置中只有一个IP地址,并且此节点崩溃,则您的应用程序无法访问您的群集。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM