Hello This is half a feature request and half a bug report:
Following your documentation, starting a new cluster seems only possible via the cli command. This is not a very good way if configuration management like e.g. Ansible is involved.
Configuration Management Systems rely on idempotency in the way that users define a state the system is meant to be and then are run to put the system in this state. If a command has to be issued to initialize a cluster then this breaks idempotency. This is not an argument against the cli at all. It definitely has got its use cases and this does not challenge this fact. It is more an argument for the addition of the possibility to make it configurable via file as well.
Additionally, the cluster creation command is interactive by default, following your documentation and redis-cli --cluster help It is not clear that redis-cli --cluster create can also be issued with --cluster-yes:
create host1:port1 ... hostN:portN
--cluster-replicas <arg>
check host:port
--cluster-search-multiple-owners
info host:port
fix host:port
--cluster-search-multiple-owners
reshard host:port
--cluster-from <arg>
--cluster-to <arg>
--cluster-slots <arg>
--cluster-yes
[...]
Here it seems that only reshard can be issued with --cluster-yes. But I checked in the code, tried afterwards and succeeded in running redis-cli --cluster --cluster-yes create, which was necessary to be automatable.
Here it would be nice to be able to configure leader-nodes, follower-nodes and replicas by configuration. I saw the cluster.conf is already there. But I was not able to simply configure the cluster only by config file; but I do not claim I did everything right. Maybe this only has to be clearified in the documentation.
The same goes for the sentinel:
On Ubuntu there is a separate package, systemd unit and config file with the name redis-sentinel Which only starts redis in sentinel mode and with the different config file. On FreeBSD there is only the Redis Port, which already makes it possible to start multiple instances, but not in sentinel mode. While this is the fault of the FreeBSD Ports maintainer, it could be prevented, if it were configurable via config file to start redis in sentinel mode, the necessity for asking the Ports maintainer to either add an extra start command or a second port, would become obsolete.
With those additions it would become way easier to set up Redis via configuration management and thus in an automated way that does not break idempotency. Cheers Lars
Comment From: Corvan
See also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248381