永远的光辉 發表於 2024-6-29 00:00:00

CentOS系统中使用yum命令安装redis的方法

<p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;"><strong>在linux CentOS系统中使用yum命令安装redis报错:</strong></p><div class="jb51code" style="margin: 0px; padding: 0px; outline: none; line-height: 25.2px; font-size: 14px; width: 660px; overflow: hidden; clear: both; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;"><pre class="brush:plain;">#&nbsp;yum&nbsp;install&nbsp;redis
Loaded&nbsp;plugins:&nbsp;fastestmirror
Setting&nbsp;up&nbsp;Install&nbsp;Process
Determining&nbsp;fastest&nbsp;mirrors
&nbsp;*&nbsp;base:&nbsp;mirrors.skyshe.cn
&nbsp;*&nbsp;extras:&nbsp;mirrors.163.com</pre></div><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;">
        这是因为,centos默认的安装源在官方centos.org上,而Redis在第三方的yum源里,所以无法安装,非官方的yum推荐用fedora的epel仓库</p><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;">
        使用如下命令安装第三方库:<strong>&nbsp;yum install epel-release</strong></p><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;">
        再安装redis即可:&nbsp;<strong>yum install redis</strong></p><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;">
        使用<strong>service redis start</strong>命令启动redis服务端:</p><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;">
        #&nbsp;<strong>service redis start&nbsp;</strong>Redirecting to /bin/systemctl start redis.service</p><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;">
        使用<strong>ps -ef | grep redis</strong>查看redis进程:</p><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;">
        # ps -ef | grep redis redis 47664 1 0 05:31 ? 00:00:00 /usr/bin/redis-server 127.0.0.1:6379 root 47808 45376 0 05:32 pts/0 00:00:00 grep –color=auto redis</p>
頁: [1]
查看完整版本: CentOS系统中使用yum命令安装redis的方法