1.下载Consul-windows版本。
下载地址:https://www.consul.io/downloads.html
选择对应的windows版本即可。
2.准备配置文件,其中包括三个server和一个client,
注意其中node_name 需唯一,ui指定是否启动可视化页面,server区分server与client
server1:
{
"datacenter": "dc1",
"data_dir": "D:\\mayt\\software\\consul\\node1",
"log_level": "INFO",
"server": true,
"node_name": "node1",
"ui": true,
"bind_addr": "127.0.0.1",
"client_addr": "127.0.0.1",
"advertise_addr": "127.0.0.1",
"bootstrap_expect": 2,
"ports":{
"http": 8500,
"dns": 8600,
"server": 8300,
"serf_lan": 8301,
"serf_wan": 8302
}
}
server2:
{
"datacenter": "dc1