Redis源码安装
注:
本实验基于RHEL7.2
下载源码包:
[root@rhel7 ~]# wget http://download.redis.io/releases/redis-4.0.1.tar.gz
-rw-r--r--. 1 root root 1711660 Jun 27 2020 redis-4.0.1.tar.gz
解压:
[root@rhel7 ~]# tar -xvf redis-4.0.1.tar.gz -C /usr/local/
下载源码安装编译器:
yum install gcc gcc-c++ make
make :
[root@rhel7 redis-4.0.1]# pwd
/usr/local/redis-4.0.1
[root@rhel7 redis-4.0.1]# make
[root@rhel7 redis-4.0.1]# make install
创建配置文件目录:
[root@rhel7 redis-4.0.1]# mkdir /etc/redis
复制配置文件:
[root@rhel7 redis-4.0.1]# cp redis.conf /etc/redis/
修改配置文件:
[root@rhel7 redis-4.0.1]# vim /etc/redis/redis.conf
将yes 改为no
将no改为yes
指定redis-server的配置文件
[root@rhel7 redis-4.0.1]# redis-server /etc/redis/redis.conf
进入redis:
[root@rhel7 redis-4.0.1]# redis-cli
127.0.0.1:6379>