Consul is a service networking solution to automate network configurations, discover services, and enable secure connectivity across any cloud or runtime.
Install
- Download Consul from https://consul.io or can use
brew install consul
Start and Setup Agent Token
- Create a setting file named
consul-config.json
{
"primary_datacenter": "dc1",
"data_dir": "D:\\Projects\\consul_1.7.3_windows_amd64",
"server": true,
"server_name": "TopNguyen",
"bootstrap": true,
"ui": true,
"ports": {
"http": 8500
},
"acl" : {
"enabled": true,
"default_policy": "deny",
"enable_token_persistence": true,
"tokens": {
"default": "26e3ea3a-81d5-c460-8abb-b74b4874648a",
"master": "26e3ea3a-81d5-c460-8abb-b74b4874648a"
}
}
}
- Run Consul Agent by CLI
consul agent -config-file="/Users/top/Workspaces/Consul/consul-config.json"
- Default Consul will run on localhost:8500
Run Consul as a Service
- Use nssm to add Consul as a Service
Integration
Add Fabio (Load Balancing) integration with Consul