I have been trying to run Zookeeper on a Debian Docker container. Whenever I run the command zkServer.sh start to actually start it, I get the following error:
ZooKeeper JMX enabled by default
Using config: /zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... FAILED TO START
At this point I have tried running it with different configurations and I do not think that the problem is in the zoo.cfg itself. However, I am wondering if it might be a port problem. In my Dockerfile I have exposed the following ports:
EXPOSE 2181/tcp
EXPOSE 2888/tcp
EXPOSE 3888/tcp
EXPOSE 8080/tcp
I have not experienced any problems when I tried to run Zookeeper on a Windows so I am guessing it has something to do with the set-up that I am making. Any ideas what might be causing Zookeeper to fail? Or at least where I can check for any errors during initialization? I have looked at the log files and did not find anything that points to a problem.
EDIT: I have noticed that if I rerun the command it says: "Starting zookeeper ... already running as process 24". Furthermore, I am able to start other applications and use the already running server...
EDIT 2: I have tried running it on different images, including Alpine. I get the same error and the same problem as in the first edit. So it is something from the way I am setting it up through docker... Maybe there is something about the ports that I do not know?