Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checks_use_advertise is ignored for http checks #2324

Closed
jens-solarisbank opened this issue Feb 16, 2017 · 4 comments
Closed

checks_use_advertise is ignored for http checks #2324

jens-solarisbank opened this issue Feb 16, 2017 · 4 comments

Comments

@jens-solarisbank
Copy link
Contributor

When I set the consul parameter checks_use_advertise in the client or server config to true, http checks still use the bind address (0.0.0.0), and /v1/agent/self reports checks_use_advertise as false

Nomad version

Nomad v0.5.4

Operating system and Environment details

Ubuntu 16.04.1 LTS in vagrant

Issue

When I set the consul parameter checks_use_advertise in the client or server config to true, http checks still use the bind address (0.0.0.0), and /v1/agent/self reports checks_use_advertise as false.
Somebody else apparently also has the same problem: #1988 (comment)

Reproduction steps

I use this server.hcl:

log_level = "DEBUG"
data_dir = "/tmp/data"

advertise {
  http = "33.33.33.33"
  rpc  = "33.33.33.33"
  serf = "33.33.33.33"
}

server {
  enabled = true
  bootstrap_expect = 1
}

consul {
    address = "consul-node0:8500"
    checks_use_advertise = true
}

Output of curl 33.33.33.33:4646/v1/agent/self |jq .:

{
  "config": {
    "Addresses": {
      "HTTP": "0.0.0.0",
      "RPC": "0.0.0.0",
      "Serf": "0.0.0.0"
    },
    "AdvertiseAddrs": {
      "HTTP": "33.33.33.33:4646",
      "RPC": "33.33.33.33:4647",
      "Serf": "33.33.33.33:4648"
    },
    "Atlas": {
      "Endpoint": "",
      "Infrastructure": "",
      "Join": false
    },
    "BindAddr": "0.0.0.0",
    "Client": {
      "AllocDir": "",
      "ChrootEnv": {},
      "ClientMaxPort": 14512,
      "ClientMinPort": 14000,
      "Enabled": false,
      "GCDiskUsageThreshold": 80,
      "GCInodeUsageThreshold": 70,
      "GCInterval": 60000000000,
      "MaxKillTimeout": "30s",
      "Meta": {},
      "NetworkInterface": "",
      "NetworkSpeed": 0,
      "NodeClass": "",
      "Options": {},
      "Reserved": {
        "CPU": 0,
        "DiskMB": 0,
        "IOPS": 0,
        "MemoryMB": 0,
        "ParsedReservedPorts": null,
        "ReservedPorts": ""
      },
      "Servers": null,
      "StateDir": ""
    },
    "Consul": {
      "Addr": "consul-node0:8500",
      "Auth": "",
      "AutoAdvertise": true,
      "CAFile": "",
      "CertFile": "",
      "ChecksUseAdvertise": false,
      "ClientAutoJoin": true,
      "ClientServiceName": "nomad-client",
      "EnableSSL": false,
      "KeyFile": "",
      "ServerAutoJoin": true,
      "ServerServiceName": "nomad",
      "Timeout": 5000000000,
      "Token": "",
      "VerifySSL": false
    },
    "DataDir": "/tmp/data",
    "Datacenter": "dc1",
    "DevMode": false,
    "DisableAnonymousSignature": false,
    "DisableUpdateCheck": false,
    "EnableDebug": false,
    "EnableSyslog": false,
    "Files": [
      "/home/jens/server.hcl"
    ],
    "HTTPAPIResponseHeaders": {},
    "LeaveOnInt": false,
    "LeaveOnTerm": false,
    "LogLevel": "DEBUG",
    "NodeName": "",
    "Ports": {
      "HTTP": 4646,
      "RPC": 4647,
      "Serf": 4648
    },
    "Region": "global",
    "Revision": "da97ad4dddff52d7d8d2a2cc81aa73b64558cf50",
    "Server": {
      "BootstrapExpect": 1,
      "DataDir": "",
      "Enabled": true,
      "EnabledSchedulers": null,
      "HeartbeatGrace": "",
      "NodeGCThreshold": "",
      "NumSchedulers": 0,
      "ProtocolVersion": 0,
      "RejoinAfterLeave": false,
      "RetryInterval": "30s",
      "RetryJoin": [],
      "RetryMaxAttempts": 0,
      "StartJoin": []
    },
    "SyslogFacility": "LOCAL0",
    "TLSConfig": {
      "CAFile": "",
      "CertFile": "",
      "EnableHTTP": false,
      "EnableRPC": false,
      "KeyFile": "",
      "VerifyServerHostname": false
    },
    "Telemetry": {
      "CirconusAPIApp": "",
      "CirconusAPIToken": "",
      "CirconusAPIURL": "",
      "CirconusBrokerID": "",
      "CirconusBrokerSelectTag": "",
      "CirconusCheckDisplayName": "",
      "CirconusCheckForceMetricActivation": "",
      "CirconusCheckID": "",
      "CirconusCheckInstanceID": "",
      "CirconusCheckSearchTag": "",
      "CirconusCheckSubmissionURL": "",
      "CirconusCheckTags": "",
      "CirconusSubmissionInterval": "",
      "CollectionInterval": "1s",
      "DataDogAddr": "",
      "DisableHostname": false,
      "PublishAllocationMetrics": false,
      "PublishNodeMetrics": false,
      "StatsdAddr": "",
      "StatsiteAddr": "",
      "UseNodeName": false
    },
    "Vault": {
      "Addr": "https://vault.service.consul:8200",
      "AllowUnauthenticated": true,
      "ConnectionRetryIntv": 30000000000,
      "Enabled": null,
      "Role": "",
      "TLSCaFile": "",
      "TLSCaPath": "",
      "TLSCertFile": "",
      "TLSKeyFile": "",
      "TLSServerName": "",
      "TLSSkipVerify": null,
      "TaskTokenTTL": "",
      "Token": ""
    },
    "Version": "0.5.4",
    "VersionPrerelease": ""
  },
  "member": {
    "Addr": "33.33.33.33",
    "DelegateCur": 4,
    "DelegateMax": 4,
    "DelegateMin": 2,
    "Name": "hostname.global",
    "Port": 4648,
    "ProtocolCur": 2,
    "ProtocolMax": 4,
    "ProtocolMin": 1,
    "Status": "alive",
    "Tags": {
      "dc": "dc1",
      "vsn": "1",
      "mvn": "1",
      "build": "0.5.4",
      "port": "4647",
      "bootstrap": "1",
      "role": "nomad",
      "region": "global"
    }
  },
  "stats": {
    "nomad": {
      "server": "true",
      "leader": "true",
      "leader_addr": "33.33.33.33:4647",
      "bootstrap": "true",
      "known_regions": "1"
    },
    "raft": {
      "last_contact": "never",
      "raft_peers": "33.33.33.33:4647",
      "term": "1",
      "last_log_index": "3",
      "last_log_term": "1",
      "commit_index": "3",
      "last_snapshot_index": "0",
      "last_snapshot_term": "0",
      "state": "Leader",
      "applied_index": "3",
      "fsm_pending": "0",
      "num_peers": "0"
    },
    "serf": {
      "query_time": "1",
      "intent_queue": "0",
      "event_queue": "0",
      "members": "1",
      "left": "0",
      "health_score": "0",
      "member_time": "1",
      "failed": "0",
      "event_time": "1",
      "query_queue": "0",
      "encrypted": "false"
    },
    "runtime": {
      "kernel.name": "linux",
      "arch": "amd64",
      "version": "go1.7.5",
      "max_procs": "2",
      "goroutines": "52",
      "cpu_count": "2"
    }
  }
}
@jens-solarisbank
Copy link
Contributor Author

It is working with the current master though:

curl 33.33.33.33:4646/v1/agent/self |jq .

{
  "config": {
    "Addresses": {
      "HTTP": "0.0.0.0",
      "RPC": "0.0.0.0",
      "Serf": "0.0.0.0"
    },
    "AdvertiseAddrs": {
      "HTTP": "33.33.33.33:4646",
      "RPC": "33.33.33.33:4647",
      "Serf": "33.33.33.33:4648"
    },
    "Atlas": {
      "Endpoint": "",
      "Infrastructure": "",
      "Join": false
    },
    "BindAddr": "0.0.0.0",
    "Client": {
      "AllocDir": "",
      "ChrootEnv": {},
      "ClientMaxPort": 14512,
      "ClientMinPort": 14000,
      "Enabled": false,
      "GCDiskUsageThreshold": 80,
      "GCInodeUsageThreshold": 70,
      "GCInterval": 60000000000,
      "MaxKillTimeout": "30s",
      "Meta": {},
      "NetworkInterface": "",
      "NetworkSpeed": 0,
      "NodeClass": "",
      "Options": {},
      "Reserved": {
        "CPU": 0,
        "DiskMB": 0,
        "IOPS": 0,
        "MemoryMB": 0,
        "ParsedReservedPorts": null,
        "ReservedPorts": ""
      },
      "Servers": null,
      "StateDir": ""
    },
    "Consul": {
      "Addr": "consul-node0:8500",
      "Auth": "",
      "AutoAdvertise": true,
      "CAFile": "",
      "CertFile": "",
      "ChecksUseAdvertise": true,
      "ClientAutoJoin": true,
      "ClientServiceName": "nomad-client",
      "EnableSSL": false,
      "KeyFile": "",
      "ServerAutoJoin": true,
      "ServerServiceName": "nomad",
      "Timeout": 5000000000,
      "Token": "",
      "VerifySSL": false
    },
    "DataDir": "/tmp/data",
    "Datacenter": "dc1",
    "DevMode": false,
    "DisableAnonymousSignature": false,
    "DisableUpdateCheck": false,
    "EnableDebug": false,
    "EnableSyslog": false,
    "Files": [
      "server.hcl"
    ],
    "HTTPAPIResponseHeaders": {},
    "LeaveOnInt": false,
    "LeaveOnTerm": false,
    "LogLevel": "DEBUG",
    "NodeName": "",
    "Ports": {
      "HTTP": 4646,
      "RPC": 4647,
      "Serf": 4648
    },
    "Region": "global",
    "Revision": "",
    "Server": {
      "BootstrapExpect": 1,
      "DataDir": "",
      "Enabled": true,
      "EnabledSchedulers": null,
      "HeartbeatGrace": "",
      "NodeGCThreshold": "",
      "NumSchedulers": 0,
      "ProtocolVersion": 0,
      "RejoinAfterLeave": false,
      "RetryInterval": "30s",
      "RetryJoin": [],
      "RetryMaxAttempts": 0,
      "StartJoin": []
    },
    "SyslogFacility": "LOCAL0",
    "TLSConfig": {
      "CAFile": "",
      "CertFile": "",
      "EnableHTTP": false,
      "EnableRPC": false,
      "KeyFile": "",
      "VerifyServerHostname": false
    },
    "Telemetry": {
      "CirconusAPIApp": "",
      "CirconusAPIToken": "",
      "CirconusAPIURL": "",
      "CirconusBrokerID": "",
      "CirconusBrokerSelectTag": "",
      "CirconusCheckDisplayName": "",
      "CirconusCheckForceMetricActivation": "",
      "CirconusCheckID": "",
      "CirconusCheckInstanceID": "",
      "CirconusCheckSearchTag": "",
      "CirconusCheckSubmissionURL": "",
      "CirconusCheckTags": "",
      "CirconusSubmissionInterval": "",
      "CollectionInterval": "1s",
      "DataDogAddr": "",
      "DisableHostname": false,
      "PublishAllocationMetrics": false,
      "PublishNodeMetrics": false,
      "StatsdAddr": "",
      "StatsiteAddr": "",
      "UseNodeName": false
    },
    "Vault": {
      "Addr": "https://vault.service.consul:8200",
      "AllowUnauthenticated": true,
      "ConnectionRetryIntv": 30000000000,
      "Enabled": null,
      "Role": "",
      "TLSCaFile": "",
      "TLSCaPath": "",
      "TLSCertFile": "",
      "TLSKeyFile": "",
      "TLSServerName": "",
      "TLSSkipVerify": null,
      "TaskTokenTTL": "",
      "Token": ""
    },
    "Version": "0.5.5",
    "VersionPrerelease": "dev"
  },
  "member": {
    "Addr": "33.33.33.33",
    "DelegateCur": 4,
    "DelegateMax": 4,
    "DelegateMin": 2,
    "Name": "hostname.global",
    "Port": 4648,
    "ProtocolCur": 2,
    "ProtocolMax": 5,
    "ProtocolMin": 1,
    "Status": "alive",
    "Tags": {
      "mvn": "1",
      "build": "0.5.5dev",
      "port": "4647",
      "bootstrap": "1",
      "role": "nomad",
      "region": "global",
      "dc": "dc1",
      "vsn": "1"
    }
  },
  "stats": {
    "raft": {
      "state": "Leader",
      "last_snapshot_term": "0",
      "protocol_version_min": "0",
      "snapshot_version_min": "0",
      "latest_configuration_index": "1",
      "num_peers": "0",
      "fsm_pending": "0",
      "protocol_version": "1",
      "last_contact": "never",
      "term": "2",
      "last_log_index": "7",
      "last_log_term": "2",
      "applied_index": "7",
      "protocol_version_max": "3",
      "snapshot_version_max": "1",
      "latest_configuration": "[{Suffrage:Voter ID:33.33.33.33:4647 Address:33.33.33.33:4647}]",
      "commit_index": "7",
      "last_snapshot_index": "0"
    },
    "serf": {
      "members": "1",
      "failed": "0",
      "left": "0",
      "query_time": "1",
      "encrypted": "false",
      "query_queue": "0",
      "health_score": "0",
      "member_time": "1",
      "event_time": "1",
      "intent_queue": "0",
      "event_queue": "0"
    },
    "runtime": {
      "goroutines": "53",
      "cpu_count": "2",
      "kernel.name": "linux",
      "arch": "amd64",
      "version": "go1.7.1",
      "max_procs": "2"
    },
    "nomad": {
      "server": "true",
      "leader": "true",
      "leader_addr": "33.33.33.33:4647",
      "bootstrap": "true",
      "known_regions": "1"
    }
  }
}

But this still means that checks_use_advertise is not working on version 0.5.4. Maybe the documentation should be adjusted.

Btw, I guess this commit is fixing the problem: d212d40

@dadgar
Copy link
Contributor

dadgar commented Feb 21, 2017

Yeah sorry about that. 0.5.5 should be out rather soon!

@dadgar dadgar closed this as completed Feb 21, 2017
@nugend
Copy link

nugend commented Feb 24, 2017

So, assuming 0.5.5 is out, does this mean that the default configuration values will always cause the HTTP health check to fail? (since checks_use_advertise is set to false?)

edit: Nope. I clearly misunderstood something. Sorry!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants