yum install
Switch domestic mirror, configure yum source
# 备份源镜像
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
# 下载阿里云Base镜像以及EPEL镜像
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
# 清理和生成缓存
yum clean all && yum makecache
Install redis
- Install command
yum install -y redis
- Default port: 6379
- Configuration file
vi /etc/redis.conf
Set up remote access
- Scheme 1, comment bind, turn off the protection mode, this scheme is suitable for test development environment
vi /etc/redis.conf
Note bind 127.0.0.1
set protected-mode no
- Option 2. Bind the specific use of redis service IP and configure the password
- Restart the service
systemctl restart redis
Note: If requirepass is set, the remote connection must include a password, regardless of whether protected-mode is yes / no
Reference: Integration of various redis installation tutorials online