搭建etcd集群
2016-11-09 11:17
330 查看
一 介绍etcd 高可用一致性键值存储系统,使用Raft一直算法处理日志复制以保证数据一致性。主要在搭建kubernates时关注到etcd来研究部署etcd。使用golang语言编写,和zookeeper一样可用用于服务注册发现,以及配置管理等。github地址:https://github.com/coreos/etcd二 单点部署1. 使用 git,wget 下载源码2. cd etcd-master3. etcd 启动4. 测试使用 etcdctrl 测试以上通过单点部署etcd 以及测试体验etcd作为键值存储所做的工作。三 实现etcd集群的部署1. 部署环境为了方便部署过程只在通过IP指定无需修改host文件指定hostname。只在一台机器搭建集群通过端口地址不同来区别。
192.168.100.128:2381
192.168.100.128:2382
192.168.100.128:2383 github 集群搭建地址:https://github.com/coreos/etcd/blob/master/Documentation/op-guide/clustering.md#etcd-discovery2. 启动node1:
etcd --name infra0 --initial-advertise-peer-urls http://192.168.100.128:2381 \
--listen-peer-urls http://192.168.100.128:2381 \ --listen-client-urls http://192.168.100.128:2279,http://127.0.0.1:2279 \ --advertise-client-urls http://192.168.100.128:2279 \ --initial-cluster-token etcd-cluster-1 \ --initial-cluster infra0=http://192.168.100.128:2381,infra1=http://192.168.100.128:2382,infra2=http://192.168.100.128:2383 \ --initial-cluster-state new
node2:
etcd --name infra1 --initial-advertise-peer-urls http://192.168.100.128:2382 \
--listen-peer-urls http://192.168.100.128:2382 \--listen-client-urls http://192.168.100.128:2280,http://127.0.0.1:2280 \--advertise-client-urls http://192.168.100.128:2280 \--initial-cluster-token etcd-cluster-1 \--initial-cluster infra0=http://192.168.100.128:2381,infra1=http://192.168.100.128:2382,infra2=http://192.168.100.128:2383 \--initial-cluster-state new
node3:
etcd --name infra2 --initial-advertise-peer-urls http://192.168.100.128:2383 \
--listen-peer-urls http://192.168.100.128:2383 \--listen-client-urls http://192.168.100.128:2281,http://127.0.0.1:2281 \--advertise-client-urls http://192.168.100.128:2281 \--initial-cluster-token etcd-cluster-1 \--initial-cluster infra0=http://192.168.100.128:2381,infra1=http://192.168.100.128:2382,infra2=http://192.168.100.128:2383 \--initial-cluster-state new
3 效果图四 描述另外文档还给出了TLS ca证书安装部署方式,以及自动自动证书安装 部署方式,以及使用DNS启动部署。五 docker 环境 etcd 启动在github中有Dockerfile文件可以构建镜像然后根据所需搭建etcd集群容器。六 总结etcd 和 zookeeper一样解决了数据一致性以及通过自动选举算法实现解决容灾问题,保证数据的高可用性以及强一致性。我们可以用etcd做服务注册发现以及配置管理等。当也可以当作key,vlue存储键值数据。研究部署etcd主要是为了搭建kubernates服务,因为kubernates系统资源调度使用etcd做服务注册发现。
相关文章推荐
- 搭建etcd集群,python调etcd接口
- Etcd学习(三)集群搭建Clustering中Leader问题
- etcd集群搭建--static方式
- Centos7下Etcd集群搭建
- Etcd集群搭建
- CentOS 7上搭建安全、容灾、高可用的etcd集群
- kubernetes环境搭建(1) 一一 etcd集群搭建
- etcd 集群搭建及常用场景分析
- 搭建 etcd 集群 - 暴走漫画容器实践系列 Part3
- etcd 集群搭建及常用场景分析
- Docker 搭建 etcd 集群
- Etcd学习(二)集群搭建Clustering
- Etcd学习(二)集群搭建Clustering
- Docker下ETCD集群搭建
- etcd 集群搭建
- quay.io/coreos/etcd 基于Docker镜像的集群搭建
- Docker + Swarm + etcd 集群搭建
- etcd集群搭建
- Centos7环境下etcd集群的搭建
- Etcd学习(二)集群搭建Clustering