Linux Redis 使用安裝
一,安裝
redis官網鏈接
http://download.redis.io/releases/redis-5.0.5.tar.gz
1.選擇最新穩定版本stable或最新版redis,複製官網鏈接 通過 wget 指令安裝
[root@VM_0_10_centos bin]# cd /usr/local/src
[root@VM_0_10_centos src]# wget http://download.redis.io/releases/redis-5.0.5.tar.gz
[root@VM_0_10_centos src]# cd redis-5.0.5/
[root@VM_0_10_centos redis-5.0.5]# make
[root@VM_0_10_centos redis-5.0.5]# make test #檢查環境是否有問題
[root@VM_0_10_centos redis-5.0.5]# make PREFIX=/usr/local/redis install #安裝到指定路徑
2.install安裝成功後得到如下文件
[root@VM_0_10_centos redis]# cd bin
[root@VM_0_10_centos bin]# ll
total 32736
-rwxr-xr-x 1 root root 4366608 Oct 15 15:31 redis-benchmark # redis性能測試工具
-rwxr-xr-x 1 root root 8111816 Oct 15 15:31 redis-check-aof # 檢查aof日誌工具
-rwxr-xr-x 1 root root 8111816 Oct 15 15:31 redis-check-rdb # 檢查rdb日誌工具
-rwxr-xr-x 1 root root 4806840 Oct 15 15:31 redis-cli # 連接用的客戶端
lrwxrwxrwx 1 root root 12 Oct 15 15:31 redis-sentinel -> redis-server
-rwxr-xr-x 1 root root 8111816 Oct 15 15:31 redis-server # redis服務進程
3.複製 redis.conf 到 redis 目錄
[root@VM_0_10_centos redis-5.0.5]# cd /usr/local/redis/
[root@VM_0_10_centos redis]# cp /usr/local/src/redis-5.0.5/redis.conf ./
[root@VM_0_10_centos redis]# ls
bin redis.conf
4.通過指令啓動redis
[root@VM_0_10_centos redis]# ./bin/redis-server ./redis.conf
5.redis 以後臺進程的形式運行
[root@VM_0_10_centos redis]# vim redis.conf
daemonize yes # 修改配置文件 daemonize 爲 yes
6.啓動redis,使用指令
[root@VM_0_10_centos redis]# ./bin/redis-cli