docker 中redis+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
  • 第四步: 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>

參考文獻

注意:

  • 鏈接docker中的redis的時候,由於docker至關在windows中劃一塊作linux的獨立運行環境。
  • 該環境有本身的地址:192.168.99.100,因此訪問的時候最簡單的方式是去鏈接該網址。
  • 6379 端口在虛機中網關中打開就能夠外部鏈接訪問了。

原文出處:https://www.cnblogs.com/chenshuquan/p/11696961.htmlgithub

相關文章
相關標籤/搜索