consul service

{
      "name": "consul-agent (host:{{ .MONITOR_CONSUL }})",
      "command": ["/usr/local/bin/consul", "agent",
                  "-data-dir=/data2",
                  "-config-dir=/config2",
                  "-rejoin",
                  "-retry-join", "{{ .MONITOR_CONSUL }}",
                  "-retry-max", "10",
                  "-retry-interval", "10s",
                  "-config-file=/config2/default.json"],
      "restarts": "unlimited"
    }

===================

root@4e0e17fc6fa0:/data2# cd /config2            
root@4e0e17fc6fa0:/config2# ls
default.json  exporter.json
root@4e0e17fc6fa0:/config2# cat exporter.json
{
  "service":
  {
    "name": "mysql-exporter",
    "port":9104
  }
}

原文地址:https://www.cnblogs.com/mhc-fly/p/7263448.html