`
pengfeifei26
  • 浏览: 245697 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

docker redis

 
阅读更多
https://www.centos.bz/2017/09/centos-7-3-%E4%B8%8A%E7%94%A8-docker-%E9%83%A8%E7%BD%B2-redis-%E4%BB%8B%E7%BB%8D/
docker pull redis

docker run --name test_redis -p 6479:6379  -d redis

docker run -p 6479:6379 --name test1_redis -v $PWD/redis.conf:/etc/redis/redis.conf -v $PWD/data:/data -d redis redis-server /etc/redis/redis.conf --appendonly yes


docker inspect e60da5191243|grep -i add 查看ip

root@4198fd3a90fe:/data# redis-cli -h 192.168.0.3 -p 6379

springboot redis 配置

spring.redis.host=192.168.0.3                                                                                                                                                                                                                              
# Redis服务器端口。                                                                                                                                                                                                                                        
spring.redis.port=6379                                                                                                                                                                                                                                     
# 登录redis服务器的密码。                                                                                                                                                                                                                                  
spring.redis.password=



设置密码
docker run -d -p 6379:6379 redis redis-server --requirepass mypwd
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics