CentOS7 搭建 Consul 集群
环境准备:
ssh shell工具: 远程连接
三个CentOS示例: 部署集群
配置好各个实例之间的网络访问,以及ssh免密登录。
下载&上传:
1、下载 Consul:
Download Consul - Consul by HashiCorp
2、上传至虚拟机:
➜ Desktop scp consul_1.1.0_linux_amd64.zip root@192.168.1.11:/opt
➜ Desktop scp consul_1.1.0_linux_amd64.zip root@192.168.1.12:/opt
➜ Desktop scp consul_1.1.0_linux_amd64.zip root@192.168.1.13:/opt
解压&拷贝
在其他几台机器上重复此命步骤:
[root@centos-1 ~]# yum install unzip -y
[root@centos-1 ~]# cd /opt
[root@centos-1 opt]# ls
consul_1.1.0_linux_amd64.zip
[root@centos-1 opt]# unzip consul_1.1.0_linux_amd64.zip
Archive: consul_1.1.0_linux_amd64.zip
inflating: consul
[root@centos-1 opt]# ls
consul consul_1.1.0_linux_amd64.zip
[root@centos-1 opt]# mv consul /usr/bin/
[root@centos-1 bin]# cd /usr/bin/ && ls consul
consul
启动
[root@centos-1 ~]# consul agent -server -data-dir=/tmp/consul -node=server-1 \
-bind=192.168.1.11 -bootstrap-expect 3 -client=0.0.0.0 -ui &
[root@centos-2 ~]# consul agent -server -data-dir=/tmp/consul -node=server-2 \
-bind=192.168.1.12 -join=192.168.1.11 -client=0.0.0.0 -ui &
[root@centos-3 ~]# consul agent -server -data-dir=/tmp/consul -node=server-3 \
-bind=192.168.1.13 -join=192.168.1.11 -client=0.0.0.0 -ui &
选项详解:
| 选项 | 说明 |
|---|---|
consul anent: |
该命令会启动一个consulAnent |
-server |
表示该 agent是一个 serverAgent,不添加这个选项则表示是一个 clientAgent |
-data-dir |
表示相关数据存储的目录位置,在 serverAgent上该命令所指示的目录下会存储一些集群的状态信息 |
-node |
指定该 agent 节点的名称,该名称在集群众必须是唯一的 |
-bind |
指定 agent 的 Ip |
-bootstrap-expect |
该命令通知 consul 准备加入集群的节点个数 |
-client 0.0.0.0 -ui |
启动 consulUI,如不添加该指令,则 UI 只能在当前机器上访问 |
-dc |
指定该 agent 加入到哪一个数据中心,默认为 dc1 |
join |
将该节点加入集群中 |
验证
验证集群是否搭建成功,执行consul members,在任意的一台机器上:
[root@centos-1 ~]# consul members
Node Address Status Type Build Protocol DC Segment
server-1 192.168.1.11:8301 alive server 1.1.0 2 dc1 <all>
server-2 192.168.1.12:8301 alive server 1.1.0 2 dc1 <all>
server-3 192.168.1.13:8301 alive server 1.1.0 2 dc1 <all>
CentOS7 搭建 Consul 集群的更多相关文章
- 庐山真面目之十二微服务架构基于Docker搭建Consul集群、Ocelot网关集群和IdentityServer版本实现
庐山真面目之十二微服务架构基于Docker搭建Consul集群.Ocelot网关集群和IdentityServer版本实现 一.简介 在第七篇文章<庐山真面目之七微服务架构Consul ...
- vagrant+docker搭建consul集群开发环境
HashiCorp 公司推出的Consul是一款分布式高可用服务治理与服务配置的工具.关于其配置与使用可以参考这篇文章 consul 简介与配置说明. 一般,我们会在多台主机上安装并启动 consul ...
- 搭建 consul 集群
=============================consul 命令行工具=============================consul 支持 Windows/Linux 等多种平台, ...
- centos7搭建kafka集群-第二篇
好了,本篇开始部署kafka集群 Zookeeper集群搭建 注:Kafka集群是把状态保存在Zookeeper中的,首先要搭建Zookeeper集群(也可以用kafka自带的ZK,但不推荐) 1.软 ...
- CentOS7安装Consul集群
1.准备4台服务器 linux1 192.168.56.101 linux2 192.168.56.102 linux3 192.168.56.103 linux4 192.168.56.104 2. ...
- Docker学习-Docker搭建Consul集群
1.环境准备 Linux机器三台 网络互通配置可以参考 https://www.cnblogs.com/woxpp/p/11858257.html 192.168.50.21 192.168.50.2 ...
- centos7搭建kafka集群
一.安装jdk 1.下载jdk压缩包并移动到/usr/local目录 mv jdk-8u162-linux-x64.tar.gz /usr/local 2.解压 tar -zxvf jdk-8u162 ...
- 搭建consul 集群
1. 准备工作 a) 启动三台虚拟机 s1:10.1.7.141 s2:10.1.7.139 s3:10.1.7.138 b) 每台机器上在 /home新建文件夹 mkdir ...
- 【转】centos7 搭建etcd集群
转自http://www.cnblogs.com/zhenyuyaodidiao/p/6237019.html 一.简介 “A highly-available key value store for ...
随机推荐
- select下拉框多选取值
本来是单选取值,现改为多选 其中<select> 标签新增multiple属性,如<select id = "sel" multiple = "mul ...
- snprintf用错了快10年…
int snprintf(char *str, size_t size, const char *format, ...); 从用snprintf开始,size参数一直传的都是buff_size-1, ...
- ubuntu之路——day10.4 什么是人的表现
结合吴恩达老师前面的讲解,可以得出一个结论: 在机器学习的早期阶段,传统的机器学习算法在没有赶超人类能力的时候,很难比较这些经典算法的好坏.也许在不同的数据场景下,不同的ML算法有着不同的表现. 但是 ...
- google镜像《转》
最新谷歌镜像列表 https://jsproxy-demo.ml 谷歌镜像F1http://go.yuxuantech.com 谷歌镜像F1,非SSLhttps://www.siwa88.net 谷歌 ...
- Android Mboot mmc命令介绍
mmc command. 目前Mboot支持以下mmc命令: 1) mmc read/write. 读写命令.Addr = 内存地址, blk# = 起始block数, size ...
- 请你谈谈Cookie的弊端
a. 每个特定的域名下最多生成的cookie个数有限制 b. IE和Opera 会清理近期最少使用的cookie,Firefox会随机清理cookie c. cookie的最大大约为4096字节,为了 ...
- 面邻域Polygon Neighbors
面邻域Polygon Neighbors 商务合作,科技咨询,版权转让:向日葵,135-4855__4328,xiexiaokui#qq.com 功能: Polygon Neighbors Creat ...
- Mini学习之mini.DataGrid使用说明
参考:http://miniui.com/docs/api/index.html#ui=datagrid mini.DataGrid表格.实现分页加载.自定义列.单元格渲染.行编辑器.锁定列.过滤行. ...
- ZingChart line 折线图表数据设置
根据 x 坐标和 y 坐标一一对应进行设置 (x,y) { "type": "line", "series":[ {,],[,],[,],[ ...
- 贪心:leetcode 870. Advantage Shuffle、134. Gas Station、452. Minimum Number of Arrows to Burst Balloons、316. Remove Duplicate Letters
870. Advantage Shuffle 思路:A数组的最大值大于B的最大值,就拿这个A跟B比较:如果不大于,就拿最小值跟B比较 A可以改变顺序,但B的顺序不能改变,只能通过容器来获得由大到小的顺 ...