job "haproxy-nomad" {
region = "global"
datacenters = ["aws-eu-west-1"]
type = "service"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
update {
stagger = "10s"
max_parallel = 1
}
group "haproxy-dev" {
count = 1
restart {
interval = "1m"
attempts = 2
delay = "15s"
mode = "delay"
}
task "haproxy" {
driver = "docker"
config {
image = "example.com:5000/haproxy-rhel:0.1"
command = "/usr/bin/supervisord"
hostname = "haproxy-nomad"
}
service {
name = "haproxy"
tags = ["global","haproxy"]
port = "http_haproxy"
check {
name = "tss alive"
type = "tcp"
interval = "10s"
timeout = "2s"
}
check {
name = "haproxy running on port 34180"
interval = "10s"
timeout = "5s"
type = "http"
protocol = "http"
path = "/haproxy_status"
}
}
resources {
cpu = 500 # Mhz
memory = 512 # MB
network {
mbits = 100
port "http_haproxy" {
static = 8001
}
port "http_elb" {
static = 34180
}
}
}
}
}
}{
"server": false,
"datacenter": "aws-eu-west-1",
"data_dir": "/var/consul",
"ui": true,
"encrypt": "ZeOmrAz/m9s1N6NPqFvbLQ==",
"ca_file": "/etc/consul.d/ssl/ca.cert",
"cert_file": "/etc/consul.d/ssl/consul.cert",
"key_file": "/etc/consul.d/ssl/consul.key",
"verify_incoming": true,
"verify_outgoing": true,
"log_level": "INFO",
"enable_syslog": true,
"start_join": ["192.168.15.101","192.168.15.102","192.168.15.103"]
}bind_addr = "192.168.11.20"
log_level = "INFO"
datacenter = "aws-eu-west-1"
data_dir = "/var/nomad"
client {
enabled = true
network_interface = "eth0"
servers = ["192.168.15.101:4647","192.168.15.102:4647","192.168.15.103:4647"]
options {
consul.address = "192.168.11.20:8500"
consul.token = "ZeOmrAz/m9s1N6NPqFvbLQ=="
consul.auth = "token"
consul.ssl = true
consul.verifyssl = true
docker.auth.config = "/root/.docker/config.json"
docker.cleanup.image = false
}
}--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/nomad/issues
IRC: #nomad-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Nomad" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nomad-tool+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nomad-tool/a261ae64-7111-4b78-be66-54e569c891f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[INFO] consul: registering service haproxy with consul.
[DEBUG] consul: error while registering service haproxy with consul: Put https://192.168.11.20:8500/v1/agent/service/register?token=ZeOmrAz%2Fm9s1N6NPqFvb
LQ%3D%3D: http: server gave HTTP response to HTTPS client
[INFO] consul: registering check with ID: da2508106a07129a36662cf2aabeb7e489c89c4c for service: nomad-registered-service-0f12500b-fa9d-b945-4cc4-befc63578
e77
[DEBUG] consul: error while registering check tss alive with consul: Put https://192.168.11.20:8500/v1/agent/check/register?token=ZeOmrAz%2Fm9s1N6NPqFvbLQ
%3D%3D: http: server gave HTTP response to HTTPS client
[INFO] consul: registering check with ID: cf2114426748efaaf2dd97c7ad0f1fda972cb8c0 for service: nomad-registered-service-0f12500b-fa9d-b945-4cc4-befc63578
e77
[DEBUG] consul: error while registering check haproxy running on port 34180 with consul: Put https://192.168.11.20:8500/v1/agent/check/register?token=ZeOm
rAz%2Fm9s1N6NPqFvbLQ%3D%3D: http: server gave HTTP response to HTTPS clientI've tried to figure it out myself.
I've updated consul configuration file adding HTTPS address and port.
"addresses": {
"https": "0.0.0.0"
},
"ports": {
"https": 8800
},
I've updated consul's port in nomad's configuration file as well.
Now there are no errors, but services are still not registered.
[INFO] consul: registering service haproxy with consul.
[INFO] driver.docker: created container fdbfd6392581776586433ed5bf2c17399cd04a63e8affc5cc4d6664c0a894519
[DEBUG] client: updated allocations at index 7678 (pulled 0) (filtered 18)
[DEBUG] client: allocs: (added 0) (removed 0) (updated 0) (ignore 18)
[INFO] driver.docker: started container fdbfd6392581776586433ed5bf2c17399cd04a63e8affc5cc4d6664c0a894519
Thanks,
Vladimir
bind_addr = "192.168.11.20"# Increase log verbositylog_level = "DEBUG"datacenter = "aws-eu-west-1"# Setup data dirdata_dir = "/var/nomad"# Enable the clientclient { enabled = true network_interface = "eth0" options { consul.addddress = "192.168.11.20:22" consul.token = "ZeOmrAz/m9s1N6NPqFvbLQ==" consul.auth = "token" consul.ssl = true consul.verifyssl = true docker.auth.config = "/root/.docker/config.json" docker.cleanup.image = false }}--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/nomad/issues
IRC: #nomad-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Nomad" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nomad-tool+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nomad-tool/f8347fcf-50fd-41a5-ae2f-ec10721853f6%40googlegroups.com.