Hi
I've trying to install and configure redis with sentinel. Setup as follows:
- Installed redis using brew:
brew install redis - Started redis service using: brew services start redis
- Spawned redis-server /usr/local/etc/redis-sentinel.conf --sentinel
Connected to sentinel using redis-cli -p 26379
tried command SET name sam
Got and error: ERR unknown commandset, with args beginning with 'name', 'sam'
System config:
Redis version 5.0.8 MacOS: Mojave SSD: 250GB default terminal
redis-cli > INFO
# Server
redis_version:5.0.8
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:5d3b7148a84d4367
redis_mode:sentinel
os:Darwin 18.7.0 x86_64
arch_bits:64
multiplexing_api:kqueue
atomicvar_api:atomic-builtin
gcc_version:4.2.1
process_id:4232
run_id:ef92f7839a5721c4484d8c793fcd6a74f2e4acd2
tcp_port:26379
uptime_in_seconds:80
uptime_in_days:0
hz:13
configured_hz:10
lru_clock:9647444
executable:/Users/sanyamsingh/redis-server
config_file:/usr/local/etc/redis-sentinel.conf
# Clients
connected_clients:1
client_recent_max_input_buffer:2
client_recent_max_output_buffer:0
blocked_clients:0
# CPU
used_cpu_sys:0.077383
used_cpu_user:0.063960
used_cpu_sys_children:0.000000
used_cpu_user_children:0.000000
# Stats
total_connections_received:1
total_commands_processed:1
instantaneous_ops_per_sec:0
total_net_input_bytes:76
total_net_output_bytes:685
instantaneous_input_kbps:0.00
instantaneous_output_kbps:0.00
rejected_connections:0
sync_full:0
sync_partial_ok:0
sync_partial_err:0
expired_keys:0
expired_stale_perc:0.00
expired_time_cap_reached_count:0
evicted_keys:0
keyspace_hits:0
keyspace_misses:0
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:0
migrate_cached_sockets:0
slave_expires_tracked_keys:0
active_defrag_hits:0
active_defrag_misses:0
active_defrag_key_hits:0
active_defrag_key_misses:0
# Sentinel
sentinel_masters:1
sentinel_tilt:0
sentinel_running_scripts:0
sentinel_scripts_queue_length:0
sentinel_simulate_failure_flags:0
master0:name=mymaster,status=ok,address=127.0.0.1:6379,slaves=0,sentinels=1
Comment From: allanassis
Hi @SamVsCode, if i am not wrong the redis-sentinel is read-only by default, after Redis 2.6.
There is a configuration in redis.conf file called replica-read-only.
Can be enabled and disabled at runtime using CONFIG SET
In Redis documentation there is a section called Read-only replica, if you want to read more about. https://redis.io/topics/replication