Skip to content

Instantly share code, notes, and snippets.

@fho
Last active April 16, 2018 12:23
Show Gist options
  • Save fho/c35d02531b9d38ea4fce273c9b5872a6 to your computer and use it in GitHub Desktop.
Save fho/c35d02531b9d38ea4fce273c9b5872a6 to your computer and use it in GitHub Desktop.
job "logbug" {
datacenters = ["dc1"]
type = "service"
update {
max_parallel = 1
auto_revert = false
canary = 0
}
migrate {
max_parallel = 1
health_check = "task_states"
min_healthy_time = "10s"
healthy_deadline = "5m"
}
group "cache" {
count = 1
restart {
attempts = 2
interval = "30m"
delay = "15s"
mode = "fail"
}
ephemeral_disk {
size = 300
}
task "redis" {
driver = "raw_exec"
config {
command = "/tmp/produce-logs.sh"
}
resources {
cpu = 500 # 500 MHz
memory = 256 # 256MB
network {
mbits = 10
}
}
}
}
}
#!/bin/bash
rand_str(){
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w ${1:-2048} | head -n 1
}
r=$(rand_str)
for ((i=0;i<500;i++)); do
echo "$i: $r"
done
sleep infinity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment