配置文件
1.单位
配置的大小单位,开头定义了一些基本的度量达纳韦,只支持bytes,不支持bit 大小写不敏感
2.Includes
3.网络相关配置
tcp-backlog 511
timeout 0
tcp-keepalive 300
4.通用设置
daemonize no 后台进程 yes 是
pidfile /var/run/redis_6379.pid 存放pid文件的位置,每个实例生产一个不同的pid文件
loglevel notice 日志级别
logfile “” 输出日志
databases 16 16个数据库
always-show-logo no
set-proc-title yes
5.安全
6.CLIENTS
maxclients 10000
7.Limits限制 MEMORY MANAGEMENT
内存的管理 限制之类的
发布和订阅
1.什么是发布和订阅
2.redis的发布和订阅
3.发布订阅命令行实现
客户端1发布消息 subscribe channel1
127.0.0.1:6379> subscribe channel1Reading messages... (press Ctrl-C to quit)1) "subscribe"2) "channel1"3) (integer) 1
客户端2订阅消息
127.0.0.1:6379> publish channel1 helloworld(integer) 1127.0.0.1:6379> publish channel1 hehe(integer) 1127.0.0.1:6379> publish channel1 hehe2(integer) 1127.0.0.1:6379>
客户端1收到了消息如下:
Reading messages... (press Ctrl-C to quit)1) "subscribe"2) "channel1"3) (integer) 11) "message"2) "channel1"3) "helloworld"1) "message"2) "channel1"3) "hehe"1) "message"2) "channel1"3) "hehe2"
