When couchbase server response to set command:

  • when data was saved to single (master) node
  • when data was saved to all nodes
有帮助吗?

解决方案

The answer will vary slightly by the client library you're using. But generally speaking, a positive result from calling set implies only that there were no I/O or other errors between the client and server. In such a case, the data should be safely in memory on the master node for a given key.

In 2.0, Couchbase Server and the respective client libraries will support the Observe method, which will allow for durability checks. Calling observe, you'll be able to ask questions like:

  • Is a key in memory on its master node?
  • Is a key persisted to disk on its master node?
  • Has a key been replicated in memory?
  • Has a key been persisted to its replicas?

For more on Observe, see http://www.couchbase.com/wiki/display/couchbase/Observe.

One other point, just to make sure it's clear... Nodes in a Couchbase cluster are all peers in terms of responsibilities, but have master/slave relationships in terms of keys and the replication of those keys. In other words, key "foo" has a single master node, but may be replicated to other nodes as slave copies of that key.

其他提示

Default behavior of Couchbase is that it will write data to only primary node. Write to other replica node(s) happens asynchronously in a peer-to-peer communication style. Also, in fact in the primary node, data is only written to the cache (RAM) when write operation is performed (it gets persisted later).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top