The principle and configuration of the configuration and sentinel mode of the master-slave architecture of redis

Step 1: Install redis (try to install it under /usr/local/)


wget  xxxx

tar -zxvf redis-xxx.tar.gz

cd redis-xxx

make && make install (you also need to install tcl before installing tcl )


Install tcl mode

wget xxxtcl.xxx.tar.gz

tar -zxvf redis-xxx.tar.gz

cd tcl.xxx/unix

chmod 777 *(configure)

./configure 


After installing tcl, go to install redis



In this way, it can be considered that the redis installation was successful.


Find redis.conf in the installation path

Bind 192.168.1.x Configure your own IP address. If you configure 127.0.0.1, you can only access it locally

port 6379 The default port is 6379, you can change it yourself

save 900 1 All three are default configurations, the first 900/60=15min If there is a data change in 15 minutes, a snapshot will be saved

save 300 10 The first 300/60=5min If there are 10 data changes in 5 minutes, save a snapshot
save 60 10000 If there are 10,000 data changes in the first 60s 60s, save a snapshot, of course, you can change it according to your own

dir /var/redis/6379 configure an own snapshot access path dump.rdb and appendonly.aof snapshot


Copy the configuration file to /etc/redis/ and change the file name to 6379.conf 

cp /usr/local/redis-xxx /etc/redis.conf . (dot indicates current path)

cd /etc/redis/

mv redis.conf 6379.conf








Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325596207&siteId=291194637