Use Existing Zookeeper Instance for RSA / Multiple RSA Instances Per Machine

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Use Existing Zookeeper Instance for RSA / Multiple RSA Instances Per Machine

Jonathan knez

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.


Reply | Threaded
Open this post in threaded view
|

Re: Use Existing Zookeeper Instance for RSA / Multiple RSA Instances Per Machine

Christian Schneider
Both cases should already work with the echotcp example. 

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: 

Christian

2017-09-29 18:45 GMT+02:00 Jonathan knez <[hidden email]>:

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

Computer Scientist

Reply | Threaded
Open this post in threaded view
|

Re: Use Existing Zookeeper Instance for RSA / Multiple RSA Instances Per Machine

Jonathan knez
In reply to this post by Jonathan knez
Christian,

Thank you for your help. You were correct. I had installed the aries-rsa-discovery-zookeeper-server bundle on both instances. I then removed the server bundle but still saw instances being created. I even deleted the config file, but I did that while servicemix was stopped so the configuration was still in place when I restarted. I deleted the entire servicemix data directory and started over again, this time not installing the aries-rsa-discovery-zookeeper-server bundle. It worked exactly as I hoped. All instances are connecting to a zookeeper server that I am running externally. This is exactly what I wanted.

Jonathan

From: Jonathan knez <[hidden email]>
Sent: Friday, September 29, 2017 12:45 PM
To: [hidden email]
Subject: Use Existing Zookeeper Instance for RSA / Multiple RSA Instances Per Machine
 

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.