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