Installation and use of redis + redisbloom
- If you are a Linux development environment, the latest version of redis can be used easily, but if you are a Windows system, then the installation resources of the higher version are very valuable, and docker can quickly solve your worries.
install
-
Step 1: launch redisbloom with docker
docker run -p 6379:6379 --name redis-redisbloom redislabs/rebloom:latest
-
Step 2: use redisbloom with
redis-cli
docker exec -it redis-redisbloom bash # redis-cli # 127.0.0.1:6379>
-
Step 3: start a new bloom filter by adding a new item
# 127.0.0.1:6379> BF.ADD newFilter foo (integer) 1
-
Step 4: checking if an item exists in the filter
# 127.0.0.1:6379> BF.EXISTS newFilter foo (integer) 1
-
Step 5: configure password or other related settings
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>
reference
- 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/
be careful:
- When connecting to redis in docker, docker is a separate Linux running environment in windows.
- The environment has its own address: 192.168.99.100, so the easiest way to visit is to connect to the website.
- Port 6379 can be accessed by external connection when it is opened in gateway of virtual machine.