歩哨+redis(複数台slave)
1539 ワード
---- +redis( slave )
wget http://download.redis.io/releases/redis-4.0.1.tar.gz
tar -zxvf redis-4.0.1.tar.gz
useradd redis
mkdir /usr/local/redis
cd /usr/local/src/
mv redis-4.0.1/* /usr/local/redis
chown -R redis:redis /usr/local/redis
cd /usr/local/redis/
make MALLOC=libc
make && make install
vim /usr/local/redis/redis.conf
daemonize yes # no, redis
protected-mode no #
bind 10.0.0.140 # ip
logfile "/var/log/redis/redis.log" #
dir /usr/local/redis/rdb #
supervised systemd #systemd supervise , 。
mkdir /usr/local/redis/rdb
chown -R redis:redis /usr/local/redis/
mkdir /var/log/redis
chown -R redis:redis /var/log/redis
vim /usr/local/redis/redis.conf
slaveof 10.0.0.140 6379
(master slave )
vim /usr/local/redis/sentinel.conf
sentinel monitor mymaster 10.0.0.140 6379 2 # IP
protected-mode no
cd /usr/local/redis/
redis-sentinel sentinel.conf
cd /usr/local/redis/
src/redis-cli -h 10.0.0.140 -p 26379 INFO Sentinel
src/redis-sentinel sentinel.conf