背景:某天,有个大数据大佬要个Redis,过了一天,说要个带bloom的Redis,又过了一天,说要一个内存100G的Redis
一、操作系统
centos7
二、操作步骤
1、查看镜像
[root@localhost config]# docker search redislabs
2、拉取镜像,选择带有布隆过滤器的镜像
[root@localhost config]# docker pull redislabs/rebloom
3、部署
[root@localhost config]# docker run -tid -p 对外端口:6379 --name redis-bloom --restart=always -v /youpath/data:/data -e REDIS_MAXMEMORY=20G redislabs/rebloom:latest
REDIS_MAXMEMORY=20G 这个设置可能未生效
4、进入容器,连接redis
[root@localhost config]# docker exec -it redis-bloom /bin/bash
root@5140b68a0642:/data# redis-cli
5、设置密码
127.0.0.1:6379> config set requirepass 你的密码
127.0.0.1:6379> config set notify-keyspace-events
127.0.0.1:6379> auth 你的密码
127.0.0.1:6379> config set notify-keyspace-events xE
6、测试布隆过滤器 bloom
127.0.0.1:6379> bf.add bloomDemo h
127.0.0.1:6379> bf.add bloomDemo e
127.0.0.1:6379> bf.add bloomDemo t
7、设置内存20G
127.0.0.1:6379> auth 你的密码
OK
127.0.0.1:6379> CONFIG get maxmemory auth 你的密码
1) "maxmemory"
2) "0"
127.0.0.1:6379> CONFIG SET maxmemory 21474836480
OK
127.0.0.1:6379> CONFIG get maxmemory
1) "maxmemory"
2) "21474836480"
127.0.0.1:6379>
不建议,先装Redis,再装布隆过滤器,这个操作就像月球的表面---全是坑