redis

作者: 焉知非鱼 | 来源:发表于2017-10-09 14:38 被阅读2次

brew install redis

To have launchd start redis now and restart at login:
  brew services start redis
Or, if you don't want/need a background service you can just run:
  redis-server /usr/local/etc/redis.conf

可以编辑 /usr/local/etc/redis.conf, 设置 redis 密码 requirepass

启动:

# redis-server
redis-server /usr/local/etc/redis.conf
127.0.0.1:6379> pfadd mykey a b c
(integer) 1
127.0.0.1:6379> pfcount mykey
(integer) 3
127.0.0.1:6379> pfadd mykey2 a b c c d
(integer) 1
127.0.0.1:6379> pfcount mykey2
(integer) 4
127.0.0.1:6379> 

批量删除某一类 key

redis-cli -h 10.0.0.200 -a 'verycomplexpassword' -n 3 KEYS 'ST_*Qr*' | xargs redis-cli -h 10.0.0.200 -a 'verycomplexpassword' -n 3  DEL

相关文章

网友评论

      本文标题:redis

      本文链接:https://www.haomeiwen.com/subject/etcpyxtx.html