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

猜你喜欢

转载自blog.csdn.net/weikaixxxxxx/article/details/84550228