python - 远程python客户端无法访问couchbase服务器
问题描述
我有一个在 linode 上运行的 couchbase 6.0 服务器,我正在使用 python SDK 将数据插入到我的 couchbase 存储桶中。当直接在 Linode 服务器上运行时,我的数据被插入。但是,当我从远程机器运行我的代码时,出现网络错误:
CouchbaseNetworkError, CouchbaseTransientError): <RC=0x2C[The remote host refused the connection.
我在 linode 上打开了 8091、8092、8093、8094 端口。
from couchbase.cluster import Cluster
from couchbase.cluster import PasswordAuthenticator
# linode ip: 1.2.3.4
cluster = Cluster('couchbase://1.2.3.4:8094')
cluster.authenticate(PasswordAuthenticator('admin', 'password'))
bucket = cluster.open_bucket('test_bucket')
bucket.upsert('1',{"foo":"bar"})
我的代码在服务器上运行couchbase://localhost
时执行,但从远程计算机运行时失败。我缺少任何端口或配置吗?
解决方案
客户端到节点:在任何客户端/应用程序服务器/SDK 和它们需要访问的每个集群的所有节点之间。
未加密*:8091-8096、11210、11211
加密:18091-18096†††,11207
使用端口 11210 和 11211 对我有用。资源
推荐阅读
- javascript - 在 Javascript 中使用变量
- gis - 将栅格数据导入 NetLogo 会导致所有补丁变量 = 0 的列
- python - 使用模型的子类作为该模型的选择选项会引发 NameError
- bash - 在 shell 脚本中,冒号 (:) 被视为创建变量的运算符
- jquery - 如何在单击按钮时显示与 DIV id 关联的消息
- php - 如何替换包含冰岛字符的字符串?
- c++ - 如何在 C++ 中制作函数列表?
- json - 如何用 Alamofire 解析 json 数据?
- javascript - 将数据从 firebase 发送到 android 应用
- java - RxJava 2 - 如何在出错时取消无限流并处理它?