在 linux CentOS 系统中使用 yum 命令安装 redis 报错:
# yum install redis
Loaded plugins: fastestmirror
Setting up Install Process
Determining fastest mirrors
* base: mirrors.skyshe.cn
* extras: mirrors.163.com
这是因为,centos 预设的安装源在官方 centos.org 上,而 Redis 在第三方的 yum 源里,所以无法安装,非官方的 yum 推荐用 fedora 的 epel 仓库
使用如下命令安装第三方库:yum install epel-release
再安装 redis 即可:yum install redis
使用 service redis start 命令启动 redis 服务端:
# service redis start
Redirecting to /bin/systemctl start redis.service
使用 ps -ef | grep redis 检视 redis 程序:
# 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