diff --git a/client/config/config.go b/client/config/config.go index db4d8233c75..ed98bdc63c5 100644 --- a/client/config/config.go +++ b/client/config/config.go @@ -210,6 +210,7 @@ func DefaultConfig() *Config { GCDiskUsageThreshold: 80, GCInodeUsageThreshold: 70, GCMaxAllocs: 50, + NoHostUUID: true, } } diff --git a/command/agent/config-test-fixtures/basic.hcl b/command/agent/config-test-fixtures/basic.hcl index 006a4340c2c..8347dc4c659 100644 --- a/command/agent/config-test-fixtures/basic.hcl +++ b/command/agent/config-test-fixtures/basic.hcl @@ -59,7 +59,7 @@ client { gc_disk_usage_threshold = 82 gc_inode_usage_threshold = 91 gc_max_allocs = 50 - no_host_uuid = true + no_host_uuid = false } server { enabled = true diff --git a/command/agent/config.go b/command/agent/config.go index 83f80f3ae89..5d94be26834 100644 --- a/command/agent/config.go +++ b/command/agent/config.go @@ -543,6 +543,7 @@ func DefaultConfig() *Config { GCDiskUsageThreshold: 80, GCInodeUsageThreshold: 70, GCMaxAllocs: 50, + NoHostUUID: true, }, Server: &ServerConfig{ Enabled: false, @@ -995,7 +996,8 @@ func (a *ClientConfig) Merge(b *ClientConfig) *ClientConfig { if b.GCMaxAllocs != 0 { result.GCMaxAllocs = b.GCMaxAllocs } - if b.NoHostUUID { + // NoHostUUID defaults to true, merge if false + if !b.NoHostUUID { result.NoHostUUID = b.NoHostUUID } diff --git a/command/agent/config_parse_test.go b/command/agent/config_parse_test.go index adff7035b72..457c8e5f5ff 100644 --- a/command/agent/config_parse_test.go +++ b/command/agent/config_parse_test.go @@ -78,7 +78,7 @@ func TestConfig_Parse(t *testing.T) { GCDiskUsageThreshold: 82, GCInodeUsageThreshold: 91, GCMaxAllocs: 50, - NoHostUUID: true, + NoHostUUID: false, }, Server: &ServerConfig{ Enabled: true, diff --git a/demo/vagrant/client1.hcl b/demo/vagrant/client1.hcl index 416c4d4ce83..24083ee3f46 100644 --- a/demo/vagrant/client1.hcl +++ b/demo/vagrant/client1.hcl @@ -23,7 +23,6 @@ client { reserved { cpu = 500 } - no_host_uuid = true } # Modify our port to avoid a collision with server1 diff --git a/demo/vagrant/client2.hcl b/demo/vagrant/client2.hcl index 7ef3da1bade..31b74ad1df2 100644 --- a/demo/vagrant/client2.hcl +++ b/demo/vagrant/client2.hcl @@ -7,7 +7,6 @@ data_dir = "/tmp/client2" # Enable the client client { enabled = true - no_host_uuid = true # For demo assume we are talking to server1. For production, # this should be like "nomad.service.consul:4647" and a system @@ -18,7 +17,6 @@ client { meta { ssd = "true" } - no_host_uuid = true } # Modify our port to avoid a collision with server1 and client1 diff --git a/website/source/docs/agent/configuration/client.html.md b/website/source/docs/agent/configuration/client.html.md index 16b6afb2402..adac303fbcb 100644 --- a/website/source/docs/agent/configuration/client.html.md +++ b/website/source/docs/agent/configuration/client.html.md @@ -110,8 +110,9 @@ client { parallel destroys allowed by the garbage collector. This value should be relatively low to avoid high resource usage during garbage collections. -- `no_host_uuid` `(bool: false)` - Force the UUID generated by the client to be - randomly generated and not be based on the host's UUID. +- `no_host_uuid` `(bool: true)` - By default a random node UUID will be + generated, but setting this to `false` will use the system's UUID. Before + Nomad 0.6 the default was to use the system UUID. ### `chroot_env` Parameters diff --git a/website/source/intro/getting-started/cluster.html.md b/website/source/intro/getting-started/cluster.html.md index 6affed4e9b2..072bcc91479 100644 --- a/website/source/intro/getting-started/cluster.html.md +++ b/website/source/intro/getting-started/cluster.html.md @@ -98,11 +98,6 @@ client { # this should be like "nomad.service.consul:4647" and a system # like Consul used for service discovery. servers = ["127.0.0.1:4647"] - - # Since we are starting two clients on the same host, we need to set - # this in order to force nomad to generate client UUIDs randomly, - # instead of based on the host UUID. - no_host_uuid = true } # Modify our port to avoid a collision with server1