vi /usr/local/redis/etc/redis.conf
快照方式:
save 900 1
save 300 10
save 60 10000
aof方式:
appendonly no | yes
appendfsync always | everysec | no
client 1:
>bin/redis-cli -a boa
subscribe chanel1 //客户端1监听频道1
client2:
>bin/redis-cli -a boa
subscribe chanel1 chanel2 //客户端2同时监听频道1, 频道2
client3:
>bin/redis-cli -a boa
PUBLISH chanel1 boa is a good woman
vi /usr/local/redis/etc/redis.conf //修改配置文件中缓存相关的东西
vm-enabled yes //默认是关闭
添加一句: really-use-vm yes
vm-max-memory 100000
vm-max-threads 4
重启动redis服务
时间: 2024-10-07 06:12:48