博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
使用docker配置etcd集群
阅读量:7087 次
发布时间:2019-06-28

本文共 2374 字,大约阅读时间需要 7 分钟。

docker配置etcd集群与直接部署etcd集群在配置上并没有什么太大差别。

我这里直接使用docker-compose来实现容器化的etcd部署

环境如下:

HostName IP
etcd1 10.1.61.175
etcd2 10.1.61.176
etcd3 10.1.61.177

etcd1上的docker-compose.yaml内容如下:

version: "2"services:  etcd:    image: hub.dz11.com/library/etcd-amd64:3.1.10    restart: always    network_mode: host    volumes:      - "/home/www/server/etcd:/data/etcd"      - "/etc/localtime:/etc/localtime"    environment:      ETCDCTL_API: "3"    command: etcd  -name etcd1 -data-dir /data/etcd -advertise-client-urls http://10.1.61.175:2379 -listen-client-urls http://10.1.61.175:2379,http://127.0.0.1:2379 -initial-advertise-peer-urls http://10.1.61.175:2380 -listen-peer-urls http://0.0.0.0:2380 -initial-cluster-token etcd-cluster-1 -initial-cluster etcd1=http://10.1.61.175:2380,etcd2=http://10.1.61.176:2380,etcd3=http://10.1.61.177:2380 -initial-cluster-state new

etcd2上的docker-compose.yaml内容如下:

version: "2"services:  etcd:    image: hub.dz11.com/library/etcd-amd64:3.1.10    restart: always    network_mode: host    volumes:      - "/home/www/server/etcd:/data/etcd"      - "/etc/localtime:/etc/localtime"    environment:      ETCDCTL_API: "3"    command: etcd  -name etcd2 -data-dir /data/etcd -advertise-client-urls http://10.1.61.176:2379 -listen-client-urls http://10.1.61.176:2379,http://127.0.0.1:2379 -initial-advertise-peer-urls http://10.1.61.176:2380 -listen-peer-urls http://0.0.0.0:2380 -initial-cluster-token etcd-cluster-1 -initial-cluster etcd1=http://10.1.61.175:2380,etcd2=http://10.1.61.176:2380,etcd3=http://10.1.61.177:2380 -initial-cluster-state new

etcd3上的docker-compose.yaml内容如下:

version: "2"services:  etcd:    image: dk-reg.op.douyuyuba.com/library/etcd-amd64:3.1.10    restart: always    network_mode: host    volumes:      - "/home/www/server/etcd:/data/etcd"      - "/etc/localtime:/etc/localtime"    environment:      ETCDCTL_API: "3"    command: etcd  -name etcd3 -data-dir /data/etcd -advertise-client-urls http://10.1.61.177:2379 -listen-client-urls http://10.1.61.177:2379,http://127.0.0.1:2379 -initial-advertise-peer-urls http://10.1.61.177:2380 -listen-peer-urls http://0.0.0.0:2380 -initial-cluster-token etcd-cluster-1 -initial-cluster etcd1=http://10.1.61.175:2380,etcd2=http://10.1.61.176:2380,etcd3=http://10.1.61.177:2380 -initial-cluster-state new

启动docker-compose:

docker-compose up -d

转载于:https://www.cnblogs.com/breezey/p/8847418.html

你可能感兴趣的文章
Linux的常用目录(Ubuntu)
查看>>
linux 下更改文件名编码方式
查看>>
浏览器内核相关
查看>>
Completely Uninstall Node.js from Mac OS X
查看>>
Redis数据库学习(1)
查看>>
rsync+inotify配置
查看>>
Android学习笔记系列
查看>>
Maven学习总结(四)——Maven核心概念
查看>>
linux挂载ipsan服务器
查看>>
2013-05-25
查看>>
innodb_force_recovery强制修复MySQL异常关闭问题
查看>>
如何将Windows XP SP3改成SP2
查看>>
我的友情链接
查看>>
实战MYSQL 8.0.12 主主复制配置过程
查看>>
1周2次课
查看>>
教你将PDF文件旋转的方法
查看>>
玩转linux 第五天之正则表达式
查看>>
【远程医疗专题】远程医疗论文30篇及解决方案10篇
查看>>
网络营销第六课(8):SEO搜索引擎优化(长尾关键词)
查看>>
IPSec实验的一些体会
查看>>