The cloud server to build a main deployment Redis5.0.5 two guards from three sentinel

Three servers ip01, ip02, ip03
official website to download redis5.0.5 packages can also be downloaded using wget, c language so the first yum install -y gcc gcc-c ++
extracting file
tar -zxvf
modify folder name
Here Insert Picture Description
to enter the directory redis execution make, after completion of entering the src directory run make install
suggest finding redis.conf When finished, modify, vi unfamiliar online editing using filezilla Here Insert Picture Description
major modification
bind 120.0.0.1 commented external else can not connect
protected-mode no // turn off protected mode
daemonize yes daemon
dir can be specified data storage directory
logfile can specify the log directory
specified directory must exist
open aof appendonly yes (aof log every operation recording mode)
requirepass Redis password (if required)
masterauth also set a password (requirepass set )
three turn starts redis-server redis.conf start command

Master-Slave settings
in (the redis port) from the library directory redis redis-cli -p port you want to set soon
Here Insert Picture Description

redis set a password
Here Insert Picture Description
SLAVEOF 01 port (02 is expressed from a library of 01)
login 03 services redis repeat operation
when there appears ok, you can view the current execution info replication redis information

Here Insert Picture Description
Next is Sentinel
editor sentinel.conf file
dir specifies the data file storage directory
logfile log storage directory specified
port sentry port modification
sentinel monitor (you can easily play) (monitoring masterip) (monitoring master port) (specify when the number of sentinel think when a master fails)
when the cloud server using sentinel sentinel-announce-ip public ip (outside the network can access)
must not forget to fill in, otherwise can not communicate between the sentry, use the network ip default (at that time to find a day's problems the last one a translator for a moment)
the other can be used without modification

redis-sentinel sentinel.conf 启动哨兵 三台依次启动

启动完成之后可以看日志 slave+ sentinel+ 基本算是成功
杀掉主库,在使用info-replication 查看一下 主从库信息,如果主库更换就表示成功了
有问题欢迎留言哦
Published an original article · won praise 0 · Views 15

Guess you like

Origin blog.csdn.net/weixin_39439062/article/details/104575156