On 3.0.1, trying to pass in the monitor configuration doesn't seem to work for the sentinel: redis-sentinel /usr/local/etc/redis/sentinel.conf --sentinel monitor mymaster $MASTER_HOST $MASTER_PORT $QUORUM

*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 181
>>> 'sentinel "monitor" "mymaster" "127.0.0.1" "6379" "1"'
Duplicated master name.

In sentinel.conf

...
sentinel monitor mymaster 127.0.0.1 6379 1
...

In my use case I'm running sentinels along redis instances in docker containers. Sometimes I need a different quorum or master namespace. I would need different images for different sentinel settings if this setting can't be supported via the command line.

Somewhat related to #1599

Comment From: badboy

You're using the same name as is already configured. Use a new name for a new instance.

Comment From: mikob

Then I would end up with 2 master groups. I want to change the quorum from the command line and just have 1 master group, "mymaster" in this case.

Comment From: badboy

Passing it in via the command line is the same as having that line twice in the config file, which is (currently) not allowed. You would have to get rid of one of the statements or dynamically reconfigure the monitored masters when Sentinel is running.

Comment From: mikob

Removing the line from the config file breaks it, the line is a required one in a minimal config file. Dynamically reconfiguring is obviously a possibility, but not what I was looking for. Perhaps a note should be added to the config for the lines that can't be configured via the command line?

Comment From: mikob

I suppose ideally whatever ingests the config file and complains about the missing line would parse command line arguments after the file, and only after that complain if a setting is still missing.

Comment From: therealbill

@mikob Especially when using docker I would forgo anything but the bare bones sentinel config file (port and bind are what i recommend as a minimum), then configure it all via the API. That way your Docker image is entirely agnostic and generic.

However, the way you are using it here you can slightly modify by again using the barest config file (technically just the port statement is all that is necessary for sentinel) placing the entire pod config on the command line.

However, I'd recommend against that as well. If there is a failover and you restart that container with the same command line it will be incorrect. You'd have to know the current master to start sentinel correctly. Avoid using pod information at the command line argument level entirely and you'll be much safer.