标签:pop 技术分享 运行 目录 .com 特点 shutdown 绑定 listen
资源:
https://redis.io/
https://redis.io/download/
http://redisdoc.com/
特点:
应用场景:
安装配置:
yum安装,如果起不来,请参考日志信息
[root@Poppy ~]# yum install redis [root@Poppy ~]# systemctl status redis.service [root@Poppy ~]# vi /etc/redis.conf [root@Poppy ~]# cat /var/log/redis/redis.log [root@Poppy ~]# chown -R redis.redis /var/log/redis/redis.log [root@Poppy ~]# systemctl start redis.service [root@Poppy ~]# systemctl status redis
编译安装,可以设置多目录,改不同端口可实现多redis实例共存
[root@Poppy ~]# wget http://download.redis.io/releases/redis-3.2.6.tar.gz [root@Poppy ~]# mv redis-3.2.6.tar.gz /data/ [root@Poppy ~]# cd /data/ [root@Poppy ~]# mkdir redis6380 [root@Poppy ~]# tar -zxf redis-3.2.6.tar.gz -C redis6380/ [root@Poppy ~]# cd redis6380/ [root@Poppy ~]# cd redis-3.2.6/ [root@Poppy ~]# make [root@Poppy ~]# cp redis.conf ../ [root@Poppy ~]# cp src/redis-server ../
配置文件redis.conf里面修改
启动redis
[root@Poppy redis6380]# ./redis-server ./redis.conf [root@Poppy redis6380]# netstat -ntlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 60.205.188.107:6666 0.0.0.0:* LISTEN 14584/java tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 18969/redis-server tcp 0 0 127.0.0.1:6380 0.0.0.0:* LISTEN 25154/./redis-serve tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2213/sshd
访问redis
[root@Poppy ~]# redis-cli 6379 [root@Poppy ~]# ./redis-cli -p 6380 编译目录下src下有这个命令 [root@Poppy ~]# redis-cli -h 127.0.0.1 -p 6380 通过netstart -ntlp查看绑定在哪个ip上
退出访问终端和在终端停止redis
[root@Poppy redis6380]# redis-cli -p 6380 127.0.0.1:6380> exit [root@Poppy redis6380]# redis-cli -p 6380 127.0.0.1:6380> SHUTDOWN not connected> exit
客户端登录
[root@Poppy redis6380]# kill -9 25378 [root@Poppy redis6380]# ./redis-server ./redis.conf [root@Poppy redis6380]# redis-cli -p 6380 127.0.0.1:6380> get foo (error) NOAUTH Authentication required. 127.0.0.1:6380> auth poppy OK
客户端进入后,可输入上述命令查看,运行配置变更重启失效
持久化策略
标签:pop 技术分享 运行 目录 .com 特点 shutdown 绑定 listen
原文地址:https://www.cnblogs.com/jokerbj/p/10257383.html