docker-redis 单机配置
docker-redis 单机配置
1、创建并运行实例
docker run –name traffic-redis \
-p 56379:6379 \
-m 2048m \
–privileged=true \
–restart=always \
-v /opt/redis-5.0.4/redis.conf:/usr/local/etc/redis/redis.conf \
-v /opt/redis-5.0.4/data:/data \
-d redis:5.0.4 redis-server /usr/local/etc/redis/redis.conf
2、创建本地redis客户端
docker run -it –rm \
–name traffic-redis-client \
-d redis:5.0.4 redis-cli -h 192.169.1.11 -p 56379
3、使用工具连接到redis服务
docker exec -it traffic-redis-client redis-cli -h 192.169.1.11 -p 56379
4、配置在当前目录
redis.conf
sentinel.conf
配置文件请自备