Cassandra 'Unable to connect to any servers' with error code 10061

匿名 (未验证) 提交于 2019-12-03 01:39:01

问题:

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()  

('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")})

Can someone help me out ?

回答1:

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. 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.



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!