Alex,

Thank you for the help. This got me pointed in the right direction.  Although 
there are still some things I don't understand, it is working now.

I downloaded the zookeeper release archive from their website. I then ran the 
zkCli script on each of my servers and attempted to connect on the default port 
of 2181. This was successful on the "Service" computer. It failed on the 
"Consumer" computer. I then ran "sudo netstat -anp | grep LISTEN | grep java" 
to see what ports java was even listing on. Port 2181 is not one of them. So I 
can say with confidence that the zookeeper server is not running on the 
"Consumer" computer.

I ran the netstat on the "Service" computer and I see 2181 in the list. When I 
stop the "Aries Remote Service Admin Discovery Zookeeper" bundle in servicemix, 
the zookeeper server stops. When I start that bundle, the zookeeper server 
starts. So it looks like that bundle is actually launching the zookeeper server.

I verified that bundle is started on the "Consumer" computer and it is. I can 
start and stop that bundle all I want but zookeeper never successfully starts. 
This is the part I don't understand. Regardless, I did what you said and filled 
out <service_mix_dir>/etc/org.apache.aries.rsa.discovery.zookeeper.cfg with the 
host and port for my "Service" computer. So both computers are sharing the same 
one zookeeper instance. With that change, the echo example works correctly.

So the problem was down to the fact that zookeeper was not running on one 
computer. I still don't know why it was not running, but I was able to work 
around it.

I suppose in the long run I will want to run one instance of zookeeper per 
computer, regardless of how many servicemix instances I am running on that 
computer. With that in mind, I probably wont' ever take the time to figure out 
why zookeeper was not running in servicemix on that computer.

Jonathan
________________________________
From: Alex Weirig <[email protected]>
Sent: Friday, September 15, 2017 3:44 AM
To: [email protected]; Jonathan knez
Subject: Re: Echo TCP example not working on computer with multiple NICs


Hi Jonathan,


I'm not sure if this can help you but this is how I use karaf and zookeeper:


1) tell RSA where to find zookeeper:

Place a file named "org.apache.aries.rsa.discovery.zookeeper.cfg" with the 
following content into karaf's "etc" folder:


zookeeper.host = dns name of your zookeeer server
zookeeper.port = 2181
zookeeper.timeout = 3000



2) when using fastbin as transport I have to create a file named 
"org.apache.aries.rsa.provider.fastbin.cfg" in the "etc" folder containing:


uri = tcp://0.0.0.0:2550


otherwise I get a port collision



3) configure zookeeper, e.g.


# The number of milliseconds of each tick
tickTime=2000

# The number of ticks that the initial
# synchronization phase can take
initLimit=10

# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5

# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/opt/zookeeper-data

# Transaction log
#dataLogDir=/opt/zookeeper-data-log

# the port at which the clients will connect
clientPort=2181

# the maximum number of client connections.
# increase this if you need to handle more clients
maxClientCnxns=60

#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3

# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1

# Cluster servers
server.1=zk1:2888:3888
server.2=zk2:2888:3888
server.3=zk3:2888:3888







Schéin Gréiss,
Mit freundlichen Grüßen,
Meilleures salutations,
Kind regards,



Alex Weirig
Responsable Technique


Ville de Luxembourg - Centre Technolink
2, rue Charles de Tornaco
L - 2623 LUXEMBOURG
[email protected]<mailto:[email protected]>
Tel: +352 4796 - 6127
Fax: +352 42 88 81
www.technolink.lu<http://www.technolink.lu>



On 15/09/2017 00:49, Jonathan knez wrote:
I am just getting started with remote services in OSGi. To that end, I have 
downloaded Apache Karaf 4.1.2 and run through the Echo TCP example from the 
Aries-RSA github page. Here is a link.
https://github.com/apache/aries-rsa/tree/master/examples/echotcp


The example ran successfully when running two karaf instances on my single 
computer. I then ran one karaf instance on another networked computer. The two 
computers are connected via a LAN that allows all manner of network 
communication including multicast. When running the "Service" on one computer 
and the "Consumer" on the other computer, the example does not work. The 
Consumer bundle stays in a Waiting state.

When I run rsa:endpoints on the "Service" computer, I see that the EchoService 
is correctly bound to a local IP address. When I run rsa:endpoints on the 
"Consumer" computer, it shows no services.

The issue appears to be that the karaf instance on the "Consumer" computer has 
not found the "Service" endpoint on the other computer. Both computers have 
multiple NICs and multiple active network connections. Only one connection 
allows them to talk to each other. It just so happens that the "Service" 
endpoint is using the right address. I suspect that the "Consumer" karaf 
instance is not so lucky and is using the wrong NIC.

So my question is how can I configure this? I believe this might be a Zookeeper 
question but I am not clear on how to configure the zookeeper instance that 
Aries-RSA launches.

I appreciate the help.

Jonathan

--
This email was Anti Virus checked by SOPHOS UTM

Reply via email to