Hi all.
What I'm trying to do - writing time series data all the time, even if one of two nodes failed.
Please help me figure out, how to handle this situation.
Very simple case:
- two servers (147.54.160.217; 147.54.160.218) in one cluster with shared bucket (and one replica)
- couchbase enterprise version 2.5 (windows 7)
- java couchbase client [<dependency><groupId>com.couchbase.client</groupId><artifactId>couchbase-client</artifactId><version>1.4.0-dp</version></dependency>]
It is the latests client and servers.
I've made a couchbase project to show what and how I'm doing (attached in zip file). It is maven project so I hope it will be very simple to start it in any IDE.
In that project there are 2 classes:
- CouchbaseUtil.java (singleton that provide nice API to interract with nodes using couchbase-API)
- CouchbaseMain.java (infinite cycle that produces data and asks CouchbaseUtil.java to store it )
I'm generating data and ask CouchbaseUtil to save it in infinite cycle. After that I'm disabling couchbase service in one of the servers and expecting client to continue writing to working one, but couchbase client trying to save data in not working host and never switches to working host. Do I need to handle it manually? If I do, how can I do it? I've read that couchbase client is smart enough to handle it for me.
Please, take a minute, look at my project, and show me where I'm wrong.
Thank you very much!