[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ecf-dev] remote service / zookeeper problems
- From: Wim Jongman <wim.jongman@xxxxxxxxx>
- Date: Thu, 19 Aug 2010 11:23:47 +0200
- Delivered-to: email@example.com
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=o5uyefveAgMf8fmZvFEmp4IJTzU7QzWfcvM38sGXPEvbrzSnTGDzj/+SUcA96kL5+D 04nwiH0h5TnF3tqCrj7xribAtThaz8sXb7sN+7f77TVBSSFn+sYwcyoc+ZbBvxcigQTc G1pQIy1nk/SyFvvPbHUZ3NYGTCtEPAEPrfbfE=
First thanks for helping to document all the different use cases.
As per your request/case I have changed the code in the "fun with remote services" blog 
for the consumer side in order to demonstrate how things work. You are now able to enter a list of hosts separated by comma in the zooQuotes GUI.
This will change the client from running in "centralized" mode to running in "standalone" mode.
The former relies on a central hub to where other zookeepers servers connect. In this case, the client needs to know only one server to be informed about the entire network. Pretty powerful.
The latter, "standalone", will hook to all provided zookeeper servers and synchronize with each of them. If you run more servers on the same machine you will have port conflicts. Look at the zookeeper consumer product configuration 
and in the zoodiscovery page 
on how to run a server with different ports specified.
If you look at the consumer code 
you will see that the startZookeeper method will now detect if there are more than one servers in the list.
I still have the quote server running at yazafatutu.com
. If you run one local server then you do not have port conflicts and it will run out of the box.
In the GUI, enter yazafatutu.com
,localhost and you will see service discoveries from two hosts.
I have also changed the quotes server 
to autostart the server bundle. Please press "run as eclipse application" in the supplied product to run the server locally.
Sorry for the frustration but as you know: everything is difficult until it becomes easy. At least you have made it into the FAQ section 
The yazafatutu servers sometimes quits for unknow reasons 
so ping me on skype wim.jongman if you cannot connect to it so I can start it again.
On Thu, Aug 19, 2010 at 7:22 AM, Scott Lewis <slewis@xxxxxxxxxxxxx>
I would guess from this error and your description of what you have done is that even though you have moved the servers to different hosts, you probably have started the servers using the default server id...which is: ecftcp://localhost:3282/server
Bryan Hunt wrote:
I think part of my problem is my understanding of zookeeper and ECF containers. It appears that ECF starts a zookeeper server so having more than one ECF framework with zookeeper running on the same host causes port bind problems. It also appears that the ECF container is having a port conflict (not completely sure about this one).
I moved my servers to different hosts, and now zookeeper is discovering the services, but the proxies are not registered on the consumer. When I restarted the consumer, I got the following exception:
Connect error in getRemoteServiceReferences;severity4;exception=org.eclipse.ecf.core.ContainerConnectException: Exception during connection to ecftcp://localhost:3282/server;children=]]
org.eclipse.ecf.core.ContainerConnectException: Exception during connection to ecftcp://localhost:3282/server
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
... 8 more
Why is the consumer trying to connect to localhost when the service is on a different host? Shouldn't zookeeper give ECF the proper host for the remote service?
It uses localhost as the default rather than trying to choose/figure out a hostname...at least for the examples. So you should probably set the hostname explicitly upon server start/container creation (i.e. so it's not localhost, but rather a host which the consumer can find on the network.e.g. ecftcp://myhost.com:3282/server
WRT zookeeper behavior I'll have to defer to Wim to answer...i.e. about how to enable/disable/configure zookeeper server in the case where you have more than one service being hosted.
One question I have about your use case: All of the following are possible with ECF
1) two hosts/processes with one container per host (listening on whatever port), each container with a single service host
2) one host/process with two containers (listening on different ports necessarily), and a single service host within each container
3) one host/process with one container (listening on a single port), with *two* service hosts exposed by that container
I'm not clear from your description of the use case whether any of these is preferred over another. They are all three possible, but have separate issues of configuration, startup, etc (as you might expect)...and depending upon desired/expected behavior, they can be more or less complicated to start, understand, coordinate, etc.
If I ever get this working, I'll update my blog tutorial on remote services. Nobody should have to go through this much effort for something that should be simple.
On Aug 18, 2010, at 9:21 PM, Bryan Hunt wrote:
I'm trying to get OSGi remote services working with ECF 3.3 / zookeeper and ecf.generic.server
I have a system with three processes using OSGi remote services: one is the consumer, and the other two are servers. The servers each publish one instance of the same remote service and this appears to be working correctly. If I look at the list of services on each of the servers, I see the service registered twice: once by my code, and once by org.eclipse.ecf.osgi.services.distribution. I see two sets of connections on the zookeeper console - one for each server.
Here is the problem ...
The consumer sees only one remote service instead of two - the service published by the server started first. Note that all processes are running in separate JVMs on the same machine. I also have the zookeeper server running on the same machine. Any ideas here? Is there tracing on a specific bundle that might help track down the problem? Any specific breakpoints I can set?
Also note that I've tried both jmdns and slp for discovery and neither one of them can get the service published on the server end. jmdns seems to choke on the number of parameters I need to configure the service, and slp simply throws an exception. I've debugged the jmdns problem a bit and I'll open a bug at some point, but right now, I'm really hoping to get zookeeper working.
I'm going to try to dig deeper - any suggestions to reduce the debug time would be appreciated.
ecf-dev mailing list
ecf-dev mailing list
ecf-dev mailing list