无法将新副本添加到 SiriDB
我的设置
我在同一节点上启动了两个 SiriDB 服务器,但使用不同的端口:
第一个服务器:
- server_name: %HOSTNAME:9010
- Listen_client_port: 9000
- http_api_port: 9020
第二个服务器:
- server_name: %HOSTNAME:9011
- Listen_client_port: 9001
- http_api_port: 9021
情况
我使用以下curl 命令创建了一个新副本
curl --location --request POST 'http://localhost:9021/new-replica' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic c2E6c2lyaQ==' \
--header 'Content-Type: text/plain' \
--data-raw '{
"dbname": "dbtest",
"username": "iris",
"password": "siri",
"host": "localhost",
"port": 9000,
"pool": 0
}'
:上述命令的响应是OK
。
但在服务器日志记录中,我看到以下错误消息:
Connecting to back-end server 'my-hostname-xxx:9010' failed (error: connection refused)
当执行列表服务器
查询时,似乎服务器无法找到彼此:
curl --location --request POST 'http://localhost:9021/query/dbtest' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic aXJpczpzaXJp' \
--header 'Content-Type: text/plain' \
--data-raw '{"q": "list servers"}'
这是响应:
{"columns":["status"],"servers":[["offline"],["running | synchronizing"]]}
我找不到什么错误的,因为服务器在同一主机上运行。所以,他们应该能够找到对方吧?
My Set-up
I've started two SiriDB server on the same node, but using different ports:
First server:
- server_name: %HOSTNAME:9010
- listen_client_port: 9000
- http_api_port: 9020
Second server:
- server_name: %HOSTNAME:9011
- listen_client_port: 9001
- http_api_port: 9021
Situation
I've created a new replica using the following curl command:
curl --location --request POST 'http://localhost:9021/new-replica' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic c2E6c2lyaQ==' \
--header 'Content-Type: text/plain' \
--data-raw '{
"dbname": "dbtest",
"username": "iris",
"password": "siri",
"host": "localhost",
"port": 9000,
"pool": 0
}'
The response from the command above was OK
.
But in the server logging I see the following error message:
Connecting to back-end server 'my-hostname-xxx:9010' failed (error: connection refused)
When performing a list servers
query, it seems that the servers are not able to find each other:
curl --location --request POST 'http://localhost:9021/query/dbtest' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic aXJpczpzaXJp' \
--header 'Content-Type: text/plain' \
--data-raw '{"q": "list servers"}'
This is the response:
{"columns":["status"],"servers":[["offline"],["running | synchronizing"]]}
I can't find what's wrong, as the servers run on the same host. Therefore, they should be able to find each other right?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的绑定很可能不正确。你能检查一下是否是这种情况吗?
默认情况下,出于安全原因,SiriDB 仅绑定到
127.0.0.1
(localhost)。由于使用了
%HOSTNAME
,因此 SiriDB 可能正在另一个接口上侦听。如果您使用配置文件,则可能需要将
bind_server_address
和bind_client_address
更改为::
(任意)。注意:可以使用环境变量
SIRIDB_BIND_SERVER_ADDRESS
和SIRIDB_BIND_CLIENT_ADDRESS
完成相同的设置。Most likely your binding is incorrect. Can you check if this is the case?
By default SiriDB binds only to
127.0.0.1
(localhost) for security reasons.Since
%HOSTNAME
is used, it might be so that SiriDB is listening on another interface.If you are using a configuration file, you probably need to change both
bind_server_address
andbind_client_address
to::
(any).Note: the same setting can be done using the environment variable
SIRIDB_BIND_SERVER_ADDRESS
andSIRIDB_BIND_CLIENT_ADDRESS
.