Стандартный клиент (пример конфига)
{
"addresses": {
"dns": "0.0.0.0",
"grpc": "0.0.0.0",
"http": "0.0.0.0",
"https": "0.0.0.0"
},
"advertise_addr": "10.77.56.135",
"bootstrap": false,
"client_addr": "127.0.0.1",
"data_dir": "/opt/consul",
"datacenter": "stage",
"disable_update_check": false,
"domain": "c.fin",
"enable_local_script_checks": false,
"enable_script_checks": false,
"enable_syslog": true,
"encrypt": "Khj2HjAaM6X6hufSJgYl/g==",
"log_level": "INFO",
"node_meta": {"env": "stage"},
"performance": {
"leave_drain_time": "5s",
"raft_multiplier": 1,
"rpc_hold_timeout": "7s"
},
"ports": {
"dns": 8600,
"grpc": -1,
"http": 8500,
"https": -1,
"serf_lan": 8301,
"serf_wan": 8302,
"server": 8300
},
"raft_protocol": 3,
"retry_interval": "30s",
"retry_interval_wan": "30s",
"retry_join": [
"10.77.56.107",
"10.77.56.161",
"10.77.56.151",
],
"retry_join_wan": [
],
"retry_max": 0,
"retry_max_wan": 0,
"server": false,
"syslog_facility": "local0",
"ui": false
}
Конфигурация сервера в режиме мульти-датацентр
{
"addresses": {
"dns": "0.0.0.0",
"grpc": "0.0.0.0",
"http": "0.0.0.0",
"https": "0.0.0.0"
},
"advertise_addr": "10.77.111.48",
"advertise_addr_wan": "10.77.111.48",
"bootstrap": false,
"client_addr": "127.0.0.1",
"data_dir": "/opt/consul",
"datacenter": "prod",
"disable_update_check": false,
"domain": "c.fin",
"enable_local_script_checks": false,
"enable_script_checks": false,
"enable_syslog": true,
"encrypt": "Khj2HjAaM6X6hufSJgYl/g==",
"log_level": "INFO",
"node_meta": {"env": "p"},
"performance": {
"leave_drain_time": "5s",
"raft_multiplier": 1,
"rpc_hold_timeout": "7s"
},
"ports": {
"dns": 8600,
"grpc": -1,
"http": 8500,
"https": -1,
"serf_lan": 8301,
"serf_wan": 8302,
"server": 8300
},
"raft_protocol": 3,
"retry_interval": "30s",
"retry_interval_wan": "30s",
"retry_join": [
"10.77.111.51",
"10.54.110.39",
"10.77.111.48",
],
"retry_join_wan": [
"10.77.56.107",
"10.77.56.161",
"10.77.56.151",
"10.77.111.48",
"10.54.110.39",
"10.77.111.51",
],
"retry_max": 0,
"retry_max_wan": 0,
"server": true,
"syslog_facility": "local0",
"ui": true
}
Резервное копирование и восстановление хранилища ключ-значение.
Создание резервной копии хранилища KV
# consul kv export > /tmp/kv.json
Загрузка копии хранилища KV
# cat /tmp/kv.json | consul kv import -
Очистка хранилища KV
# consul kv delete -recurse /