Sync Gateway Cluster setup issue

#1

Hi,

I have two couchbase servers in one cluster and each couchbase server has sync gatway and i was testing sync gateway and couchbase server failover and somehow sync gateway was going to offline couchbase server for data until i restart sync gateway on online coucbase server.

Steps i have performed:

  1. Two nodes A and B online with sync gateway installed on each node in one cluster.
  2. I have shutdown node B physically without using couchbase fail over feature.
  3. Then i tried to access through sync gatway example.com:4984/test and it was trying to connect node B couchbase data through node A sync gateway.
  4. no issues just opening sync gateway gatway example.com:4984
  5. I have even failover and removed node B couchbase server from cluster but still same sync gateway was trying to get data from node B.
  6. After that i have restarted sync gateway on node A then it started connecting to node A bucket.

This way it does not seem to be a redundant service as i needed to restart sync gateway on online server which will take mobile users go offline.

Is it by design like this or am i doing something wrong here?

Please help me as i want app to work even one couchbase server goes offline and one sync gateway go offline.

Sync gateway logs:

15:13:23.679151 2015-08-07T15:13:23.679+10:00 WARNING: Couldn’t interpret error type *net.OpError, value dial tcp 10.10.10.20:11210: connection timed out – base.ErrorAsHTTPStatus() at error.go:63
15:13:23.679252 2015-08-07T15:13:23.679+10:00 HTTP: #047: --> 500 Internal error: dial tcp 10.10.10.20:11210: connection timed out (68139.1 ms)
15:14:24.272075 2015-08-07T15:14:24.272+10:00 WARNING: Couldn’t interpret error type *net.OpError, value read tcp 10.10.10.20:11210: connection timed out – base.ErrorAsHTTPStatus() at error.go:63
15:14:24.272211 2015-08-07T15:14:24.272+10:00 HTTP: #006: --> 500 Internal error: read tcp 10.10.10.20:11210: connection timed out (1036224.3 ms)
15:14:30.861035 2015-08-07T15:14:30.861+10:00 HTTP: #048: GET /kodoprod/
15:14:30.861111 2015-08-07T15:14:30.861+10:00 WARNING: Couldn’t interpret error type *net.OpError, value dial tcp 10.10.10.20:11210: connection timed out – base.ErrorAsHTTPStatus() at error.go:63
15:14:30.861288 2015-08-07T15:14:30.861+10:00 HTTP: #048: --> 500 Internal error: dial tcp 10.10.10.20:11210: connection timed out (68137.1 ms)
15:14:30.897841 2015-08-07T15:14:30.897+10:00 HTTP: #050: GET /favicon.ico/

Thanks,
Karunakar

#2

Sync Gateway handling of changes in the Couchbase Server cluster topology is available on the Sync Gateway master branch, and will be included in the upcoming release 1.1.1.

I believe this should address your scenario - when a Couchbase Server node goes down, Sync Gateway will recognize the change in the cluster and handle subsequent calls appropriately. You can take a look at https://github.com/couchbase/sync_gateway/issues/1011 if you’d like more detais.

If you end up giving this a try from the master branch, let me know if you continue to run into problems.

#3

Hi Adam,

Thank you and i am new to couchbase and learning as i go and would like to know how to try from master branch to learn if couchbase server offline.

I have done basic setup with couchbase server and sync gateway and please let me know where should i include master branch.

Thanks,
Karunakar

#4

@Karunakar

To build Sync Gateway from source (master), using a browser go to the github repo

Scroll down to the section “Building From Source”, where you will find instructions on how to build Sync Gateway.

Andy

#5

Thank you Andy and Adam.

I have a quick question if that’s the case then how others would have implemented without restarting sync gatway in case of couchbases server is offline after sync gateway started?

Is there any other way to setup?

Thanks,
Karunakar Reddy