###########################redis.conf 7.4.2 主从 ################################ http://download.redis.io/releases/redis-7.4.2.tar.gz tar xf redis-7.4.2.tar.gz cd redis-7.4.2 make make install PREFIX=/usr/local/ccdt/redis_7.4.2/redis36379 make install PREFIX=/usr/local/ccdt/redis_7.4.2/redis36380 make install PREFIX=/usr/local/ccdt/redis_7.4.2/redis36381 cp redis.conf /usr/local/ccdt/redis_7.4.2/redis36379/conf/ cp redis.conf /usr/local/ccdt/redis_7.4.2/redis36380/conf/ cp redis.conf /usr/local/ccdt/redis_7.4.2/redis36381/conf/ cp sentinel.conf /usr/local/ccdt/redis_7.4.2/redis36379/conf/ cp sentinel.conf /usr/local/ccdt/redis_7.4.2/redis36380/conf/ cp sentinel.conf /usr/local/ccdt/redis_7.4.2/redis36381/conf/ sed -i '88c bind 172.16.135.42' /usr/local/ccdt/redis_7.4.2/redis36379/conf/redis.conf sed -i '88c bind 172.16.135.42' /usr/local/ccdt/redis_7.4.2/redis36380/conf/redis.conf sed -i '88c bind 172.16.135.42' /usr/local/ccdt/redis_7.4.2/redis36381/conf/redis.conf sed -i '139c port 36379' /usr/local/ccdt/redis_7.4.2/redis36379/conf/redis.conf sed -i '139c port 36380' /usr/local/ccdt/redis_7.4.2/redis36380/conf/redis.conf sed -i '139c port 36381' /usr/local/ccdt/redis_7.4.2/redis36381/conf/redis.conf sed -i '310c daemonize yes' /usr/local/ccdt/redis_7.4.2/redis36379/conf/redis.conf sed -i '310c daemonize yes' /usr/local/ccdt/redis_7.4.2/redis36380/conf/redis.conf sed -i '310c daemonize yes' /usr/local/ccdt/redis_7.4.2/redis36381/conf/redis.conf sed -i '356c logfile "/usr/local/ccdt/redis_7.4.2/redis36379/logs/redis_36379.log"' /usr/local/ccdt/redis_7.4.2/redis36379/conf/redis.conf sed -i '356c logfile "/usr/local/ccdt/redis_7.4.2/redis36380/logs/redis_36380.log"' /usr/local/ccdt/redis_7.4.2/redis36380/conf/redis.conf sed -i '356c logfile "/usr/local/ccdt/redis_7.4.2/redis36381/logs/redis_36381.log"' /usr/local/ccdt/redis_7.4.2/redis36381/conf/redis.conf sed -i '460c stop-writes-on-bgsave-error no' /usr/local/ccdt/redis_7.4.2/redis36379/conf/redis.conf sed -i '460c stop-writes-on-bgsave-error no' /usr/local/ccdt/redis_7.4.2/redis36380/conf/redis.conf sed -i '460c stop-writes-on-bgsave-error no' /usr/local/ccdt/redis_7.4.2/redis36381/conf/redis.conf sed -i '516c dir /usr/local/ccdt/redis_7.4.2/redis36379/data' /usr/local/ccdt/redis_7.4.2/redis36379/conf/redis.conf sed -i '516c dir /usr/local/ccdt/redis_7.4.2/redis36380/data' /usr/local/ccdt/redis_7.4.2/redis36380/conf/redis.conf sed -i '516c dir /usr/local/ccdt/redis_7.4.2/redis36381/data' /usr/local/ccdt/redis_7.4.2/redis36381/conf/redis.conf sed -i '1050a requirepass 4NTJgYwzISCkwxHk' /usr/local/ccdt/redis_7.4.2/redis36379/conf/redis.conf sed -i '1050a requirepass 4NTJgYwzISCkwxHk' /usr/local/ccdt/redis_7.4.2/redis36380/conf/redis.conf sed -i '1050a requirepass 4NTJgYwzISCkwxHk' /usr/local/ccdt/redis_7.4.2/redis36381/conf/redis.conf sed -i '539c replicaof 172.16.135.42 36379' /usr/local/ccdt/redis_7.4.2/redis36380/conf/redis.conf sed -i '539c replicaof 172.16.135.42 36379' /usr/local/ccdt/redis_7.4.2/redis36381/conf/redis.conf sed -i '546c masterauth 4NTJgYwzISCkwxHk' /usr/local/ccdt/redis_7.4.2/redis36380/conf/redis.conf sed -i '546c masterauth 4NTJgYwzISCkwxHk' /usr/local/ccdt/redis_7.4.2/redis36381/conf/redis.conf sed -i '1399c appendonly no' /usr/local/ccdt/redis_7.4.2/redis36379/conf/redis.conf sed -i '1399c appendonly no' /usr/local/ccdt/redis_7.4.2/redis36380/conf/redis.conf sed -i '1399c appendonly no' /usr/local/ccdt/redis_7.4.2/redis36381/conf/redis.conf mkdir -p /usr/local/ccdt/redis_7.4.2/redis36379/{conf,bin,data,logs,sentinel} mkdir -p /usr/local/ccdt/redis_7.4.2/redis36380/{conf,bin,data,logs,sentinel} mkdir -p /usr/local/ccdt/redis_7.4.2/redis36381/{conf,bin,data,logs,sentinel} ####################sentinel.conf配置###################### vim port xxx 26379 26380 26381 sed -i '2c bind 172.16.135.42' /usr/local/ccdt/redis_7.4.2/redis36379/conf/sentinel.conf sed -i '2c bind 172.16.135.42' /usr/local/ccdt/redis_7.4.2/redis36380/conf/sentinel.conf sed -i '2c bind 172.16.135.42' /usr/local/ccdt/redis_7.4.2/redis36381/conf/sentinel.conf sed -i '6c protected-mode yes' /usr/local/ccdt/redis_7.4.2/redis36379/conf/sentinel.conf sed -i '6c protected-mode yes' /usr/local/ccdt/redis_7.4.2/redis36380/conf/sentinel.conf sed -i '6c protected-mode yes' /usr/local/ccdt/redis_7.4.2/redis36381/conf/sentinel.conf sed -i '15c daemonize yes' /usr/local/ccdt/redis_7.4.2/redis36379/conf/sentinel.conf sed -i '15c daemonize yes' /usr/local/ccdt/redis_7.4.2/redis36380/conf/sentinel.conf sed -i '15c daemonize yes' /usr/local/ccdt/redis_7.4.2/redis36381/conf/sentinel.conf sed -i '34c logfile "/usr/local/ccdt/redis_7.4.2/redis36379/sentinel/sentinel_26379.log"' /usr/local/ccdt/redis_7.4.2/redis36379/conf/sentinel.conf sed -i '34c logfile "/usr/local/ccdt/redis_7.4.2/redis36380/sentinel/sentinel_26380.log"' /usr/local/ccdt/redis_7.4.2/redis36380/conf/sentinel.conf sed -i '34c logfile "/usr/local/ccdt/redis_7.4.2/redis36381/sentinel/sentinel_26381.log"' /usr/local/ccdt/redis_7.4.2/redis36381/conf/sentinel.conf sed -i '47c sentinel announce-ip 172.16.135.42' /usr/local/ccdt/redis_7.4.2/redis36379/conf/sentinel.conf sed -i '47c sentinel announce-ip 172.16.135.42' /usr/local/ccdt/redis_7.4.2/redis36380/conf/sentinel.conf sed -i '47c sentinel announce-ip 172.16.135.42' /usr/local/ccdt/redis_7.4.2/redis36381/conf/sentinel.conf sed -i '73c dir /usr/local/ccdt/redis_7.4.2/redis36379/sentinel/' /usr/local/ccdt/redis_7.4.2/redis36379/conf/sentinel.conf sed -i '73c dir /usr/local/ccdt/redis_7.4.2/redis36380/sentinel/' /usr/local/ccdt/redis_7.4.2/redis36380/conf/sentinel.conf sed -i '73c dir /usr/local/ccdt/redis_7.4.2/redis36381/sentinel/' /usr/local/ccdt/redis_7.4.2/redis36381/conf/sentinel.conf sed -i '92c sentinel monitor mymaster 172.16.135.42 36379 2' /usr/local/ccdt/redis_7.4.2/redis36379/conf/sentinel.conf sed -i '92c sentinel monitor mymaster 172.16.135.42 36379 2' /usr/local/ccdt/redis_7.4.2/redis36380/conf/sentinel.conf sed -i '92c sentinel monitor mymaster 172.16.135.42 36379 2' /usr/local/ccdt/redis_7.4.2/redis36381/conf/sentinel.conf sed -i '93c sentinel auth-pass mymaster 4NTJgYwzISCkwxHk' /usr/local/ccdt/redis_7.4.2/redis36379/conf/sentinel.conf sed -i '93c sentinel auth-pass mymaster 4NTJgYwzISCkwxHk' /usr/local/ccdt/redis_7.4.2/redis36380/conf/sentinel.conf sed -i '93c sentinel auth-pass mymaster 4NTJgYwzISCkwxHk' /usr/local/ccdt/redis_7.4.2/redis36381/conf/sentinel.conf sed -i '171c requirepass 5NTJgYwzISCkwxHk' /usr/local/ccdt/redis_7.4.2/redis36379/conf/sentinel.conf sed -i '171c requirepass 5NTJgYwzISCkwxHk' /usr/local/ccdt/redis_7.4.2/redis36380/conf/sentinel.conf sed -i '171c requirepass 5NTJgYwzISCkwxHk' /usr/local/ccdt/redis_7.4.2/redis36381/conf/sentinel.conf ###############################启动############### /usr/local/ccdt/redis_7.4.2/redis36379/bin/redis-server /usr/local/ccdt/redis_7.4.2/redis36379/conf/redis.conf /usr/local/ccdt/redis_7.4.2/redis36380/bin/redis-server /usr/local/ccdt/redis_7.4.2/redis36380/conf/redis.conf /usr/local/ccdt/redis_7.4.2/redis36381/bin/redis-server /usr/local/ccdt/redis_7.4.2/redis36381/conf/redis.conf /usr/local/ccdt/redis_7.4.2/redis36379/bin/redis-sentinel /usr/local/ccdt/redis_7.4.2/redis36379/conf/sentinel.conf /usr/local/ccdt/redis_7.4.2/redis36380/bin/redis-sentinel /usr/local/ccdt/redis_7.4.2/redis36380/conf/sentinel.conf /usr/local/ccdt/redis_7.4.2/redis36381/bin/redis-sentinel /usr/local/ccdt/redis_7.4.2/redis36381/conf/sentinel.conf
标签:7.4,redis,usr,conf,local,ccdt,随记 From: https://www.cnblogs.com/zhaojingyu/p/18664295