一、安装包下载(地址已失效)
redis安装包
http://cocobabi.vip/app/redis-3.2.12-2.el7.x86_64.rpm
二、安装
1、将文件放到/opt目录下
2、进入/opt目录# cd /opt
3、先执行依赖安装命令,再执行redis安装命令
[root@iZuf61gy3n1d12woog919aZ app]# rpm -ivh jemalloc-3.6.0-1.el7.x86_64.rpm
warning: jemalloc-3.6.0-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:jemalloc-3.6.0-1.el7 ################################# [100%]
[root@iZuf61gy3n1d12woog919aZ app]# rpm -ivh redis-3.2.12-2.el7.x86_64.rpm
warning: redis-3.2.12-2.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:redis-3.2.12-2.el7 ################################# [100%]
三、配置
1、redis配置文件默认路径
/etc/redis.conf
2、修改配置文件
[root@iZuf61gy3n1d12woog919aZ html]# vim /etc/redis.conf
################################# GENERAL #####################################
# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
# JUST COMMENT THE FOLLOWING LINE.
# 如果需要在其它地方远程redis,需要注释下面的一行
bind 127.0.0.1
# By default Redis does not run as a daemon. Use 'yes' if you need it.
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
# 启动守护进程
daemonize yes
...
# 设置密码
requirepass 123456
四、启动
[root@iZuf61gy3n1d12woog919aZ app]# service redis start
Redirecting to /bin/systemctl start redis.service