更改yum源

 

由于CentOS官方yum源里面没有Redis,这里我们需要安装一个第三方的yum源,这里用了Fedora的epel仓库:

yum install epel-release

安装redis

yum install redis

启动redis

systemctl start redis.service

设置redis开机启动

systemctl enable redis.service

高级设置

配置文件地址

/etc/redis.conf

设置redis密码 打开配置文件,找到其中的# requirepass foobared,去掉前面的#,并把foobared改成你的密码。 redis.conf文件默认在/etc目录下,你可以更改它的位置和名字,更改后,注意在文件/usr/lib/systemd/system/redis.service中,把ExecStart=/usr/bin/redis-server /etc/redis/6379.conf --daemonize no中的redis.conf的路径改成的新的路径。

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。