Redis Cluster - не удается установить соединение Redis master-slave - PullRequest
0 голосов
/ 04 октября 2019

Здравствуйте. Я пытаюсь создать кластер Redis с 6 узлами, с 3 основными и 3 подчиненными узлами. Я использую Redis-сервер 5.0.5 версии . - В главных узлах у меня есть эта конфигурация

# Redis configuration file example.
bind 192.168.77.21
protected-mode no
port 6379
tcp-backlog 511
timeout 0
tcp-keepalive 60
################################# GENERAL #####################################
daemonize no
supervised no
pidfile /var/run/redis_6379.pid
loglevel notice
logfile /var/log/redis/redis.log
databases 16
always-show-logo yes
################################ SNAPSHOTTING  ################################
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir /var/lib/redis
################################# REPLICATION #################################
replica-serve-stale-data yes
replica-read-only yes
repl-disable-tcp-nodelay no
################################## SECURITY ###################################
requirepass somepassword
maxmemory 512mb
maxmemory-policy noeviction
ffect of a command that stores data on a key that may
lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
replica-lazy-flush no
############################## APPEND ONLY MODE ###############################
appendonly no
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
aof-use-rdb-preamble yes
################################ LUA SCRIPTING  ###############################
lua-time-limit 5000
################################ REDIS CLUSTER  ###############################
cluster-enabled yes
cluster-config-file nodes-6379.conf
cluster-node-timeout 5000
################################## SLOW LOG ###################################
slowlog-log-slower-than 10000
slowlog-max-len 128
################################ LATENCY MONITOR ##############################
latency-monitor-threshold 0
############################# EVENT NOTIFICATION ##############################
notify-keyspace-events ""
############################### ADVANCED CONFIG ###############################
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-size -2
list-compress-depth 0
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
stream-node-max-bytes 4096
stream-node-max-entries 100
activerehashing yes
hz 10
dynamic-hz yes
aof-rewrite-incremental-fsync yes
rdb-save-incremental-fsync yes
  • В подчиненных узлах у меня есть эта конфигурация
# Redis configuration file example.
bind 192.168.77.22
protected-mode no
port 6379
tcp-backlog 511
timeout 0
tcp-keepalive 60
################################# GENERAL #####################################
daemonize no
supervised no
pidfile /var/run/redis_6379.pid
loglevel notice
logfile /var/log/redis/redis.log
databases 16
always-show-logo yes
################################ SNAPSHOTTING  ################################
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir /var/lib/redis
################################# REPLICATION #################################
replicaof 192.168.77.21 6379
masterauth somepassword
replica-serve-stale-data yes
replica-read-only yes
# WARNING: DISKLESS REPLICATION IS EXPERIMENTAL CURRENTLY
repl-diskless-sync no
repl-diskless-sync-delay 5
repl-disable-tcp-nodelay no
replica-priority 100
################################## SECURITY ###################################
requirepass somepassword
############################## MEMORY MANAGEMENT ################################
maxmemory 512mb
############################# LAZY FREEING ####################################
lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
replica-lazy-flush no
############################## APPEND ONLY MODE ###############################
appendonly no
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
aof-use-rdb-preamble yes
################################ LUA SCRIPTING  ###############################
lua-time-limit 5000
################################ REDIS CLUSTER  ###############################
cluster-enabled yes
cluster-config-file nodes-6379.conf
cluster-node-timeout 5000
################################## SLOW LOG ###################################
slowlog-log-slower-than 10000
slowlog-max-len 128
################################ LATENCY MONITOR ##############################
latency-monitor-threshold 0
############################# EVENT NOTIFICATION ##############################
notify-keyspace-events ""
############################### ADVANCED CONFIG ###############################
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-size -2
list-compress-depth 0
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
stream-node-max-bytes 4096
stream-node-max-entries 100
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit replica 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
dynamic-hz yes
aof-rewrite-incremental-fsync yes
rdb-save-incremental-fsync yes

в конце концов, когда я пытаюсь запустить службу redis с помощью systemctl start redis, она не работает и выдает следующее исключение:

Oct 04 14:17:57 node2 systemd[1]: Starting Redis persistent key-value database...
Oct 04 14:17:57 node2 systemd[1]: redis.service: main process exited, code=exited, status=1/FAILURE
Oct 04 14:17:57 node2 redis-shutdown[30834]: Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
Oct 04 14:17:57 node2 redis-shutdown[30834]: Could not connect to Redis at 192.168.77.22:6379: Connection refused
Oct 04 14:17:57 node2 systemd[1]: redis.service: control process exited, code=exited status=1
Oct 04 14:17:57 node2 systemd[1]: Failed to start Redis persistent key-value database.
Oct 04 14:17:57 node2 systemd[1]: Unit redis.service entered failed state.
Oct 04 14:17:57 node2 systemd[1]: redis.service failed.

какие-либо предложения или решения?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...