How to make Redis slave read only in Redis v2.4.6? - redis

I used slave-read-only yes in redis.conf file.
CONFIG SET "slave-read-only" "yes"
(error) ERR Unsupported CONFIG parameter: slave-read-only
How to set the same?

From Redis documentation:
Since Redis 2.6, slaves support a read-only mode that is enabled by default. This behavior is controlled by the slave-read-only option in the redis.conf file, and can be enabled and disabled at runtime using CONFIG SET.
For any Redis version earlier than 2.6, slave-read-only parameter was not available (and thus not recognized). So, in Redis v2.4.6, you will not be able to set that parameter.

Related

Sentinel auth-pass error when using redis 6.0.6

I don't want to set master redis password in the config file
So I found this command from the redis official website
sentinel auth-pass <master-group-name> <password>
but when i use the error occurs
like this
127.0.0.1:26378> sentinel auth-pass myMaster 123456
(error) ERR Unknown sentinel subcommand 'auth-user'
why!!!!
Search on Google
and
noting
Maybe I should upgrade to 6.2.0
Sentinel stated supporting auth-user from Redis version 6.2.x. So, it can not find the sub-command auth-user which is needed for the command sentinel auth-pass.
From Redis Sentinel Official Documentation :
Starting with Redis 6.2, the Access Control List (ACL) is available, whereas previous versions (starting with Redis 5.0.1) support password-only authentication.

Redis Sentinel Rename-Command Ignored

I am trying to limit the allowed privileges for external redis sentinel users by renaming critical commands as follow:
sentinel rename-command mymaster FAILOVER failover-secret
However, the configurations are being ignored, and I still can trigger the renamed command using the original name:
127.0.0.1:26379> sentinel failover mymaster
OK
Redis Version:
Redis server v=6.0.9 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=e874f7259751a389
The best option would be to put this in your Redis server's config file as opposed to setting it via CLI. It sounds like setting it this way either only applies to that connection (so other connections won't have that config change) or it only persists until the server restarts. Putting it in the config file would persist for all connections, and across restarts.
Another option if you're using Redis v6 (or can upgrade to v6) is to create separate users and specify the available commands per user. This option is discussed in this answer.

Configuration of Running Redis Instance in Swisscom CloudFoundry

I am trying to read the configuration of the running Redis instance. I want to better understand how Redis is configured, especially in regard to persistence settings.
I have successfully connected to the running Redis instance (SSH tunnel) and try to execute the following command:
CONFIG GET *
CONFIG GET appendonly
However, I get the message
ERR unknown command 'CONFIG'
If I invoke the command "CONFIG GET" without any parameters I get the message
Invalid input argument for command: 'CONFIG GET', passed 0 arguments, must be in range 1 - 1
So the command is known. Seems to be a permission issue!? Is there a way to get the configuration?
The current Redis offering (march 2019) has the following settings for persistency:
appendonly yes
appendfsync everysec
It runs with 2 replicas.
Please note that this allies to the current service offering of Swisscom and might change in the future.

Redis - Using CONFIG SET on the fly in a master slave relationship

I'm looking to change the maxmemory amount and the maxmemory-policy to allkeys-lru while the server is running based on this. I'm going to do this first via:
$ redis-cli
> SET CONFIG maxmemory xxxxxxxxx
> SET CONFIG maxmemory-policy allkeys-lru
Then after seeing that it works in an expected way, i.e. evicts keys until it's size drops to xxxxxxxxx bytes, I will change the config file. When we are running this in a master slave configuration, is there any issues that can occur based on the order I change this config in the master and the slave?
Ouch. Perhaps rdb-tools works with that version... You can identify the keys that you don't need and script a deletion. Regardless, you really need to upgrade your Redis version and do some data housekeeping.

Sentinel work fail after rename config command of redis

I've installed stablest redis(ver 3.2). Everything work fine until I renamed CONFIG command of redis, sentinel could not promote slave to be master.
Think the problem is sentinel still use CONFIG command (has been renamed) to change configuration of redis.
Is there any way to change configuration of sentinel (via redis-cli or configuration files sentinel.conf) to adapt redis configuration (renamed config command). If there isn't, how about changing source code?
Thanks
After google, I found solution for this problem.
I replace redis/src/sentinel.c via this redis github, rebuild and install redis from source.
Then I could add a directive to sentinel.conf to configure sentinel use renamed config command.
sentinel config-command mymaster <renamed-command>