Skip to content

Instantly share code, notes, and snippets.

@zhouyl
Created October 22, 2018 10:31
Show Gist options
  • Save zhouyl/4303fce12ac628bc61d8e019b7dc9842 to your computer and use it in GitHub Desktop.
Save zhouyl/4303fce12ac628bc61d8e019b7dc9842 to your computer and use it in GitHub Desktop.
consul configration in local
{
"datacenter": "oms-java",
"data_dir": "/data/consul/data/",
"pid_file": "/data/consul/consul.pid",
"log_file": "/data/consul/logs/",
"log_rotate_bytes": 500000000,
"log_level": "INFO",
"node_name": "node1",
"server": true,
"bootstrap": true,
"ui": true,
"client_addr": "0.0.0.0",
"ports": {
"server": 8300,
"http": 8500,
"https": 8501,
"grpc": 8502,
"dns": 8600
}
}
[Unit]
Description=consul agent
Requires=network-online.target
After=network-online.target
[Service]
Restart=on-failure
ExecStart=/usr/local/bin/consul agent -config-file=/data/consul/conf/consul.conf -config-format=json
ExecReload=/bin/kill -HUP $MAINPID
ExecStop=/bin/kill -INT $MAINPID
[Install]
WantedBy=multi-user.target
Alias=consul.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment