为什么cassandra没有连接到服务器?

时间:2016-10-19 09:25:55

标签: cassandra

我已经安装了cassandra并对其进行了处理。它运作正常。现在,它显示为 -

localhost/<> is in use by another process. Change listen_address:storage_port in cassandra.yaml to values that do not conflict with other services Fatal configuration error; unable to start server. See log for stacktrace. INFO 09:17:02 Announcing shutdown INFO 09:17:02 Compacted 4 sstables to [./../data/data/system/local-7ad54392bcdd35a684174e047860b377/system-local-ka-33,]. 6,485 bytes to 5,751 (~88% of original) in 223ms = 0.024595MB/s. 4 total partitions merged to 1. Partition merge counts were {4:1, } INFO 09:17:04 Waiting for messaging service to quiesce user@inblrlt-user:~/dev/Cassandra/apache-cassandra-2.1.7/bin$ ./cqlsh Connection error: ('Unable to connect to any servers', {'127.0.0.1': OperationTimedOut('errors=None, last_host=None',)})

如何更改我的服务器地址以清除问题?

1 个答案:

答案 0 :(得分:1)

您的本地主机已在使用中。请按照以下步骤进行操作 -

$ jps

您会看到某些进程正在运行。例如:

9107 Jps 1112 CassandraDaemon

然后按执行CassandraDaemon后看到的进程ID终止jps进程。在我的示例中,此处为1112的流程ID CassandraDaemon

$ kill -9 1112

然后在一段时间后再次检查流程 -

$ jps

您将看到CassandraDaemon将不再可用。

9170 Jps

然后移除您的saved_cachescommilog并再次启动cassandra

如果您想将 listen_address localhost 更改为任何私人IP或公共IP,您需要进行以下更改:

  1. 在cassandra.yaml
  2. 更改种子
  3. 在cassandra.yaml
  4. 更改 listen_address:
  5. 在cassandra.yaml更改 rpc_address:
  6. 在cassandra-env.sh
  7. 设置JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=<place_your_ip_here>"