etcd3集群部署
2017-05-03 14:28
357 查看
部署环境
停掉防火墙
systemctl stop firewalld
systemctl disable firewalld
关闭SELinux
编辑/etc/selinux/config
下载etcd
https://github.com/coreos/etcd/releases
cd /usr/local/src
wget https://github.com/coreos/etcd/releases/download/v3.1.7/etcd-v3.1.7-linux-amd64.tar.gz,也可以使用curl或aria2下载
tar zxvf etcd-v3.1.7-linux-amd64.tar.gz
cd etcd-v3.1.7-linux-amd64
添加环境变量export ETCDCTL_API=3,指定客户端工具etcdctl使用api v3和服务器程序etcd进行通信。
使用静态方式创建集群
在node201节点创建etcd.service
在node202节点创建etcd.service
在节点node203创建文件etcd.service
在3个节点执行以下命令
cp etcd.service /usr/lib/systemd/system/
systemctl daemon-reload
systemctl enable etcd
sytemctl start etcd
使用etcdctl版本2查看信息
主机名 | IP | 操作系统 |
node201 | 10.0.0.201 | centos 7.3 64位 |
node202 | 10.0.0.202 | centos 7.3 64位 |
node203 | 10.0.0.203 | centos 7.3 64位 |
systemctl stop firewalld
systemctl disable firewalld
关闭SELinux
编辑/etc/selinux/config
下载etcd
https://github.com/coreos/etcd/releases
cd /usr/local/src
wget https://github.com/coreos/etcd/releases/download/v3.1.7/etcd-v3.1.7-linux-amd64.tar.gz,也可以使用curl或aria2下载
tar zxvf etcd-v3.1.7-linux-amd64.tar.gz
cd etcd-v3.1.7-linux-amd64
添加环境变量export ETCDCTL_API=3,指定客户端工具etcdctl使用api v3和服务器程序etcd进行通信。
使用静态方式创建集群
在node201节点创建etcd.service
[Unit] Description=Etcd Server After=network.target After=network-online.target Wants=network-online.target [Service] Type=notify WorkingDirectory=/usr/local/src/etcd-v3.1.7-linux-amd64 EnvironmentFile=-/usr/local/src/etcd-v3.1.7-linux-amd64/etcd.conf # set GOMAXPROCS to number of processors ExecStart=/usr/local/src/etcd-v3.1.7-linux-amd64/etcd \ --name infra0 \ --initial-advertise-peer-urls http://10.0.0.201:2380 \ --listen-client-urls http://10.0.0.201:2379,http://127.0.0.1:2379 \ --listen-peer-urls http://10.0.0.201:2380 \ --advertise-client-urls http://10.0.0.201:2379 \ --initial-cluster-token etcd-cluster1 \ --initial-cluster infra0=http://10.0.0.201:2380,infra1=http://10.0.0.202:2380,infra2=http://10.0.0.203:2380 \ --initial-cluster-state new Restart=on-failure LimitNOFILE=65536 [Install] WantedBy=multi-user.target
在node202节点创建etcd.service
[Unit] Description=Etcd Server After=network.target After=network-online.target Wants=network-online.target [Service] Type=notify WorkingDirectory=/usr/local/src/etcd-v3.1.7-linux-amd64 EnvironmentFile=-/usr/local/src/etcd-v3.1.7-linux-amd64/etcd.conf # set GOMAXPROCS to number of processors ExecStart=/usr/local/src/etcd-v3.1.7-linux-amd64/etcd \ --name infra1 \ --initial-advertise-peer-urls http://10.0.0.202:2380 \ --listen-client-urls http://10.0.0.202:2379,http://127.0.0.1:2379 \ --listen-peer-urls http://10.0.0.202:2380 \ --advertise-client-urls http://10.0.0.202:2379 \ --initial-cluster-token etcd-cluster1 \ --initial-cluster infra0=http://10.0.0.201:2380,infra1=http://10.0.0.202:2380,infra2=http://10.0.0.203:2380 \ --initial-cluster-state new Restart=on-failure LimitNOFILE=65536 [Install] WantedBy=multi-user.target
在节点node203创建文件etcd.service
[Unit] Description=Etcd Server After=network.target After=network-online.target Wants=network-online.target [Service] Type=notify WorkingDirectory=/usr/local/src/etcd-v3.1.7-linux-amd64 EnvironmentFile=-/usr/local/src/etcd-v3.1.7-linux-amd64/etcd.conf # set GOMAXPROCS to number of processors ExecStart=/usr/local/src/etcd-v3.1.7-linux-amd64/etcd \ --name infra2 \ --initial-advertise-peer-urls http://10.0.0.203:2380 \ --listen-client-urls http://10.0.0.203:2379,http://127.0.0.1:2379 \ --listen-peer-urls http://10.0.0.203:2380 \ --advertise-client-urls http://10.0.0.203:2379 \ --initial-cluster-token etcd-cluster1 \ --initial-cluster infra0=http://10.0.0.201:2380,infra1=http://10.0.0.202:2380,infra2=http://10.0.0.203:2380 \ --initial-cluster-state new Restart=on-failure LimitNOFILE=65536 [Install] WantedBy=multi-user.target
在3个节点执行以下命令
cp etcd.service /usr/lib/systemd/system/
systemctl daemon-reload
systemctl enable etcd
sytemctl start etcd
使用etcdctl版本2查看信息
相关文章推荐
- Weblogic 12c 集群部署和session复制
- Mycat之——Mycat集群部署(基于HAProxy + Mycat)
- Azkaban3.x集群部署(multiple executor mode)
- storm集群的安装和部署
- Cloudera 5.7集群部署(二)--CM、CDH安装
- Docker部署Hadoop集群
- Cloudera 5.7集群部署(二)--CM、CDH安装
- Cloudera 5.7集群部署(四)--KAFKA集成
- 使用Tomcat-redis-session-manager来实现Tomcat集群部署中的Session共享
- ZooKeeper集群部署详解
- hbase集群部署
- Apache+Tomcat集群部署
- D3学习:集群布局
- etcd+calico集群的部署
- 实战 - 部署 Spark Application 到集群
- CentOS 6.8 实战部署JStorm集群
- Rabbitmq集群高可用部署详细
- 在Ubuntu16.04集群上手工部署Kubernetes(未完,陆续补充中)
- 搜索引擎--Solr 集群部署