#1 Primary/replica selection

This commit is contained in:
Lev Kokotov
2022-02-09 20:02:20 -08:00
parent 00f2d39446
commit 28c70d47b6
6 changed files with 114 additions and 20 deletions

View File

@@ -43,26 +43,26 @@ password = "sharding_user"
# Shard 0
[shards.0]
# [ host, port ]
# [ host, port, role ]
servers = [
[ "127.0.0.1", 5432 ],
[ "localhost", 5432 ],
[ "127.0.0.1", 5432, "primary" ],
[ "localhost", 5432, "replica" ],
]
# Database name (e.g. "postgres")
database = "shard0"
[shards.1]
# [ host, port ]
# [ host, port, role ]
servers = [
[ "127.0.0.1", 5432 ],
[ "localhost", 5432 ],
[ "127.0.0.1", 5432, "primary" ],
[ "localhost", 5432, "replica" ],
]
database = "shard1"
[shards.2]
# [ host, port ]
# [ host, port, role ]
servers = [
[ "127.0.0.1", 5432 ],
[ "localhost", 5432 ],
[ "127.0.0.1", 5432, "primary" ],
[ "localhost", 5432, "replica" ],
]
database = "shard2"
database = "shard2"