dmc February 2016

GemFire 8.2.0 embeded locator service

I am trying to cluster servers in gemfire using an embedded locator service.

server 1 serverCache = new CacheFactory().set("cache-xml-file", "server-cache.xml") .set("mcast-port", "0") .set("start-locator", "11001") .set("locators", "localhost[11001],10.0.0.193[11002]").create();

server 2 serverCache = new CacheFactory().set("cache-xml-file", "server-cache.xml") .set("mcast-port", "0") .set("start-locator", "11002") .set("locators", "10.0.0.192[11001],localhost[11002]").create();

but they cant connect

from server 1

[warn 2016/02/08 20:37:41.510 UTC tid=0x28] Locator discovery task could not exchange locator information localhost[11001] with ip-10-0-0-193.ec2.internal[11002] after 55 retry attempts. Retrying in 10,000 ms.

from server 2

[warn 2016/02/08 20:46:27.867 UTC tid=0x28] Locator discovery task could not exchange locator information localhost[11002] with ip-10-0-0-192.ec2.internal[11001] after 102 retry attempts. Retrying in 10,000 ms.

it close but i am missing something

Yes, using the .set("bind-address", "10.0.0.193") answer seemed to do the trick. just to comfirm on the logs, did i make a cluster

server1

[info 2016/02/09 09:39:07.445 UTC tid=0x3c] Membership: Processing addition < ip-10-0-0-192(14522):14968 >

[info 2016/02/09 09:39:07.445 UTC tid=0x3c] Admitting member :14968>. Now there are 2 non-admin member(s).

[info 2016/02/09 09:39:07.460 UTC tid=0x41] Member ip-10-0-0-192(14522):14968 is not equivalent or in the same redundancy zone.

[info 2016/02/09 09:39:12.923 UTC tid=0x28] Locator discovery task exchanged locator information ip-10-0-0-193.ec2.internal[11001] with ip-10-0-0-192.ec2.internal[11001]: {-1=[ip-10-0-0-192.ec2.internal[11001], ip-10-0-0-193.ec2.internal[11001]]}.

[info 2016/02/09 09:39:13.245 UTC tid=0x46] Initializing reg

Answers


Dan Smith February 2016

Have you tried replacing "localhost" with the actual IP address of the box? In other words, both lists should look like this:

.set("locators", "10.0.0.192[11001],10.0.0.193[11002]")

I believe the locator by default binds to the public IP address of your machine, not localhost (127.0.0.1).


Jens D February 2016

Actually, the locator is binding to localhost, so you should set bind-address for each cache server with set("bind-address", "10.0.0.192"). Also obviously have your locators point at these addresses.

Post Status

Asked in February 2016
Viewed 3,306 times
Voted 6
Answered 2 times

Search




Leave an answer