Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Создал дефолтный job
- andrew@monster:~/atuko/cluster$ nomad init
- Example job file written to example.nomad
- Поправил update
- update {
- max_parallel = 1
- min_healthy_time = "10s"
- healthy_deadline = "3m"
- auto_revert = true
- canary = 1
- }
- Запустил
- andrew@monster:~/atuko/cluster$ nomad run example.nomad
- ==> Monitoring evaluation "9d93d6b3"
- Evaluation triggered by job "example"
- Allocation "0bd15c0d" created: node "6b9acd5a", group "cache"
- Evaluation within deployment: "476d5a8d"
- Evaluation status changed: "pending" -> "complete"
- ==> Evaluation "9d93d6b3" finished with status "complete"
- andrew@monster:~/atuko/cluster$ nomad status example
- ID = example
- Name = example
- Submit Date = 01/23/18 20:39:53 MSK
- Type = service
- Priority = 50
- Datacenters = dc1
- Status = running
- Periodic = false
- Parameterized = false
- Summary
- Task Group Queued Starting Running Failed Complete Lost
- cache 0 0 1 0 0 0
- Latest Deployment
- ID = 476d5a8d
- Status = running
- Description = Deployment is running
- Deployed
- Task Group Auto Revert Desired Placed Healthy Unhealthy
- cache true 1 1 0 0
- Allocations
- ID Node ID Task Group Version Desired Status Created Modified
- 0bd15c0d 6b9acd5a cache 0 run running 15s ago 2s ago
- В consul сервис зарегался
- andrew@monster:~/atuko/cluster$ consul catalog services
- consul
- global-redis-check
- nomad
- nomad-client
- andrew@monster:~/atuko/cluster$ dig @127.0.0.1 -p 8600 global-redis-check.service.consul. SRV
- ;; ANSWER SECTION:
- global-redis-check.service.consul. 0 IN SRV 1 1 21471 monster.node.dc1.consul.
- ;; ADDITIONAL SECTION:
- monster.node.dc1.consul. 0 IN A 127.0.0.1
- monster.node.dc1.consul. 0 IN TXT "consul-network-segment="
- Поменял image
- andrew@monster:~/atuko/cluster$ nomad plan example.nomad
- +/- Job: "example"
- +/- Task Group: "cache" (1 canary, 1 ignore)
- +/- Task: "redis" (forces create/destroy update)
- +/- Config {
- +/- image: "redis:3.2" => "redis:4.0"
- port_map[0][db]: "6379"
- }
- Scheduler dry-run:
- - All tasks successfully allocated.
- Job Modify Index: 11
- To submit the job with version verification run:
- nomad run -check-index 11 example.nomad
- Запустил
- andrew@monster:~/atuko/cluster$ nomad run -check-index 11 example.nomad
- ==> Monitoring evaluation "10591c5d"
- Evaluation triggered by job "example"
- Allocation "a492b4d2" created: node "6b9acd5a", group "cache"
- Evaluation within deployment: "69006ac8"
- Evaluation status changed: "pending" -> "complete"
- ==> Evaluation "10591c5d" finished with status "complete"
- andrew@monster:~/atuko/cluster$ nomad status example
- ID = example
- Name = example
- Submit Date = 01/23/18 20:42:24 MSK
- Type = service
- Priority = 50
- Datacenters = dc1
- Status = running
- Periodic = false
- Parameterized = false
- Summary
- Task Group Queued Starting Running Failed Complete Lost
- cache 0 0 2 0 0 0
- Latest Deployment
- ID = 69006ac8
- Status = running
- Description = Deployment is running but requires promotion
- Deployed
- Task Group Auto Revert Promoted Desired Canaries Placed Healthy Unhealthy
- cache true false 1 1 1 0 0
- Allocations
- ID Node ID Task Group Version Desired Status Created Modified
- a492b4d2 6b9acd5a cache 1 run running 17s ago 12s ago
- 0bd15c0d 6b9acd5a cache 0 run running 2m48s ago 2m22s ago
- В consul появилась вторая запись
- andrew@monster:~/atuko/cluster$ dig @127.0.0.1 -p 8600 global-redis-check.service.consul. SRV
- ;; ANSWER SECTION:
- global-redis-check.service.consul. 0 IN SRV 1 1 21471 monster.node.dc1.consul.
- global-redis-check.service.consul. 0 IN SRV 1 1 22312 monster.node.dc1.consul.
- ;; ADDITIONAL SECTION:
- monster.node.dc1.consul. 0 IN A 127.0.0.1
- monster.node.dc1.consul. 0 IN TXT "consul-network-segment="
- monster.node.dc1.consul. 0 IN A 127.0.0.1
- monster.node.dc1.consul. 0 IN TXT "consul-network-segment="
- Фэйлю последний деплоймент
- andrew@monster:~/atuko/cluster$ nomad deployment fail 69006ac8
- Deployment "69006ac8-ed65-369d-1405-2918d494a948" failed. Auto-reverted to job version 0.
- ==> Monitoring evaluation "88eec8d4"
- Evaluation triggered by job "example"
- Evaluation within deployment: "69006ac8"
- Allocation "0bd15c0d" modified: node "6b9acd5a", group "cache"
- Evaluation status changed: "pending" -> "complete"
- ==> Evaluation "88eec8d4" finished with status "complete"
- andrew@monster:~/atuko/cluster$ nomad status example
- ID = example
- Name = example
- Submit Date = 01/23/18 20:39:53 MSK
- Type = service
- Priority = 50
- Datacenters = dc1
- Status = running
- Periodic = false
- Parameterized = false
- Summary
- Task Group Queued Starting Running Failed Complete Lost
- cache 0 0 1 0 1 0
- Latest Deployment
- ID = 7df5508d
- Status = successful
- Description = Deployment completed successfully
- Deployed
- Task Group Auto Revert Desired Placed Healthy Unhealthy
- cache true 1 1 1 0
- Allocations
- ID Node ID Task Group Version Desired Status Created Modified
- a492b4d2 6b9acd5a cache 1 stop complete 17m31s ago 39s ago
- 0bd15c0d 6b9acd5a cache 2 run running 20m2s ago 29s ago
- и в consul остаётся одна запись
- andrew@monster:~/atuko/cluster$ dig @127.0.0.1 -p 8600 global-redis-check.service.consul. SRV
- ;; ANSWER SECTION:
- global-redis-check.service.consul. 0 IN SRV 1 1 21471 monster.node.dc1.consul.
- ;; ADDITIONAL SECTION:
- monster.node.dc1.consul. 0 IN A 127.0.0.1
- monster.node.dc1.consul. 0 IN TXT "consul-network-segment="
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement