config 配置

https://www.consul.io/docs/agent/config/config-files

单机

node_name = "s1"
server    = true
bootstrap = true
ui_config {
  enabled = true
}
datacenter = "dc1"
data_dir   = "/Volumes/SAO/data/consul/data"
log_level  = "INFO"
# 有多ip时需要指定
bind_addr = "127.0.0.1"
connect {
  enabled = true
}

启动命令

consul agent -config-file=/Volumes/SAO/data/consul/conf/config.hcl -server

集群


补充

跨域

http_config {
  response_headers {
    Access-Control-Allow-Origin = "*"
  }
}

停机

consul leave

安全

https://learn.hashicorp.com/tutorials/consul/access-control-setup-production#bootstrap-the-acl-system