Cassandra'无法连接到任何服务器',错误代码10061 [英] Cassandra 'Unable to connect to any servers' with error code 10061

查看:157
本文介绍了Cassandra'无法连接到任何服务器',错误代码10061的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的本​​地专用网络中有cassandra,我试图从另一台PC进行访问,但是在连接到cassandra服务器时出现此错误。

I have cassandra in my local private network and I'm trying to access from a different PC but while connecting to cassandra server I'm getting this error.

from cassandra.cluster import Cluster
cluster = Cluster(["192.168.1.170"])
session = cluster.connect() 




('无法连接到任何服务器',{'192.168.1.170':
ConnectionRefusedError(10061,尝试连接到[('192.168.1.170',
9042)]。最后一个错误:由于目标$无法建立连接b $ b机器主动拒绝了它)})

('Unable to connect to any servers', {'192.168.1.170': ConnectionRefusedError(10061, "Tried connecting to [('192.168.1.170', 9042)]. Last error: No connection could be made because the target machine actively refused it")})

有人可以帮助我吗?

推荐答案

尽管这不是一个好习惯,但我仍然可以为您提供帮助。
我已经通过更改 cassandra.yaml 文件解决了这个问题

Though It is not a good practises but still I can help you with. I have solved this issue by changing the "cassandra.yaml" file


  1. 转到/ cassandra / conf /文件夹

  2. 编辑此 cassandra.yaml

  3. 查找rpc_address,将其更改为0.0。 0.0

  4. 保存您的 cassandra.yaml文件

  5. 重新启动您的cassandra服务器

  1. Go to /cassandra/conf/ folder
  2. Edit this "cassandra.yaml"
  3. Look for rpc_address change it to the 0.0.0.0
  4. Save your "cassandra.yaml" file
  5. Restart your cassandra server

这将解决您的错误。如果您仍然遇到任何问题,请告诉我。

This will solve your error. Let me know If you are still facing any issue.

这篇关于Cassandra'无法连接到任何服务器',错误代码10061的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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