我有两个进程(两个Java),我需要作为单个应用程序的一部分运行。
https://github.com/yahoo/kafka-manager
我应该指定在PaaS上运行Zookeeper的哪个端口?
这是我目前的设置:
Procfile已
web: zookeeper-3.4.6/bin/zkServer;bin/kafka-manager -Dhttp.port=$PORT
因此,通过此设置,我可以让Kafkamanager运行。但它没有数据,因为它也需要Zookeeper运行。因此,我对我的应用程序无能为力。
这是我的日志跟踪的一部分
2016-04-18T15:32:21.706-0400[App/0]OUTjava.net.ConnectException: Connection refused
2016-04-18T15:32:22.810-0400[App/0]OUT[[37minfo[0m] o.a.z.ClientCnxn - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
2016-04-18T15:32:22.811-0400[App/0]OUT[[33mwarn[0m] o.a.z.ClientCnxn - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
2016-04-18T15:32:22.811-0400[App/0]OUT at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361) ~[org.apache.zookeeper.zookeeper-3.4.6.jar:3.4.6-1569965]
2016-04-18T15:32:22.811-0400[App/0]OUTjava.net.ConnectException: Connection refused
2016-04-18T15:32:22.811-0400[App/0]OUT at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) ~[na:1.8.0_77]
2016-04-18T15:32:22.811-0400[App/0]OUT at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081) ~[org.apache.zookeeper.zookeeper-3.4.6.jar:3.4.6-1569965]
2016-04-18T15:32:22.811-0400[App/0]OUT at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[na:1.8.0_77]
很明显,它无法连接到localhost/127.0.0.1:2181
如何使此连接有效?