用于cassandra-driver数据库的cassandra.cluster.NoHostAvailable“无法连接到任何服务器”

时间:2017-03-30 19:30:47

标签: python

当我使用此命令时:

>>> session = cluster.connect() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "cassandra/cluster.py", line 1152, in cassandra.cluster.Cluster.connect (cassandra/cluster.c:17598) File "cassandra/cluster.py", line 1185, in cassandra.cluster.Cluster.connect (cassandra/cluster.c:17419) File "cassandra/cluster.py", line 1172, in cassandra.cluster.Cluster.connect (cassandra/cluster.c:17122) File "cassandra/cluster.py", line 2618, in cassandra.cluster.ControlConnection.connect (cassandra/cluster.c:47646) File "cassandra/cluster.py", line 2655, in cassandra.cluster.ControlConnection._reconnect_internal (cassandra/cluster.c:48543) cassandra.cluster.NoHostAvailable: ('Unable to connect to any servers', {'127.0.0.1': ConnectionRefusedError(111, "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")})

...它给我一个错误说:

cd %USERPROFILE%\Desktop (choose a folder to create the shortcut)
mklink linkName targetFolderOrFile

我在Fedora上。

1 个答案:

答案 0 :(得分:0)

以下是使用DataStaX python驱动程序(cassandra-driver)连接到Cassandra实例的标准过程

bcrypt.compare

注意:我已根据本地cassandra群集添加了连接凭据。但是,连接到其他实例时,这些凭据会有所不同。