Issue
I am trying to use Cassandra on my computer. What I have done:
! pip install cassandra-driver
Successfully installed cassandra-driver-3.24.0 geomet-0.2.1.post1
import Cassandra
Create a connection to the database
Then the connection to the database
from cassandra.cluster import Cluster
try:
cluster = Cluster(['127.0.0.1'])
session = cluster.connect()
except Exception as e:
print(e)
There is an error:
('Unable to connect to any servers', {'127.0.0.1:9042': ConnectionRefusedError(10061, "Tried connecting to [('127.0.0.1', 9042)]. Last error: No connection could be made because the target machine actively refused it")})
I am wondering whether there is a configuration problem, then I check below: The user variable for Java_Hone as below:
Cassandra is installed here:
C:\Users\xx\anaconda3\Lib\site-packages
There are two packages under site-packages:
I have checked a lot of answers, but couldn't find the solution. I am not familiar with the configuration. Can anybody help with it? Thanks.
Solution
I've responded to this same question you posted on community.datastax.com.
You're connecting to the cluster on localhost
and it's not running there so the connection fails. You need to specify one of the IPs of the nodes in the cluster.
For more info, see my answer to your post in https://community.datastax.com/questions/9162/. Cheers!
Answered By - Erick Ramirez
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.