如何使用 cqlsh 将 Cassandra 连接到本地主机? [英] How to connect Cassandra to localhost using cqlsh?
本文介绍了如何使用 cqlsh 将 Cassandra 连接到本地主机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将 rpc_port 设置为公共 IP 地址,现在我可以从外部服务器很好地连接到 Cassandra.
I set rpc_port to the public IP address, and now I can connect to Cassandra just fine from an outside server.
但是,我无法使用 cqlsh 从 Cassandra 服务器本身进行连接
However, I cannot connect from the Cassandra server itself, using cqlsh
我收到一个错误.Thar是:
I am getting an error.Thar are:
Connection error: Could not connect to localhost:9160
是否有配置,我可以更改为能够从服务器本身连接?
Is there a configuration, I can change to be able to connect from the server itself ?
推荐答案
- 检查
cassandra.yaml
文件与rpc_port :
通常默认= 9160
- 登录到托管
cassandra
的机器 - 试试
cqlsh 127.0.0.1 9160
:无论如何应该没问题 - try
cqlsh [IP of host] 9160
: 如果正常,则cassandra
可从局域网访问,如果正常,则cassandra
无法从lan
但只有localhost 127.0.0.1
- Check the
cassandra.yaml
file on the line withrpc_port :
normally by default= 9160
- Login to the machine hosting
cassandra
- Try
cqlsh 127.0.0.1 9160
: should be ok in any case - try
cqlsh [IP of host] 9160
: if ok thencassandra
reachable from lan, if ok thencassandra
is not reachable fromlan
but onlylocalhost 127.0.0.1
这篇关于如何使用 cqlsh 将 Cassandra 连接到本地主机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文