job "consul-cluster-simple" { datacenters = ["dc1"] type = "service" group "consul-master" { count = 1 constraint { attribute = "${node.unique.name}" value = "kr-master" } network { port "http" { static = 8500 } port "rpc" { static = 8300 } port "serf_lan" { static = 8301 } port "serf_wan" { static = 8302 } } task "consul" { driver = "exec" config { command = "consul" args = [ "agent", "-server", "-bootstrap-expect=3", "-data-dir=/opt/nomad/data/consul", "-client=0.0.0.0", "-bind=0.0.0.0", "-advertise=100.117.106.136", "-retry-join=100.116.80.94", "-retry-join=100.122.197.112", "-ui", "-http-port=${NOMAD_PORT_http}", "-server-port=${NOMAD_PORT_rpc}", "-serf-lan-port=${NOMAD_PORT_serf_lan}", "-serf-wan-port=${NOMAD_PORT_serf_wan}" ] } resources { cpu = 300 memory = 512 } } } group "consul-ash3c" { count = 1 constraint { attribute = "${node.unique.name}" value = "us-ash3c" } network { port "http" { static = 8500 } port "rpc" { static = 8300 } port "serf_lan" { static = 8301 } port "serf_wan" { static = 8302 } } task "consul" { driver = "exec" config { command = "consul" args = [ "agent", "-server", "-bootstrap-expect=3", "-data-dir=/opt/nomad/data/consul", "-client=0.0.0.0", "-bind=0.0.0.0", "-advertise=100.116.80.94", "-retry-join=100.117.106.136", "-retry-join=100.122.197.112", "-ui", "-http-port=${NOMAD_PORT_http}", "-server-port=${NOMAD_PORT_rpc}", "-serf-lan-port=${NOMAD_PORT_serf_lan}", "-serf-wan-port=${NOMAD_PORT_serf_wan}" ] } resources { cpu = 300 memory = 512 } } } group "consul-warden" { count = 1 constraint { attribute = "${node.unique.name}" value = "bj-warden" } network { port "http" { static = 8500 } port "rpc" { static = 8300 } port "serf_lan" { static = 8301 } port "serf_wan" { static = 8302 } } task "consul" { driver = "exec" config { command = "consul" args = [ "agent", "-server", "-bootstrap-expect=3", "-data-dir=/opt/nomad/data/consul", "-client=0.0.0.0", "-bind=100.122.197.112", "-advertise=100.122.197.112", "-retry-join=100.117.106.136", "-retry-join=100.116.80.94", "-ui", "-http-port=${NOMAD_PORT_http}", "-server-port=${NOMAD_PORT_rpc}", "-serf-lan-port=${NOMAD_PORT_serf_lan}", "-serf-wan-port=${NOMAD_PORT_serf_wan}" ] } resources { cpu = 300 memory = 512 } } } group "consul-semaphore" { count = 1 constraint { attribute = "${node.unique.name}" value = "semaphore" } network { port "http" { static = 8500 } port "rpc" { static = 8300 } port "serf_lan" { static = 8301 } port "serf_wan" { static = 8302 } } task "consul" { driver = "exec" config { command = "consul" args = [ "agent", "-server", "-bootstrap-expect=3", "-data-dir=/opt/nomad/data/consul", "-client=0.0.0.0", "-bind=100.116.158.95", "-advertise=100.116.158.95", "-retry-join=100.117.106.136", "-retry-join=100.116.80.94", "-retry-join=100.122.197.112", "-ui", "-http-port=${NOMAD_PORT_http}", "-server-port=${NOMAD_PORT_rpc}", "-serf-lan-port=${NOMAD_PORT_serf_lan}", "-serf-wan-port=${NOMAD_PORT_serf_wan}" ] } resources { cpu = 300 memory = 512 } } } }