如何使用 cqlsh 将 Cassandra 连接到本地主机? [英] How to connect Cassandra to localhost using cqlsh?

查看:19
本文介绍了如何使用 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 ?

推荐答案

  1. 检查cassandra.yaml 文件与rpc_port : 通常默认= 9160
  2. 登录到托管 cassandra
  3. 的机器
  4. 试试 cqlsh 127.0.0.1 9160 :无论如何应该没问题
  5. try cqlsh [IP of host] 9160 : 如果正常,则 cassandra 可从局域网访问,如果正常,则 cassandra 无法从 lan 但只有 localhost 127.0.0.1
  1. Check the cassandra.yaml file on the line with rpc_port : normally by default = 9160
  2. Login to the machine hosting cassandra
  3. Try cqlsh 127.0.0.1 9160 : should be ok in any case
  4. try cqlsh [IP of host] 9160 : if ok then cassandra reachable from lan, if ok then cassandra is not reachable from lan but only localhost 127.0.0.1

这篇关于如何使用 cqlsh 将 Cassandra 连接到本地主机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆