Python cassandra驱动程序:连接到远程数据库时出错

时间:2018-08-28 09:30:21

标签: python cassandra cassandra-python-driver

我正在尝试使用python cassandra驱动程序连接到远程cassandra数据库。这是我的代码。

from cassandra.cluster import Cluster
from cassandra.auth import PlainTextAuthProvider

ap = PlainTextAuthProvider(username='abc', password='xxx')

cluster = Cluster(['35.x.x.x' ,'35.x.x.x', '36.x.x.x'], port=9042, auth_provider= ap)

session = cluster.connect()

错误消息如下。

File "cas_sam.py", line 11, in <module>
session = cluster.connect()
File "cassandra/cluster.py", line 1247, in cassandra.cluster.Cluster.connect
File "cassandra/cluster.py", line 1283, in cassandra.cluster.Cluster.connect
File "cassandra/cluster.py", line 1270, in cassandra.cluster.Cluster.connect
File "cassandra/cluster.py", line 2773, in cassandra.cluster.ControlConnection.connect
File "cassandra/cluster.py", line 2816, in cassandra.cluster.ControlConnection._reconnect_internal
cassandra.cluster.NoHostAvailable: ('Unable to connect to any servers', {'35.x.x.x': AttributeError("'NoneType' object has no attribute 'release_version'",), '36.167.4.47': error(None, "Tried connecting to [('36.x.x.x', 9042)]. Last error: timed out"), '35.x.x.x': OperationTimedOut('errors=None, last_host=None',)})

有人可以帮我了解这里发生的事情吗?

0 个答案:

没有答案
相关问题