从外部ip访问cassandra

时间:2017-09-21 16:23:24

标签: cassandra cassandra-3.0

我试过在cassandra.yaml中设置这些:

  1. rpc_address:192.168.1.xx listen_address:192.168.1.xx broadcast_address:192.168.1.xx

  2. rpc_address:0.0.0.0 listen_address:192.168.1.xx broadcast_address:192.168.1.xx

  3. 在这两种情况下,我只能从localhost(127.0.0.1)

    进行访问

    但是当我查看nodetool状态时 它显示了这个

    [root @ localhost conf] #stodetool status

    - 地址加载令牌拥有(有效)主机ID Rack UN 192.168.1.xx 1.23 MB 256 100.0%cedb8433-a3b3-4fb4-bee7-dae6174712ef rack1

    如何正确设置外部访问?

1 个答案:

答案 0 :(得分:0)

在cassandra.yaml中,将listen_address设置为节点的私有IP地址,将broadcast_address设置为节点的公共地址,将rpc_address设置为“0.0.0.0”

请查看How to configure cassandra for remote connectionCan't connect to cassandra node from different host

希望这有帮助!

由于