Both cases should already work with the echotcp example. https://github.com/apache/aries-rsa/tree/master/examples/echotcp
In the readme we start two karaf instances. The first instance starts a zookeeper server while the second instance only connects to it. In karaf you achieve this by installing the aries-rsa-discovery-zookeeper-server feature if you want a server and the aries-rsa-discovery-zookeeper if you only want a client. If you look at the feature file you see that the diference between the two features is indeed just the config file https://github.com/apache/aries-rsa/blob/master/features/src/main/resources/features.xml So if zookeeper server is created then you seem to have a config for it in config admin. Normally it is sufficient to remove the config file to remove the config .. but it does not work in all cases. For example if you remove the config while karaf is stopped then it will still be present in config admin. So I suggest to use the config commands to check if a config exists and to remove it. For running two instances on the same machine you indeed need to tweak some configs. It depends on which transports you use. Can you give some more details? For example for the tcp transport you need to provide one unique port per service: https://github.com/apache/aries-rsa/blob/master/examples/echotcp/service/src/main/java/org/apache/aries/rsa/examples/echotcp/service/EchoServiceImpl.java Christian 2017-09-29 18:45 GMT+02:00 Jonathan knez <[email protected]>: > I am successfully using Aries RSA to provide an OSGi service on one host > and consume it on other hosts. I am impressed at how well it works. Thanks > to the Aries team for doing all the hard work. > > > > No on to my question. I want to run my own zookeeper server externally and > have RSA connect to it. I do not want RSA to try to start its own zookeeper > server. I also want to run multiple OSGi containers (ServiceMix in this > case) with RSA loaded on a single machine. > > > > This webpage describes how to configure RSA zookeeper discovery. > > https://github.com/apache/aries-rsa/tree/master/discovery/zookeeper > > > > I have successfully updated the “org.apache.aries.rsa.discovery.zookeeper” > file to point to my existing server. RSA successfully connects to it and > life is good. It looks like RSA still tries to create its own zookeeper > server however. How do I prevent that behavior? I have tried leaving the > org.apache.aries.rsa.discovery.zookeeper.server empty and also deleting > the file entirely. In both cases, I still see stuff listening on 2181 > (default zk client port). > > > > My second question is how can I successfully run two servicemix instances > with RSA on a single host? When I attempt this, the first instances starts > fine and connects to zookeeper without issue. The second instance fails to > even attempt to connect to zookeeper. If I shutdown the first instance and > only star the second, the second connects without issue. I assume some port > numbers need to change to avoid conflicts between the two servicemix > instances. Any thoughts on what configs needs to change? > > > > My ultimate need is to for a team of developers to be able to share a > single machine with each developer running at least 2 instances of > servicemix to test their stuff without affecting any of the other > developers. That is why I want each developer to be responsible for running > their own zookeeper server at some unique address, then telling > unique RSA instances where to find their zookeeper instance. If there is a > different way to achieve what I am after, I would welcome the feedback. > Thanks. > > -- -- Christian Schneider http://www.liquid-reality.de <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de> Computer Scientist http://www.adobe.com
