1.獲取redis資源
- wget http://download.redis.io/releases/redis-4.0.8.tar.gz
2.解壓
- tar xzvf redis-4.0.8.tar.gz
3.安裝
- cd redis-4.0.8
- make
- cd src
- make install PREFIX=/usr/local/redis
4.移動配置文件到安裝目錄下
- cd ../
- mkdir /usr/local/redis/etc
- mv redis.conf /usr/local/redis/etc
5.配置redis為后臺啟動
- vi /usr/local/redis/etc/redis.conf //將daemonize no 改成daemonize yes
6.將redis加入到開機啟動
- vi /etc/rc.local //在里面添加內(nèi)容:/usr/local/redis/bin/redis-server
- /usr/local/redis/etc/redis.conf (意思就是開機調(diào)用這段開啟redis的命令)
7.開啟redis
- /usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf
常用命令
- redis-server /usr/local/redis/etc/redis.conf //啟動redis
- pkill redis //停止redis
- 卸載redis:
- rm -rf /usr/local/redis //刪除安裝目錄
- rm -rf /usr/bin/redis-* //刪除所有redis相關(guān)命令腳本
- rm -rf /root/download/redis-4.0.4 //刪除redis解壓文件夾
版權(quán)聲明:文章圖片資源來源于網(wǎng)絡(luò),如有侵權(quán),請留言刪除!!!
評論