apache / kvrocks-controller

Apache Kvrocks Controller is a cluster management tool for Apache Kvrocks.
https://kvrocks.apache.org/
Apache License 2.0
78 stars 42 forks source link

create replica cluster #89

Closed rkozlo closed 1 year ago

rkozlo commented 1 year ago

Shouldn't it create cluster with replicas?

test_namespace>> create cluster test-cluster --nodes 10.32.68.251:6666,10.32.68.250:6666,10.32.68.249:6666 --replica 3
CREATED
test_namespace>> cd test-cluster
test_namespace/test-cluster>> ls
+---+-------------+-------------------+--------+--------+---------+
| # | SLOTS       | MASTER            | SLAVES | IMPORT | MIGRATE |
+---+-------------+-------------------+--------+--------+---------+
| 0 | 0-5460      | 10.32.68.251:6666 | []     |     -1 |      -1 |
| 1 | 5461-10921  | 10.32.68.250:6666 | []     |     -1 |      -1 |
| 2 | 10922-16383 | 10.32.68.249:6666 | []     |     -1 |      -1 |
+---+-------------+-------------------+--------+--------+---------+
test_namespace>> create cluster test-cluster --nodes 10.32.68.251:6666,10.32.68.250:6666,10.32.68.251:6666 --replica 1
CREATED
test_namespace>> cd test-cluster
test_namespace/test-cluster>> ls
+---+-------------+-------------------+--------+--------+---------+
| # | SLOTS       | MASTER            | SLAVES | IMPORT | MIGRATE |
+---+-------------+-------------------+--------+--------+---------+
| 0 | 0-5460      | 10.32.68.251:6666 | []     |     -1 |      -1 |
| 1 | 5461-10921  | 10.32.68.250:6666 | []     |     -1 |      -1 |
| 2 | 10922-16383 | 10.32.68.251:6666 | []     |     -1 |      -1 |
+---+-------------+-------------------+--------+--------+---------+

Seems like --replica flag does nothing

git-hulk commented 1 year ago

Hi @rkozlo

It's a bug and has fixed in https://github.com/RocksLabs/kvrocks_controller/pull/74