【问题标题】:Unable to establish connection, All host(s) tried for query failed无法建立连接,所有主机尝试查询失败
【发布时间】:2019-01-04 04:56:58
【问题描述】:

我知道这可能是基本问题,但由于我是 cassandra 新手,并且在任何地方都没有找到解决方案,所以当我尝试在 DataStax 开发中心连接到 cassandra 服务器时,它给了我以下异常。

以下是系统配置:

操作系统:Windows 10 专业版(64 位)

apache-cassandra-3.11.2

下面是cassandra.yaml配置:

start_native_transport: true

broadcast_rpc_address: 1.2.3.4

native_transport_port_ssl: 9142

listen_address: 192.168.2.22

rpc_address: 192.x.x.x

我已经在 cassandra.yaml 文件中完成了这些更改:start_rpc: true rpc_port: 9042

在 cmd 上运行此命令时:nodetool -h localhost -p 9042 status

收到此错误:Failed to connect to 'localhost:9042' - ConnectIOException: 'non-JRMP server at remote endpoint'.

任何帮助将不胜感激。

【问题讨论】:

    标签: cassandra nosql datastax cassandra-3.0


    【解决方案1】:

    似乎您已将 native-transport-port 配置为 :9142,但您正在尝试使用开发中心连接到 9042 端口。请更正并验证。

    【讨论】:

    • 但我的 native_transport_port 是 9042
    【解决方案2】:

    您已将 rpc (rpc_port) 设置为使用与 cql (native_transport_port) 相同的端口。您确定要使用 rpc 吗?这是旧的不推荐使用的接口,除非您需要它以实现向后兼容性,否则不应使用它。

    如果您确实想使用 rpc,那么它必须是 native_transport_port 之外的另一个端口。

    【讨论】:

      【解决方案3】:

      您应该为 nodetool 使用 jmx 端口(默认为 7199)

      【讨论】:

        【解决方案4】:

        我找到了这个问题的答案,下面是第一次安装 Cassandra 时需要配置的配置:

        broadcast_rpc_address: 192.168.2.22(ip address of system on which Cassandra is installed
        
        rpc_address: 0.0.0.0
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2016-07-30
          • 2021-09-16
          • 2019-02-25
          • 2016-02-13
          • 2015-01-28
          • 2021-01-30
          • 2015-01-03
          • 2019-01-18
          相关资源
          最近更新 更多