作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在使用 Cassandra 的 DataStax Python 驱动程序本地连接到 Cassandra(在 EC2 节点上运行)时遇到问题:(类似于 this question)
from cassandra.cluster import Cluster
cluster = Cluster(['127.0.0.1'], port=9042)
cluster.connect()
我得到:
cassandra.cluster.NoHostAvailable: ('Unable to connect to any servers', {'127.0.0.1': OperationTimedOut('errors=Timed out creating connection (5 seconds), last_host=None',)})
如果我运行也一样:
cluster = Cluster(['127.0.0.1'], port=9160)
cluster.connect()
该服务似乎在正确的端口上监听:
网络统计-nltp | grep 9042(无法读取“-p”的信息:geteuid()=1000 但您应该是 root。)tcp6 0 0 127.0.0.1:9042:::* 听 -
命令 cqlsh 127.0.0.1 9042
也能完美运行。
我在文件 cassandra.yaml
上有默认设置:
start_native_transport: true
native_transport_port: 9042
rpc_address: localhost
rpc_port: 9160
我还尝试用我的 ec2 实例的 PRIVATE_IP 更改 rpc_address 但没有任何改变。
我不使用 PyCharm,我在我的实例上使用 python 的交互式控制台。
有人可以向我解释我做错了什么吗?
谢谢
最佳答案
通过使用 DataStax Community AMI 重新安装 cassandra 解决在亚马逊 AWS 上。可能是 Cassandra 和 Datastax python 驱动程序版本的问题。
关于python - 我无法使用 DataStax Python 驱动程序连接到 Cassandra,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33743143/
我正在开发一个 voip 调用应用程序。我需要做的是在接到来电时将 Activity 带到前台。我在应用程序中使用 Twilio,并在收到推送消息时开始调用。 问题是我试图在接到任何电话时显示 Act
我是一名优秀的程序员,十分优秀!