centos7 yum install redis

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

bind settings
Note bind 127.0.0.1
Set peotected-mode
set protected-mode no

  • Option 2. Bind the specific use of redis service IP and configure the password
    bind settings
    set 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

Published 2 original articles · praised 0 · visits 9

Guess you like

Origin blog.csdn.net/qq_33489819/article/details/105550072