Cassandra总是正常的,但是今天当我去cassandra的bin文件夹并运行./cassandra
时,没有任何响应,只是进入一个新的命令行,没有那个打开过程。我也无法打开cqlsh。你能帮我解决这个问题吗?
system.log显示唯一的错误:
ERROR [main] 2017-08-07 10:33:59,154 CassandraDaemon.java:655 - Port already in use: 7199; nested exception is:
java.net.BindException: Address already in use (Bind failed)
java.net.BindException: Address already in use (Bind failed)
at java.net.PlainSocketImpl.socketBind(Native Method) ~[na:1.8.0_141]
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387) ~[na:1.8.0_141]
at java.net.ServerSocket.bind(ServerSocket.java:375) ~[na:1.8.0_141]
at java.net.ServerSocket.<init>(ServerSocket.java:237) ~[na:1.8.0_141]
at javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:231) ~[na:1.8.0_141]
at org.apache.cassandra.utils.RMIServerSocketFactoryImpl.createServerSocket(RMIServerSocketFactoryImpl.java:33) ~[apache-cassandra-2.2.10.jar:2.2.10]
at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:666) ~[na:1.8.0_141]
at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:330) ~[na:1.8.0_141]
at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:249) ~[na:1.8.0_141]
at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:411) ~[na:1.8.0_141]
at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:147) ~[na:1.8.0_141]
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:236) ~[na:1.8.0_141]
at sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:213) ~[na:1.8.0_141]
at sun.rmi.registry.RegistryImpl.<init>(RegistryImpl.java:173) ~[na:1.8.0_141]
at sun.rmi.registry.RegistryImpl.<init>(RegistryImpl.java:144) ~[na:1.8.0_141]
at java.rmi.registry.LocateRegistry.createRegistry(LocateRegistry.java:239) ~[na:1.8.0_141]
at org.apache.cassandra.service.CassandraDaemon.maybeInitJmx(CassandraDaemon.java:119) [apache-cassandra-2.2.10.jar:2.2.10]
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:188) [apache-cassandra-2.2.10.jar:2.2.10]
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:533) [apache-cassandra-2.2.10.jar:2.2.10]
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:642) [apache-cassandra-2.2.10.jar:2.2.10]
答案 0 :(得分:1)
似乎端口已经在使用中。 您可以按以下方式终止进程
sudo fuser -n tcp 7199
它将显示在该端口上运行的所有进程ID。 您可以使用以下命令终止。
sudo kill -9 Pid
现在开始Cassandra。它会开始。
答案 1 :(得分:0)
如果某些内容合法地使用默认的JMX端口(7199),您可以非常轻松地更改Cassandra用于JMX的端口。在JMX_PORT
文件中查找cassandra-env.sh
行,并将其更改为您不知道正在使用的端口:
JMX_PORT="7199"
为:
JMX_PORT="9455"
消除该端口冲突,然后查看Cassandra是否会启动。