|
Re: Problems with ZooDiscovery [message #1513475 is a reply to message #1513458] |
Tue, 16 December 2014 15:17 |
|
Hi Robert,
What is not working? It looks like the service is discovered and published in the local registry. All you have to do is to consume it. What do you want to do with the IDiscoveryLocator? You don't have to mess around with the internals of ECF. It should all be transparent.
Make sure the ecf distribution bundle is started in both runtimes.
Cheers,
Wim
|
|
|
|
Re: Problems with ZooDiscovery [message #1513572 is a reply to message #1513475] |
Tue, 16 December 2014 17:03 |
|
Hello Robert,
I should totally revisit that page!! At least we should make clear that the "inner concepts" are for people that want to tinker with the gory details from the past. This is not you.
This is how you must use ECF remote services with zoodiscovery
1. You start your server runtime with -Dzookeeper.autoStart (or use our public server, see below)
2. Start your client runtime with -Dzookeeper.autoStart and -Dzoodiscovery.flavor=zoodiscovery.flavor.centralized=SET.ZOODISCOVERY.SERVER.IP.HERE
3. You register a service with the correct remoting properties [2]
That should be it. Everything else is done automatically by ECF.
We have got a public zoodiscovery server running here:
-Dzoodiscovery.flavor=zoodiscovery.flavor.centralized=disco.ecf-project.org
-Dzoodiscovery.clientPort=2181
If you get serious then you should run your own dedicated zookeeper server [1]
Cheers,
Wim
[1] https://github.com/ECF/ZooServer
[2] The remoting properties are very important. For the generic server they are:
pinProps.put("service.exported.interfaces", "*"); // picked up by ECF as a service to be remoted
pinProps.put("service.exported.configs", "ecf.generic.server");
pinProps.put("ecf.generic.server.port", "3288"); // The port where the generic server can be reached (FIREWALL!!!)
pinProps.put("ecf.generic.server.hostname", InetAddress.getLocalHost().getHostAddress()); // this is where the server can be reached from other hosts (NOT 127.0.0.1 !!!)
|
|
|
|
|
Re: Problems with ZooDiscovery [message #1515735 is a reply to message #1514343] |
Thu, 18 December 2014 10:21 |
Robert Lechner Messages: 7 Registered: December 2014 |
Junior Member |
|
|
I figured out that the bundles org.eclipse.ecf.remoteservice and org.eclipse.ecf.server.generic are not started, when running as a RCP application. So I added the following lines to the activator of my applications:
Platform.getBundle("org.eclipse.ecf.remoteservice").start();
Platform.getBundle("org.eclipse.ecf.server.generic").start();
Platform.getBundle("org.eclipse.ecf.provider.zookeeper").start();
Now the bundles are started (checked with a breakpoint in its activators), but still the generic server is not running (checked by trying to connect to it).
I use the following code to register my service:
Dictionary<String, String> props = new Hashtable<>();
props.put("service.exported.interfaces", "*");
props.put("service.exported.configs", "ecf.generic.server");
props.put("ecf.generic.server.hostname", "hostname_of_my_local_machine");
props.put("ecf.generic.server.port", "3282");
props.put("ecf.generic.server.path ", "/server");
ServiceRegistration<MyService> reg = bundleContext.registerService(
MyService.class, new MyServiceImpl(), props);
The ECF generic server works in a RCP application (without manually starting any bundles), if I manually create a ServiceTracker, a IContainer and a IRemoteServiceContainerAdapter (see github.com/ECF/ECF-Examples/tree/master/org.eclipse.ecf.examples.remoteservices.generic.host).
But I was not able to use ZooKeeper with that approach.
Any ideas?
|
|
|
Re: Problems with ZooDiscovery [message #1517305 is a reply to message #1515735] |
Fri, 19 December 2014 12:03 |
|
Hi Robert,
With discovery there is no need to do this manual stuff.
did you add:
-Dzookeeper.autoStart
-Dzoodiscovery.flavor=zoodiscovery.flavor.centralized=SET.ZOODISCOVERY.SERVER.IP.HERE
Please disable both firewalls to see if this is the issue.
I need to see your console logs to tell you anything. You should see that zookeeper is started and connected to the server and that is sees and publish services. Is the ECF distribution bundle started?
Cheers,
Wim
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04091 seconds