在 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