Apache Cassandra中的远程访问

时间:2015-06-26 09:17:41

标签: cassandra

我有两台机器安装了apache cassandra,带有IP(192.168.1.101和192.168.1.102)。

我想从192.168.1.102远程登录到192.168.1.101

我在192.168.1.101编辑了rpc_address = 0.0.0.0和cassandra.yaml文件

当我尝试使用

从192.168.1.102连接时
cqlsh 192.168.1.101 9061

我得到这样的错误

Connection error: ('Unable to connect to any servers', {'192.168.1.107': 
error(111, "Tried connecting to [('192.168.1.107', 9160)]. Last error: 
Connection refused")})

我想在192.168.1.102做什么配置,或者我错过了什么。

请帮帮我

提前致谢

1 个答案:

答案 0 :(得分:1)

I see multiple issues here:

  1. Cqlsh uses port 9042 to access cassandra, not 9061. It's declared in cassandra.yaml as native_transport_port
  2. By default Cassandra listens for CQL connections only on localhost. See listen_address in cassandra.yaml and set it to node's public IP address.

I suggest:

  • double-check cassandra logs that it completed the startup without errors.
  • try to connect to localhost with cqlsh