Docker实现一个Redis cluster
来源:互联网 发布:软件开发管理名词解释 编辑:程序博客网 时间:2024/06/05 21:49
Recommend: http://www.hawu.me/operation/802
1. docker-machine 建立三台虚拟机,first,second,third,third is a worker and the other
two are managers as the following picture.
2.
You can also encrypt data exchanged between containers on different nodes on the overlay network. To enable encryption, when you create an overlay network pass the –opt encrypted flag:
$ docker network create --opt encrypted --driver overlay myapp
When you enable overlay encryption, Docker creates IPSEC tunnels between all the nodes where tasks are scheduled for services attached to the overlay network. These tunnels also use the AES algorithm in GCM mode and manager nodes automatically rotate the keys every 12 hours.
建立overlay 网络myapp方便跨主机容器通信,–opt encrypted为加密,可不加。
3.
use command on manager node :
docker service create --network myapp --name redis-1 -p 7001:6379 redis
可以用docker service scale = 3
把任务副本调到3个,默认为1;
4.
docker service ps redis-1
查看service在哪些nodes上运行,发现second上有运行
5.
之后进入second容器docker exec -it 1a040a45302c /bin/bash
6.
然后docker@second:~$ redis-cli -h 192.168.99.101 -p 7001
可以自己连接,也可以通过其他主机连接second.(方式一样,进入redis容器,然后主机连接second主机的7001端口即可。)
root@1a040a45302c:/data# redis-cli -h 192.168.99.101 -p 7001192.168.99.101:7001> set abc 123OK192.168.99.101:7001> get abc"123"
- Docker实现一个Redis cluster
- redis cluster实现
- Redis Cluster 实现细节
- Redis Cluster实现原理
- Redis Cluster实现原理
- Redis Cluster 集群的实现和管理
- Jedis实现批量删除redis cluster
- redis cluster
- redis cluster
- redis cluster
- redis cluster
- redis cluster
- redis cluster
- redis cluster
- redis cluster
- Redis Cluster
- redis cluster
- redis-cluster
- 105_容器_Map和HashMap的基本用法_HashMap和HashTable的区别
- tf.transpose
- Android 系统调用实现函数功能--SVC指令的实现与检测
- HDU 5137 How Many Maos Does the Guanxi Worth(最短路)
- 架构师之路--视频业务介绍,离线服务架构和各种集群原理
- Docker实现一个Redis cluster
- (十一)ODataModel数据交互
- Windows下安装Tensorflow步骤
- 个人java学习回顾02
- Windows系统如何查IP和DNS
- 云服务器上tomcat启动后,外网访问很慢的解决办法
- 编程题(顺时针旋转矩阵)
- mysql中null与空值的区别
- CSU 1224 ACM小组的古怪象棋<BFS>