无法将新副本添加到 SiriDB

发布于 2025-01-13 13:36:12 字数 1514 浏览 4 评论 0原文

我的设置

我在同一节点上启动了两个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

山川志 2025-01-20 13:36:12

您的绑定很可能不正确。你能检查一下是否是这种情况吗?

默认情况下,出于安全原因,SiriDB 仅绑定到 127.0.0.1 (localhost)。

由于使用了 %HOSTNAME,因此 SiriDB 可能正在另一个接口上侦听。

如果您使用配置文件,则可能需要将 bind_server_addressbind_client_address 更改为 ::(任意)。

注意:可以使用环境变量 SIRIDB_BIND_SERVER_ADDRESSSIRIDB_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 and bind_client_address to :: (any).

Note: the same setting can be done using the environment variable SIRIDB_BIND_SERVER_ADDRESS and SIRIDB_BIND_CLIENT_ADDRESS.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文