Docker-RedisBloom的使用

redis+RedisBloom的安装和使用

  • 如果你是linux开发环境,最新版的redis可以很方便的使用,但如果是Windows系统的话,那么高版本的安装资源就很可贵了,docker可以快速的解决你的后顾之忧。
安装
  • 第一步: Launch RedisBloom with Docker
    docker run -p 6379:6379 --name redis-redisbloom redislabs/rebloom:latest

  • 第二步: Use RedisBloom withredis-cli
    docker exec -it redis-redisbloom bash # redis-cli # 127.0.0.1:6379>

  • 第三步: Start a new bloom filter by adding a new item
    # 127.0.0.1:6379> BF.ADD newFilter foo (integer) 1

  • 【Docker-RedisBloom的使用】第四步: Checking if an item exists in the filter
    # 127.0.0.1:6379> BF.EXISTS newFilter foo (integer) 1

  • 第五步: 配置密码或其它相关设置 ......
    127.0.0.1:6379> config set requirepass xxxxx OK 127.0.0.1:6379> config set notify-keyspace-events xE (error) NOAUTH Authentication required. 127.0.0.1:6379> auth xxxxx OK 127.0.0.1:6379> config set notify-keyspace-events xE OK 127.0.0.1:6379>

参考文献
  • https://blog.csdn.net/qq\_29645505/article/details/87895303
  • https://github.com/RedisBloom/RedisBloom#launch-redisbloom-with-docker
  • https://oss.redislabs.com/redisbloom/Quick\_Start/
注意:
  • 连接docker中的redis的时候,因为docker相当在windows中划一块做linux的独立运行环境。
  • 该环境有自己的地址:192.168.99.100,所以访问的时候最简单的方式是去连接该网址。
  • 6379 端口在虚机中网关中打开就可以外部连接访问了。

    推荐阅读