下載與安裝說明
安裝
https://www.runoob.com/redis/redis-install...
$ wget http://download.redis.io/releases/redis-5.0.5.tar.gz
$ tar xzf redis-5.0.5.tar.gz
$ cd redis-5.0.5
$ make
執行完畢後,src裡邊的就是編譯後的檔案,可執行的命令都在這裡
修改配置檔案
參考:
https://www.cnblogs.com/zuidongfeng/p/8032...
vim /usr/local/redis/redis.conf
bind 0.0.0.0
protected-mode no
daemonize yes
logfile "/logs/redis/redis.log"
dir "/data/redis"
requirepass 密碼
啟動
/usr/local/redis/src/redis-server /usr/local/redis/redis.conf
redis客戶端
[root@iZbp12ft4a1zgzzaoq9xgrZ src]# /usr/local/redis/src/redis-cli
127.0.0.1:6379> CONFIG get requirepass
(error) NOAUTH Authentication required.
127.0.0.1:6379> AUTH '密碼'
OK
127.0.0.1:6379> CONFIG get requirepass
1) "requirepass"
2) "密碼"
127.0.0.1:6379>