Skip to content

Instantly share code, notes, and snippets.

@stolsma
Forked from rossedman/consul.service
Created July 24, 2017 19:30
Show Gist options
  • Select an option

  • Save stolsma/1eba81d63fed92d100d3bd5224a6e229 to your computer and use it in GitHub Desktop.

Select an option

Save stolsma/1eba81d63fed92d100d3bd5224a6e229 to your computer and use it in GitHub Desktop.

Revisions

  1. @rossedman rossedman revised this gist Apr 8, 2016. 3 changed files with 18 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions consul.service
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,8 @@
    #
    # This needs to be installed here:
    # /etc/systemd/system/consul.service
    #

    [Unit]
    Description=consul
    Requires=network-online.target
    7 changes: 7 additions & 0 deletions leader.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    {
    "bootstrap": true,
    "data_dir": "/opt/consul",
    "node_name": "CON01",
    "server": true,
    "ui": true
    }
    6 changes: 6 additions & 0 deletions server.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    {
    "data_dir": "/opt/consul",
    "node_name": "CON02",
    "server": true,
    "start_join": "IP.OF.LEADER"
    }
  2. @rossedman rossedman revised this gist Apr 8, 2016. 1 changed file with 4 additions and 5 deletions.
    9 changes: 4 additions & 5 deletions consul.service
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,14 @@
    [Unit]
    Description=consul agent
    Description=consul
    Requires=network-online.target
    After=network-online.target

    [Service]
    EnvironmentFile=-/etc/sysconfig/consul
    Environment=GOMAXPROCS=2
    Environment="GOMAXPROCS=2" "PATH=/usr/local/bin:/usr/bin:/bin"
    Restart=on-failure
    ExecStart=/usr/local/sbin/consul agent $OPTIONS -config-dir=/etc/consul.d
    ExecStart=/usr/local/bin/consul agent -config-file=/etc/consul/consul.json -config-dir=/etc/consul/conf.d
    ExecReload=/bin/kill -HUP $MAINPID
    KillSignal=SIGINT
    KillSignal=TERM

    [Install]
    WantedBy=multi-user.target
  3. @yunano yunano created this gist May 1, 2015.
    15 changes: 15 additions & 0 deletions consul.service
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    [Unit]
    Description=consul agent
    Requires=network-online.target
    After=network-online.target

    [Service]
    EnvironmentFile=-/etc/sysconfig/consul
    Environment=GOMAXPROCS=2
    Restart=on-failure
    ExecStart=/usr/local/sbin/consul agent $OPTIONS -config-dir=/etc/consul.d
    ExecReload=/bin/kill -HUP $MAINPID
    KillSignal=SIGINT

    [Install]
    WantedBy=multi-user.target