title | date | draft | tags | menu | |||||
---|---|---|---|---|---|---|---|---|---|
Manually Unfederating a Nomad Cluster using a Network Partition |
2017-12-07 12:49:20 -0500 |
false |
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import requests | |
import sys | |
URL_BASE = "http://127.0.0.1:4646" | |
URL_API_PATH = "/v1/event/stream" | |
URL_QUERY_STRING = "" | |
#URL.QUERY_STRING = "?topic=Node:*" | |
url = URL_BASE + URL_API_PATH + URL_QUERY_STRING |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen {{ env "PORT" }}; | |
server_name {{ env "DOMAIN" }}; | |
location / { | |
proxy_pass http://{{ env "UPSTREAM" }}; | |
} | |
} |
Create a configuration file and a sample job.
docker.hcl
plugin "docker" {
config {
volumes {
enabled = true
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
job "example" { | |
datacenters = ["dc1"] | |
group "cache" { | |
task "redis" { | |
driver = "docker" | |
config { | |
image = "redis:3.2" | |
mac_address = "A0:97:FA:13:93:03" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
job "fabio" { | |
datacenters = ["dc1"] | |
type = "system" | |
update { | |
stagger = "5s" | |
max_parallel = 1 | |
} | |
group "linux-amd64" { | |
task "fabio" { | |
constraint { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM microsoft/nanoserver | |
ENV HTTP_ECHO_DOWNLOAD_URL "https://github.com/hashicorp/http-echo/releases/download/v0.2.3/http-echo_0.2.3_windows_amd64.zip" | |
ENV HTTP_ECHO_PORT 8080 | |
ENV HTTP_ECHO_STRING "Hello World" | |
RUN powershell.exe -Command ; \ | |
$handler = New-Object System.Net.Http.HttpClientHandler ; \ | |
$client = New-Object System.Net.Http.HttpClient($handler) ; \ | |
$client.Timeout = New-Object System.TimeSpan(0,30,0) ; \ |
When attempting to remove all of the data in the Nomad data directory, several directories and files are unable to be deleted. Many messages are logged to the console like:
rm: cannot remove ‘alloc/736f61b9-d7dc-cb73-0dd1-76b1b2ba032d/nomad-ui/secrets’: Device or resource busy
rm: cannot remove ‘alloc/ddcf5a78-5497-f4a4-a101-221fc4e0180b/fabio/alloc’: Device or resource busy
rm: cannot remove ‘alloc/ddcf5a78-5497-f4a4-a101-221fc4e0180b/fabio/secrets’: Device or resource busy