我将rpc_port设置为公共IP地址,现在我可以从外部服务器连接到Cassandra.
但是,我无法使用cqlsh从Cassandra服务器本身连接
我收到一个错误.Thar是:
Connection error: Could not connect to localhost:9160
是否有配置,我可以更改为能够从服务器本身连接?
默认情况下,检查行中的cassandra.yaml
文件是否rpc_port :
正常= 9160
登录到主机托管 cassandra
尝试cqlsh 127.0.0.1 9160
:无论如何都应该没问题
尝试cqlsh [IP of host] 9160
:如果确定,然后cassandra
从lan可以访问,如果确定,则cassandra
无法从lan
但只能到达localhost 127.0.0.1
您需要通过rpc_address
定义的连接到cassandra cassandra.yaml
.例如,我用cqlsh 10.0.80.49 9160
.
考虑改变/etc/cassandra.yaml
:
# Whether to start the thrift rpc server. start_rpc: false
至
start_rpc: true
如果你在OSX上
brew install cassandra
首先启动Cassandra
cassandra
通过CQL shell连接
cqlsh 127.0.0.1
如果你在cassandra日志中看到这个:
INFO [main] 2015-07-21 12:06:27,426 CassandraDaemon.java:406 - Not starting RPC server as requested. Use JMX (StorageService->startRPCServer()) or nodetool (enablethrift) to start it
然后只需打开一个终端和
$ nodetool enablethrift
如INFO消息中所写.现在应该工作.我的系统升级到cassandra 2.2.0时得到了这个