从IntelliJ运行Cassandra并得到错误"connection refused"



我正在尝试使用以下配置在我的系统上尝试Cassandra:

OS: Ubuntu 16.04 LTS
Kernel: 4.10.1
Cassandra source GitHub link: https://github.com/apache/cassandra
Setup process on IntelliJ link: https://wiki.apache.org/cassandra/RunningCassandraInIDEA

我打开一个终端并从Cassandra源代码的根目录中运行以下命令,而不会发生任何故障:

bin/cassandra -f (it starts Cassandra successfully)
bin/nodetool status (Get information about the node e.g. datacenter, status etc.)
bin/cqlsh (opens the interface for running the queries)

但是,当我遵循Intellij的设置过程时,我可以通过击中" run "来从Intellij启动服务器返回以下错误:

Failed to connect to '127.0.0.1:7199' - ConnectException: 'Connection refused (Connection refused).

有趣的是,当我运行" bin/cqlsh"命令时,它会成功连接,这意味着节点运行良好。

知道什么可能导致" nodetool状态" "返回"连接拒绝"?我还尝试关闭防火墙,但没有帮助。

通过添加更多的VM参数来解决问题:

Add the following VM arguments if you want to use nodetool
-Djava.rmi.server.hostname=$JMX_HOST (I entered 127.0.0.1)
-Dcom.sun.management.jmxremote.port=$JMX_PORT (I entered 7199)
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false

这是参考的链接:https://wiki.apache.org/cassandra/runningcassandraineclipse

使用Intellij:https://wiki.apache.org/cassandra/runningcassandrainidea,在Cassandra设置的Wiki页面中未提供这些VM参数(也发布在我的问题中)。

相关内容

最新更新