1. 程式人生 > >Linux CentOS7 yum安裝Redis

Linux CentOS7 yum安裝Redis

看能不能下載

# yum install -y redis

不能下載就得下載源

# yum install epel-release

下載並安裝

# yum install -y redis

啟動

# service redis start

檢視狀態

# service redis status

redis開機自啟動

# chkconfig redis on

進入cli

# redis-cli

測試

# set a 1
# get a

退出cli

# exit

配置防火牆
/sbin/iptables -I INPUT -p tcp --dport 6379 -j ACCEPT

重啟防火牆

# systemctl restart iptables.service