redis
redis copied to clipboard
Add ability to create clusters with specific replica groups
This allows cluster setup with explicit master->replica mappings as defined in a cluster description file.
Runnable with: redis-trib.rb create-by-file cluster.yaml
Also fixes redis-trib color console printing. Also adds color to more error/status messages. Also removes some ruby warnings. Also lets trib resolve node hostnames during creation. Also improves node printing during cluster bring-up (still prints old output, but prints new version too).
Cluster Runtime Description Before
M: eff0a5a1ab4c88ec5ac82c7ad2454f29cacc2658 127.0.0.1:7000
slots:0-2047 (2048 slots) master
3 additional replica(s)
M: 877172731246edc7f2dbe41eaf8ba20e6ea372cb 127.0.0.1:7001
slots:2048-4095 (2048 slots) master
3 additional replica(s)
M: a41fc5a04acc26cb810c8e0acfe97a45bfe4c15a 127.0.0.1:7002
slots:4096-6143 (2048 slots) master
3 additional replica(s)
M: dfca5a55f5648ae6ada1b84c8dbba03edb781676 127.0.0.1:7003
slots:6144-8191 (2048 slots) master
3 additional replica(s)
M: 47c050cfb5c1640f978ec679b4ae9efaa1523d72 127.0.0.1:7004
slots:8192-10239 (2048 slots) master
3 additional replica(s)
M: 75e45bdc38fe06d14e8cef1cf22b6fc623c5d5a8 127.0.0.1:7005
slots:10240-12287 (2048 slots) master
3 additional replica(s)
M: 33c47662dd44d1ba1f8f223d69c325abfe0e8f45 127.0.0.1:7006
slots:12288-14335 (2048 slots) master
3 additional replica(s)
M: 65a713bde85e21827c0b6650eb8f33ef96c01985 127.0.0.1:7007
slots:14336-16383 (2048 slots) master
3 additional replica(s)
S: 585c0512857e97386a65f4b9ffd0124baf0d76f4 127.0.0.1:7008
replicates eff0a5a1ab4c88ec5ac82c7ad2454f29cacc2658
S: 807319fbf8b5141252a9e689905cd0da951f953e 127.0.0.1:7009
replicates eff0a5a1ab4c88ec5ac82c7ad2454f29cacc2658
S: 4501c5f9ecb11946c188f4d78c39cf4220975889 127.0.0.1:7010
replicates eff0a5a1ab4c88ec5ac82c7ad2454f29cacc2658
S: 442f990cdc7a8d29a90b89ed837c72d2193f0ec3 127.0.0.1:7011
replicates 877172731246edc7f2dbe41eaf8ba20e6ea372cb
S: e988042cde1b06b96a6300095a4912cbb16461e4 127.0.0.1:7012
replicates 877172731246edc7f2dbe41eaf8ba20e6ea372cb
S: 2bd0c954448b536cd33f9c85b3e1f4e2357ca29d 127.0.0.1:7013
replicates 877172731246edc7f2dbe41eaf8ba20e6ea372cb
S: 69c7a059db580d945c2dd55a4a93490785d39679 127.0.0.1:7014
replicates a41fc5a04acc26cb810c8e0acfe97a45bfe4c15a
S: 54f92d1f7c832c5dc160028a8a3c8317b3dd2f75 127.0.0.1:7015
replicates a41fc5a04acc26cb810c8e0acfe97a45bfe4c15a
S: 85b2f191b79338c59c17337c5f37580680f2efca 127.0.0.1:7016
replicates a41fc5a04acc26cb810c8e0acfe97a45bfe4c15a
S: 847b61222c3c7934b0c10015968a54d9c2a62938 127.0.0.1:7017
replicates dfca5a55f5648ae6ada1b84c8dbba03edb781676
S: 145f793e5c666e27172f96aa35a9624575b408b3 127.0.0.1:7018
replicates dfca5a55f5648ae6ada1b84c8dbba03edb781676
S: ba8c4144d3b18dc608f680a52092ad208dfa1911 127.0.0.1:7019
replicates dfca5a55f5648ae6ada1b84c8dbba03edb781676
S: f5973d4895bf62c8911fca2b72431da460d19247 127.0.0.1:7020
replicates 47c050cfb5c1640f978ec679b4ae9efaa1523d72
S: b912afc49eaee3428d67e75ff043a0f83c35cb96 127.0.0.1:7021
replicates 47c050cfb5c1640f978ec679b4ae9efaa1523d72
S: 3d52805418349fd9515483f7de35fa21f4ea9be1 127.0.0.1:7022
replicates 47c050cfb5c1640f978ec679b4ae9efaa1523d72
S: 19306285b525dc70433be07845b5c33f94ff29d2 127.0.0.1:7023
replicates 75e45bdc38fe06d14e8cef1cf22b6fc623c5d5a8
S: 216cd1d90a6e302ef61c4f46b6580380da1a876d 127.0.0.1:7024
replicates 75e45bdc38fe06d14e8cef1cf22b6fc623c5d5a8
S: e693dd85787cebdb7f2732f170795e59c746c770 127.0.0.1:7025
replicates 75e45bdc38fe06d14e8cef1cf22b6fc623c5d5a8
S: 674f92b784dc62fee42821dbe32bf21189385664 127.0.0.1:7026
replicates 33c47662dd44d1ba1f8f223d69c325abfe0e8f45
S: b27657df429698960960062d6e7a080cf88de173 127.0.0.1:7027
replicates 33c47662dd44d1ba1f8f223d69c325abfe0e8f45
S: f056df2e2c225ab8463d98ceb36b5a194937135f 127.0.0.1:7028
replicates 33c47662dd44d1ba1f8f223d69c325abfe0e8f45
S: 8dd0a934accec4beb1e2870ac3b93eaf6b576bee 127.0.0.1:7029
replicates 65a713bde85e21827c0b6650eb8f33ef96c01985
S: 4466a813653100eaa2503b91a3411db9a7deafa8 127.0.0.1:7030
replicates 65a713bde85e21827c0b6650eb8f33ef96c01985
S: 1e42d346e29ce010b26b4b9a53acb38ae9264d7c 127.0.0.1:7031
replicates 65a713bde85e21827c0b6650eb8f33ef96c01985
Cluster Runtime Description After
Printing human readable map of cluster topology...
Group for hash slots 0-2047 (4 nodes):
127.0.0.1:7000 (master)
127.0.0.1:7008 (replica)
127.0.0.1:7009 (replica)
127.0.0.1:7010 (replica)
Group for hash slots 2048-4095 (4 nodes):
127.0.0.1:7001 (master)
127.0.0.1:7011 (replica)
127.0.0.1:7012 (replica)
127.0.0.1:7013 (replica)
Group for hash slots 4096-6143 (4 nodes):
127.0.0.1:7002 (master)
127.0.0.1:7014 (replica)
127.0.0.1:7015 (replica)
127.0.0.1:7016 (replica)
Group for hash slots 6144-8191 (4 nodes):
127.0.0.1:7003 (master)
127.0.0.1:7017 (replica)
127.0.0.1:7018 (replica)
127.0.0.1:7019 (replica)
Group for hash slots 8192-10239 (4 nodes):
127.0.0.1:7004 (master)
127.0.0.1:7020 (replica)
127.0.0.1:7021 (replica)
127.0.0.1:7022 (replica)
Group for hash slots 10240-12287 (4 nodes):
127.0.0.1:7005 (master)
127.0.0.1:7023 (replica)
127.0.0.1:7024 (replica)
127.0.0.1:7025 (replica)
Group for hash slots 12288-14335 (4 nodes):
127.0.0.1:7006 (master)
127.0.0.1:7026 (replica)
127.0.0.1:7027 (replica)
127.0.0.1:7028 (replica)
Group for hash slots 14336-16383 (4 nodes):
127.0.0.1:7007 (master)
127.0.0.1:7029 (replica)
127.0.0.1:7030 (replica)
127.0.0.1:7031 (replica)
This includes some good changes, that should be included nonetheless.
But we should also rethink the "cluster description file" approach (whether we end up with yaml, json, an ini-like format or a custom format after all). I think it's worthwhile to have this
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.
:x: mattsta
:x: MasahikoSawada
You have signed the CLA already but the status is still pending? Let us recheck it.