欢迎投稿

今日深度:

linux Centos7 安装redis及使用过程,centos7redis

linux Centos7 安装redis及使用过程,centos7redis


1、安装redis数据库

yum install redis

2、下载fedora的epel仓库

yum install epel-release

3、启动redis服务

systemctl start redis

4、查看redis启动状态

systemctl status redis

systemctl stop redis 停止服务

systemctl restart redis 重启服务

5、设置开机自启动

systemctl enable redis

6、开放端口号

firewall-cmd --zone=public --add-port=80/tcp --permanent

firewall-cmd --zone=public --add-port=6379/tcp --permanent

注意:80端口是必须要开放的

重启防火墙:systemctl restart firewalld

7、查看端口

netstat -lnp|grep 6379

8、设置redis 远程连接和密码

输入命令vi /etc/redis.conf进入编辑模式

注释掉,否则只有本机才能访问

保护模式修改为no

修改密码为123456

9、重启redis

systemctl restart redis

10、进入redis

redis-cli -h 127.0.0.1 -p 6379

输入info,提示必须验证

输入用户名和密码(auth 123456)

通过key * 查看所有的键(因为还没有使用,所以是空)

11.客户端连接redis

www.htsjk.Com true http://www.htsjk.com/redis/30649.html NewsArticle linux Centos7 安装redis及使用过程,centos7redis 1、安装redis数据库 yum install redis 2、下载fedora的epel仓库 yum install epel-release 3、启动redis服务 systemctl start redis 4、查看redis启动状态 systemctl stat...
相关文章
    暂无相关文章
评论暂时关闭