Linux 安装 Redis 6.0.6
1.获取资源路径
redis官网:https://redis.io/download
获得资源路径:http://download.redis.io/releases/redis-6.0.6.tar.gz
2.服务器安装wget
yum install wget
3.解压
#我选择下载到/opt目录下
cd /opt
#下载
wget http://download.redis.io/releases/redis-6.0.6.tar.gz
#解压
tar -xvf redis-6.0.6.tar.gz
4.编辑redis配置文件(设置允许远程访问)
cd redis-6.0.6
vi redis.conf
①注释 127.0.0.1
②protected-mode 改为no
③设置密码 requirepass xxxx
5.编译
cd redis-6.0.6
make
make这步大概率会报错
1)如果报错 cc:command not found,是因为缺少gcc
请执行以下操作:
安装gcc
yum install gcc
清理一下
make distclean
再次编译
make
2)如果报错:make[1]: *** [server.o] Error 1 …,是因为gcc默认安装的gcc是4.8.5,版本过低,需要升级
请执行以下操作:
yum -y <