Zookeeper cannot be launched remotely via ssh

Strange issue: The zookeeper works normally on my cluster if I start it using ./zkServer.sh on each machine, respectively.

However, when I try to start it remotely from the master node:

ssh 192.168.xxx.xxx "/opt/apache/zookeeper-3.4.5/bin/zkServer.sh start"

it looks fine:

JMX enabled by default
Using config: /opt/apache/zookeeper-3.4.5/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED

But actually, zookeeper is not running on that machine, which can be confirmed by jps.

The most strange thing is: If I directly start zookeeper on that node using ./zkServer.sh start then I can successfully stop it remotely from the master node using

ssh 192.168.xxx.xxx "/opt/apache/zookeeper-3.4.5/bin/zkServer.sh stop"

Why could this happen? Any help would be appreciated.


Though after a lot of search I was able to get it, below is the command that successfully starts it.

ssh -i "somekey.pem" username@hostname 'bash -i -c "~/zookeeper-3.4.6/bin/zkServer.sh start"'

Need Your Help

Maintaining FIFO when using threads in Java

java multithreading concurrency parallel-processing

I am attempting to perform an expensive and variable length task on elements received in a sequential manner. It is imperative that element order is maintained while still processing each element q...

Filtering results based on many to many relationships

.net sql-server many-to-many

I'd like to filter the results of a query which returns the results from two tables which have any to many relationship to each other.