CentOS8安装redis5

CentOS8安装redis5

CentOS8的安装镜像已经包含redis5的软件包,可以直接通过yum安装

安装并启动redis5

yum install -y redis
systemctl start redis.service
systemctl enable redis.service
firewall-cmd --add-port=6379/tcp --permanent
firewall-cmd --reload

打开远程配置

sed -i 's/bind 127.0.0.1/#bind 127.0.0.1/g' /etc/redis.conf
sed -i 's/protected-mode yes/protected-mode no/' /etc/redis.conf
sed -i 's/daemonize no/daemonize yes/g' /etc/redis.conf
systemctl restart redis.service
  • 如果要是用默认配置/etc/redis.conf,必须要通过systemctl启动
  • 如果使用redis-server启动程序,需要手动指定配置文件,否则全是默认(不符合实际)
  • sed -i 是替换命令 ,将redis.conf的相关配置替换掉
发布了13 篇原创文章 · 获赞 1 · 访问量 3309

猜你喜欢

转载自blog.csdn.net/q351094752/article/details/103467975