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?
CodePudding user response:
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
.