1.cd command to your download folder
2. Enter the command to download redis
wget http://download.redis.io/releases/redis-4.0.8.tar.gz
3. Extract the downloaded installation package
tar xzvf redis-4.0.8.tar.gz
4. Go to the unpack folder good
cd redis-4.0.8
5. Compile
make
6. Go to the src folder
cd src
7. Specify the installation directory, use this address is on the line, easy to forget the chaos set
make install PREFIX=/usr/local/redis
8.cd to the installation directory
cd ../
9. Create a directory to store configuration files in the installation position of redis
mkdir /usr/local/redis/etc
10. put the configuration file you just created directory
mv redis.conf /usr/local/redis/etc
11. Configure redis start for the background (vi command will not be Baidu, the basic is how to search, how to modify and how to save)
vi /usr/local/redis/etc/redis.conf
Search daemonize no change daemonize yes under 12.vi interface
-
-
-
-
-
grep -n daemonize /usr/local/redis/etc/redis.conf find out where the line
136:daemonize no
152:# When the server runs non daemonized, no pid file is created if none is
153:# specified in the configuration. When the server is daemonized, the pid file
170:# output for logging but daemonize, logs will be sent to /dev/nullvim +136 /usr/local/redis/etc/redis.conf jump to that line editing
-
-
-
-
-
Cursor movement corresponding to position i by
-
Delete no
-
Enter yes
- Add a password field, the purpose is to link to python
requirepass weiwei1234..
-
esc
-
:wq
-
enter
13. redis added to the boot
-
we /etc/rc.local
-
/ / Add content in it: / usr / local / Redis / bin / Redis -server /usr/local/redis/etc/redis.conf
14. Start redis
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf
15. Start redis client
/usr/local/redis/bin/redis-cli
16. Enter ping pong receive the connection is successful
Other commonly used commands
-
redis pkill // stop redis
-
-
Uninstall redis:
-
-rf RM / usr / local / Redis // delete the installation directory
-
-
-rf RM / usr / bin / redis- * // delete all associated command scripts redis