Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Communications Framework (ECF) » Configure Zookeeper zoodiscovery centralized and replicated mode(how to configure centralized and replicated zookeeper mode)
Configure Zookeeper zoodiscovery centralized and replicated mode [message #731954] Mon, 03 October 2011 14:46 Go to next message
Stefano Ghio is currently offline Stefano GhioFriend
Messages: 12
Registered: September 2011
Junior Member
Greetings,

I have a problem configuring Zookeeper to work with zoodiscovery mode centralized and replicated. The guide at http://wiki.eclipse.org/Zookeeper_Based_ECF_Discovery is a little mysterious about that.

I'm working on Windows XP SP3, Java JDK 1.6, Eclipse STS 2.7.2, org.eclipse.osgi 3.7 and a proxied network.

NOTE: Using the standalone configuration mode gives no problem. I use -Dzoodiscovery.flavor.standalone=192.168.23.21:3030;clientPort=3031 on the server and -Dzoodiscovery.flavor.standalone=192.168.23.28:3031;clientPort=3030 and it works nicely.

I will split the question in multiple parts:

1) In a setup with a (one) central server on 192.168.23.28, multiple clients. The clients will both publish and consume services.

I launch the server as:
java -Dzoodiscovery.dataDir=name -Dzoodiscovery.flavor=zoodiscovery.flavor.centralized=192.168.23.28 -jar org.eclipse.osgi.jar -console -consoleLog -clean -configuration c:\temp\osgiserver\configuration


I can see the ZooDiscovery> Discovery Service Activated.

When I launch the clients (in the example there's only one) as:

java -Dzoodiscovery.autoStart=true -Dzoodiscovery.flavor=zoodiscovery.flavor.centralized=192.168.23.28 -jar org.eclipse.osgi.jar -console -consoleLog -clean -configuration c:\temp\osgiclient\configuration


I can see ZooDiscovery> Discovery Service Activated. but then INFO - Attempting connection to server: /192.168.23.28 which goes on and on never succeeding.

I have to start server and clients by configuring Zookeeper from command line, I cannot insert those parameters inside the bundles. I have tried setting the -Dzoodiscovery.clientPort=8888 on the server (8888 is available) and then -Dzoodiscovery.flavor=zoodiscovery.flavor.centralized=192.168.23.28:8888 on the client, but still it changes nothing.

How do I configure such a setup?

2) Plus I'd like to know if it's possible, using centralized, to have multiple central servers talking between them or if I'd have to use the replicated mode.

3) Which leads to.. how do I configure server and clients to use replicated mode by passing VM command line arguments?

4) In replicated mode, if I add a new Zookeeper instance later on, will I have to stop and reconfigure the existing Zookeeper instances to work with the new one or is it sufficient to configure the new one to work with the existing ones?

Thank you very much,

cheers
Re: Configure Zookeeper zoodiscovery centralized and replicated mode [message #733410 is a reply to message #731954] Tue, 04 October 2011 16:51 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 493
Registered: July 2009
Senior Member

Hi Stefano,

> How do I configure such a setup?

Try this for some hints
http://zookeeper.apache.org/doc/r3.2.2/zookeeperStarted.html#sc_RunningReplicatedZooKeeper

>> 2) Plus I'd like to know if it's possible, using centralized, to have multiple
>> central servers talking between them or if I'd have to use the replicated mode.

No, that is replicated mode.

>> 3) Which leads to.. how do I configure server and
>> clients to use replicated mode by passing VM command line arguments?

All things that we do boils down to basic zookeeper configuration (see link above). You can pass arbitrary values to the underlying zookeeper.

To see how this is handled, please check this class and classes that use it (check the code I mean)

http://www.eclipse.org/ecf/org.eclipse.ecf.docs/api/org/eclipse/ecf/provider/zookeeper/core/DefaultDiscoveryConfig.html

Best regards,

Wim
Re: Configure Zookeeper zoodiscovery centralized and replicated mode [message #733414 is a reply to message #733410] Tue, 04 October 2011 17:00 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 493
Registered: July 2009
Senior Member

Hi, here is the source for that class.

http://git.eclipse.org/c/ecf/org.eclipse.ecf.git/tree/providers/bundles/org.eclipse.ecf.provider.zookeeper/src/org/eclipse/ecf/provider/zookeeper/core/DefaultDiscoveryConfig.java
Re: Configure Zookeeper zoodiscovery centralized and replicated mode [message #733424 is a reply to message #733410] Tue, 04 October 2011 17:36 Go to previous messageGo to next message
Stefano Ghio is currently offline Stefano GhioFriend
Messages: 12
Registered: September 2011
Junior Member
Cheers Wim and thanks for your reply,

Quote:

Try this for some hints
http://zookeeper.apache.org/doc/r3.2.2/zookeeperStarted.html#sc_RunningReplicatedZooKeeper

http://www.eclipse.org/ecf/org.eclipse.ecf.docs/api/org/eclipse/ecf/provider/zookeeper/core/DefaultDiscoveryConfig.html


Yes, sorry I forgot to mention that I have already consulted those resources you linked. Unfortunately, they do not add any basic configuration guidelines and I think I'm missing something in mine.

I ruled out a possible firewall/proxy/network/port problem as the analogous standalone configuration works fine. Something is preventing the clients from successfully contacting the server(s) and I guess it's my bad configuration but I can't figure out what's wrong.

Have a nice day

[Updated on: Tue, 04 October 2011 20:48]

Report message to a moderator

Re: Configure Zookeeper zoodiscovery centralized and replicated mode [message #733602 is a reply to message #731954] Wed, 05 October 2011 08:07 Go to previous messageGo to next message
Ahmed Aadel is currently offline Ahmed AadelFriend
Messages: 1
Registered: July 2009
Junior Member
Hi Stefano,

Try adding "-Dzoodiscovery.autoStart" property to your server command line launch as well.


> java -Dzoodiscovery.autoStart -Dzoodiscovery.dataDir=name -Dzoodiscovery.flavor=zoodiscovery.flavor.centralized=192.168.23.28 -jar org.eclipse.osgi.jar -console -consoleLog -clean -configuration c:\temp\osgiserver\configuration

Kind regards,
Ahmed

[Updated on: Wed, 05 October 2011 08:10]

Report message to a moderator

Re: Configure Zookeeper zoodiscovery centralized and replicated mode [message #733618 is a reply to message #733602] Wed, 05 October 2011 08:34 Go to previous message
Stefano Ghio is currently offline Stefano GhioFriend
Messages: 12
Registered: September 2011
Junior Member
YES!

I knew I was missing something trivial, centralized mode works now. Thank you very much.

server launch:
java -Dzoodiscovery.autoStart=true -Dzoodiscovery.dataDir=name -Dzoodiscovery.flavor=zoodiscovery.flavor.centralized=IP -jar org.eclipse.osgi.jar -console -consoleLog -clean -configuration path


client launch:
java -Dzoodiscovery.autoStart=true -Dzoodiscovery.flavor=zoodiscovery.flavor.centralized=IP -jar org.eclipse.osgi.jar -console -consoleLog -clean -configuration path


Note:
if you do not set the ecf.exported.containerfactoryargs property in every bundle which publishes a service, the services would be discovered by the server's Zookeeper instance but then you would immediately get an UnknownHostException if the machine running the server is unable to resolve the hostname of the publishing machine

Cheers
Previous Topic:A problem with install ECF 3.5.2
Next Topic:problem getting the examples running on Max OSX Server Lion
Goto Forum:
  


Current Time: Fri Apr 19 06:55:29 GMT 2024

Powered by FUDForum. Page generated in 0.04290 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top