Go to downloads page to download the correct version:
https://www.consul.io/downloads.html
I downloaded below version:
https://releases.hashicorp.com/consul/1.2.2/consul_1.2.2_linux_386.zip
unzip the package
unzip consul_1.2.2_linux_386.zip
Copied the unziped file consul* to /usr/bin/
mv consul /usr/bin/consul
Start the consul server agent
mkdir -p /tmp/consul
nohup consul agent -server -data-dir=/tmp/consul -node=server1 -bind=192.168.1.103 -bootstrap-expect 1 -client 0.0.0.0 -ui &
| Parameter | Comments |
|---|---|
| consul agent | it will start a consul agent |
| -server | means the agent is a server agent,it is client agent it we do not define this parameter |
| -data-dir | client agent:service info,healthy info,server agent:cluster info |
| -node | the agent name, must unique, it will default to host if not defined |
| -bind | the ip for the agent |
| -bootstrap-expect 1 | to inform consul that how many server agent will be joined, it aims to lazy start replication |
| -client 0.0.0.0 -ui | start consul UI and all IPs can access the UI |
Start the consul client agent
mkdir -p /tmp/consul
nohup consul agent -data-dir=/tmp/consul -node=client-11 -bind=192.168.1.102 -join=192.168.1.103 &
| Parameter | Comments |
|---|---|
| -join | add this client agent to agent server cluster |
We can use below command to view all the nodes
consul members
We can access consul UI use below address
http://192.168.1.103:8500
spring-boot integrate with service register and discover
https://blog.youkuaiyun.com/yaominhua/article/details/82317368
本文详细介绍Consul的下载、安装及配置流程,包括启动服务器代理和服务客户端代理的方法,并提供了查看节点状态和访问Consul UI的方式。
1492

被折叠的 条评论
为什么被折叠?



