【问题标题】:Running Cassandra from IntelliJ and get error "connection refused"从 IntelliJ 运行 Cassandra 并收到错误“连接被拒绝”
【发布时间】:2017-03-09 08:11:08
【问题描述】:

我正在尝试使用以下配置在我的系统上使用 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”但始终点击“nodetool status”命令从 IntelliJ 启动服务器返回以下错误:

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

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

知道什么可能导致“nodetool status”返回“连接被拒绝”吗? 我也尝试关闭防火墙,但没有帮助。

【问题讨论】:

    标签: cassandra ubuntu-16.04


    【解决方案1】:

    通过添加更多 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 设置 Cassandra 的 wiki 页面中未提供这些 VM 参数:https://wiki.apache.org/cassandra/RunningCassandraInIDEA(也发布在我的问题中)。

    【讨论】:

      猜你喜欢
      • 2011-01-23
      • 2021-03-29
      • 2023-03-15
      • 1970-01-01
      • 2016-02-27
      • 1970-01-01
      • 2015-05-21
      • 2018-02-11
      相关资源
      最近更新 更多