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 ...
随机推荐
- LocalStorage 的 具体操作 与 设置有效期
读取与存储 的使用方法 //存储 (名称 , 内容 , 有效期<小时> ) // 如果想要自己改变 有效期的单位 可以在 set 方法中 // 找到 这两个 setHours getHou ...
- windows下的上帝模式,很好用,细想,很恐怖啊
原文地址:https://blog.csdn.net/qq_43371556/article/details/101210501 上帝模式,即"God Mode”,或称为“完全控制面板”.是 ...
- web 安全登录算法
摘自:http://hi.baidu.com/weiqi228/blog/item/922e961bbcc2c0188618bfb5.html 对于 Web 应用程序,安全登录是很重要的.但是目前大多 ...
- 【Python 代码】CS231n中Softmax线性分类器、非线性分类器对比举例(含python绘图显示结果)
1 #CS231n中线性.非线性分类器举例(Softmax) #注意其中反向传播的计算 # -*- coding: utf-8 -*- import numpy as np import matplo ...
- gogs 实现webhook钩子(php接口形式)
1.概要流程 2.准备工作 gogs服务器 linux网站服务器(宝塔) 本地客户端 3.编写钩子访问的接口 在public下新建githook.php文件,代码如下: <?php $cmd = ...
- Kettle建立数据库链接报错-'MS SQL Server' driver (jar file) is installed. kettle的bug,对于12.2而言
1.链接sql server数据库报错 错误连接数据库 [My_vm_win_sql] : org.pentaho.di.core.exception.KettleDatabaseException: ...
- face-morpher过程函数分析
01 dlib.get_frontal_face_detector #功能:人脸检测画框#参数:无#返回值:默认的人脸检测器 02 points1.astype 转换数组的数据类型 03 np.mea ...
- GIS地理工具案例教程——栅格分割
GIS地理工具案例教程--栅格分割 商务合作,科技咨询,版权转让:向日葵,135-4855__4328,xiexiaokui#qq.com 目的:利用多边形要素类去分割栅格,每个多边形裁剪出对应的范围 ...
- 卸载node和npm
sudo npm uninstall npm -g yum remove nodejs npm -y
- [转]【Windows小技巧】批量重命名文件
注:如果文件名包含空格,命令应写成ren "s0 (1).gif" s001.gif,简而言之,就是加上双引号!!!原因:系统将s0和(1).gif认为是两个参数,再加上后面的s0 ...