启动client:
redis-cli -h host -p port -a pw
对key做操作:
set key value
get key
del key
通过incr命令,避免多个cli自己做加法时的数据不一致问题 SET connections 10 INCR connections => 11 INCR connections => 12 DEL connections INCR connections => 1
设置过期时间
EXPIRE key 20
列表
RPUSH list itema LPUSH list itemb LRANGE list 0 -1