1.先确保linux有gcc编译环境等
2.下载redis包redis-5.0.4.tar.gz,官网:Download | Redis
3.解压redis包,tar -zxvf redis-5.0.4.tar.gz
![]()
4.进入解压后的文件夹里编译,cd redis-5.0.4/ && make
5.安装,make install PREFIX=/home/centos/Documents/redis(PREFIX指定安装目录)

6.修改配置文件

将redis-5.0.4里的redis.conf复制一份到redis文件夹里,cp redis-5.0.4/redis.conf redis
用vi编辑redis.conf文件

修改:
bind 127.0.0.1 改为 bind 本机ip
port 6379 改为自己需要的端口
daemonize no 改为后台运行 daemonize yes
# requirepass foobared 把注释去掉,把foobared改为设定的redis密码
保存退出
7.运行redis
./bin/redis-server redis.conf

8.使用Redis Desktop Manager测试连接

注:如果连接不上,查看防火墙设置,centos7的firewalld和centos 5、centos6的iptable;
参考:
本文详细介绍在Linux环境下安装和配置Redis的步骤,包括下载、编译、安装、配置及运行Redis服务,以及如何通过Redis Desktop Manager进行连接测试。
872

被折叠的 条评论
为什么被折叠?



