Redis 6.2.4 기준이다. 최신 계열은 Redis 를, 포크는 Valkey v8.1.10 sentinel 설치 가이드 를 볼 것.
위 버전과 저장소는 오래된 것이라 저장소가 존재하지 않을 수 있다.
wget https://download.redis.io/releases/redis-6.2.4.tar.gz
tar xvfz redis-6.2.4.tar.gz
cd redis-6.2.4
make
....
mkdir -p redis-bin/conf
cp redis-6.2.4/src/redis-benchmark redis-bin/
cp redis-6.2.4/src/redis-check-aof redis-bin/
cp redis-6.2.4/src/redis-cli redis-bin/
cp redis-6.2.4/src/redis-sentinel redis-bin/
cp redis-6.2.4/src/redis-server redis-bin/
cp redis-6.2.4/redis.conf redis-bin/conf/
cp redis-6.2.4/redis.conf redis-bin/conf/master.conf (Master server)
cp redis-6.2.4/redis.conf redis-bin/conf/slave.conf (Slave server)
cp redis-6.2.4/sentinel.conf redis-bin/conf/
75 #bind 127.0.0.1 -::1
76 bind 0.0.0.0
98 # If port 0 is specified Redis will not listen on a TCP socket.
99 port 16379
75 #bind 127.0.0.1 -::1
76 bind 0.0.0.0
98 # If port 0 is specified Redis will not listen on a TCP socket.
99 port 16379
17 # protected-mode no
18 bind 0.0.0.0
21 # The port that this sentinel instance will run on
22 port 26379
24 # By default Redis Sentinel does not run as a daemon. Use 'yes' if you need it.
25 # Note that Redis will write a pid file in /var/run/redis-sentinel.pid when
26 # daemonized.
27 daemonize yes
29 # When running daemonized, Redis Sentinel writes a pid file in
30 # /var/run/redis-sentinel.pid by default. You can specify a custom pid file
31 # location here.
32 pidfile "/home/manager/apache/redis/redis-sentinel.pid"
33
34 # Specify the log file name. Also the empty string can be used to force
35 # Sentinel to log on the standard output. Note that if you use standard
36 # output for logging but daemonize, logs will be sent to /dev/null
37 logfile "/home/manager/apache/redis/logs/redis-sentinel.log"
83 # Note: master name should not include special characters or spaces.
84 # The valid charset is A-z 0-9 and the three characters ".-_".
85 sentinel monitor mymaster 107.107.163.214 16379 2
nohup /home/manager/apache/redis/bin/redis-server /home/manager/apache/redis/conf/master.conf 1>>/home/manager/apache/redis/logs/redis.log 2>>/home/manager/apache/redis/logs/redis.log &
nohup /home/manager/apache/redis/bin/redis-server /home/manager/apache/redis/conf/slave.conf 1>>/home/manager/apache/redis/logs/redis.log 2>>/home/manager/apache/redis/logs/redis.log &
/home/manager/apache/redis/bin/redis-sentinel /home/manager/apache/redis/conf/sentinel.conf