Thanks again for the response Bernardo. My question was more around the connection string to each node. In my tests they are running in a single container where each node is running on a different port. if I explicitly connect each node to each peer they may initially see each other as peers but they soon forget each other
node 1:
file:litesql-test1.db?node=primary&total_primary_nodes=5&bind=tcp://0.0.0.0:9331&connect=tcp://127.0.0.1:9332,tcp://127.0.0.1:9333,tcp://127.0.0.1:9334,tcp://127.0.0.1:9335
node 2:
file:litesql-test2.db?node=primary&total_primary_nodes=5&bind=tcp://0.0.0.0:9332&connect=tcp://127.0.0.1:9331,tcp://127.0.0.1:9333,tcp://127.0.0.1:9334,tcp://127.0.0.1:9335
node 3:
file:litesql-test3.db?node=primary&total_primary_nodes=5&bind=tcp://0.0.0.0:9333&connect=tcp://127.0.0.1:9331,tcp://127.0.0.1:9332,tcp://127.0.0.1:9334,tcp://127.0.0.1:9335
node 4:
litesql-test4.db?node=primary&total_primary_nodes=5&bind=tcp://0.0.0.0:9334&connect=tcp://127.0.0.1:9331,tcp://127.0.0.1:9332,tcp://127.0.0.1:9333,tcp://127.0.0.1:9335
node 5:
file:litesql-test5.db?node=primary&total_primary_nodes=5&bind=tcp://0.0.0.0:9335&connect=tcp://127.0.0.1:9331,tcp://127.0.0.1:9332,tcp://127.0.0.1:9333,tcp://127.0.0.1:9334
From node 5's perspective sql status initially shows:
{
"use_litesync": true,
"node_type": "primary",
"node_id": 7,
"db_is_ready": true,
"sync_down_state": "in sync",
"sync_up_state": "in sync",
"last_tid": 7161970867421961677,
"log_storage": "keep",
"peers": [{
"node_type": "primary",
"node_id": 1,
"conn_type": "outgoing",
"address": "127.0.0.1:9331",
"conn_state": "connected",
"db_state": "unknown",
"log_storage": "keep"
},{
"node_type": "primary",
"node_id": 2,
"conn_type": "outgoing",
"address": "127.0.0.1:9332",
"conn_state": "connected",
"db_state": "unknown",
"log_storage": "keep"
},{
"node_type": "primary",
"node_id": 4,
"conn_type": "outgoing",
"address": "127.0.0.1:9333",
"conn_state": "connected",
"db_state": "unknown",
"log_storage": "keep"
},{
"node_type": "primary",
"node_id": 6,
"conn_type": "outgoing",
"address": "127.0.0.1:9334",
"conn_state": "connected",
"db_state": "unknown",
"log_storage": "keep"
}]
}
however, after about 15 seconds:
{
"use_litesync": true,
"node_type": "primary",
"node_id": 7,
"db_is_ready": true,
"sync_down_state": "unknown",
"sync_up_state": "with local changes",
"last_tid": 7161970867421961677,
"log_storage": "keep",
"peers": []
}
The same behavior is observed on all nodes. Things only seem to work if I connect them implicitly to other peers:
node 1:
file:litesql-test1.db?node=primary&total_primary_nodes=5&bind=tcp://0.0.0.0:9331
node 2:
ile:litesql-test2.db?node=primary&total_primary_nodes=5&bind=tcp://0.0.0.0:9332&connect=tcp://127.0.0.1:9331
node 3:
file:litesql-test3.db?node=primary&total_primary_nodes=5&bind=tcp://0.0.0.0:9333&connect=tcp://127.0.0.1:9331,tcp://127.0.0.1:9332
node 4:
file:litesql-test4.db?node=primary&total_primary_nodes=5&bind=tcp://0.0.0.0:9334&connect=tcp://127.0.0.1:9331,tcp://127.0.0.1:9332,tcp://127.0.0.1:9333
node 5:
file:litesql-test5.db?node=primary&total_primary_nodes=5&bind=tcp://0.0.0.0:9335&connect=tcp://127.0.0.1:9331,tcp://127.0.0.1:9332,tcp://127.0.0.1:9333,tcp://127.0.0.1:9334
Is there some reason why each node can't explicitly connect to all peers?