Redis Linux installation + configuration

1, into the specified directory, download resources (can also be copied to the specified directory after local download)

wget http://download.redis.io/releases/redis-5.0.5.tar.gz

 2, unzip to a specific directory  

tar zxvf redis-5.0.5.tar.gz -C /usr/local

 3, use the command to install    

Copy the code
cd /usr/local/redis-5.0.5

make

cd src

make install PREFIX=/usr/local/redis
Copy the code

 4, the configuration file to the mounted directory  

mkdir /usr/local/redis/etc

mv /usr/local/redis-5.0.5/redis.conf /usr/local/redis/etc

 5, modify the configuration file redis

we /usr/local/redis/etc/redis.conf

 5.1 makes redis resident in the background

  daemonize no -> daemonize yes 

5.2 redis modify the ip default binding, so that all machines can access, of course, you can specify ip

  bind 127.0.0.1 -> bind 0.0.0.0 

5.3 protected mode turned off

  protected-mode yes -> protected-mode no

6, redis set from the start  

we /etc/rc.local

   Add content in a casual line:

  /usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf

  This command will invoke the boot open redis

7, open port 6379 (redis default port can be modified)

  Open ports command:  

/sbin/iptables -I INPUT -p tcp --dport 6379 -j ACCEPT

   Check ports open the case:

/sbin/iptables -L -n

8, start redis (If you have already started redis, you will need to close and open)

  /usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf

9, other commands

  Close redis:

pkill redis

   Delete redis:    

rm -rf / usr / local / redis // delete the installation directory 

rm -rf / usr / bin / redis- * // delete all associated command scripts redis 

Enjoy it !   

 
Category:  Redis

1, into the specified directory, download resources (can also be copied to the specified directory after local download)

wget http://download.redis.io/releases/redis-5.0.5.tar.gz

 2, unzip to a specific directory  

tar zxvf redis-5.0.5.tar.gz -C /usr/local

 3, use the command to install    

Copy the code
cd /usr/local/redis-5.0.5

make

cd src

make install PREFIX=/usr/local/redis
Copy the code

 4, the configuration file to the mounted directory  

mkdir /usr/local/redis/etc

mv /usr/local/redis-5.0.5/redis.conf /usr/local/redis/etc

 5, modify the configuration file redis

we /usr/local/redis/etc/redis.conf

 5.1 makes redis resident in the background

  daemonize no -> daemonize yes 

5.2 redis modify the ip default binding, so that all machines can access, of course, you can specify ip

  bind 127.0.0.1 -> bind 0.0.0.0 

5.3 protected mode turned off

  protected-mode yes -> protected-mode no

6, redis set from the start  

we /etc/rc.local

   Add content in a casual line:

  /usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf

  This command will invoke the boot open redis

7, open port 6379 (redis default port can be modified)

  Open ports command:  

/sbin/iptables -I INPUT -p tcp --dport 6379 -j ACCEPT

   Check ports open the case:

/sbin/iptables -L -n

8, start redis (If you have already started redis, you will need to close and open)

  /usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf

9, other commands

  Close redis:

pkill redis

   Delete redis:    

rm -rf / usr / local / redis // delete the installation directory 

rm -rf / usr / bin / redis- * // delete all associated command scripts redis 

Enjoy it !   

Guess you like

Origin www.cnblogs.com/zhoading/p/12344922.html