-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrabbitmq.nomad
94 lines (84 loc) · 2.4 KB
/
rabbitmq.nomad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# There can only be a single job definition per file.
# Create a job with ID and Name 'queue'
job "queue" {
# Specify the datacenters within the region this job can run in.
datacenters = ["dc1"]
# Service type jobs optimize for long-lived services. This is
# the default but we can change to batch for short-lived tasks.
type = "service"
# Configure the job to do rolling updates
update {
# Stagger updates every 10 seconds
stagger = "10s"
# Update a single task at a time
max_parallel = 1
}
# Create a 'broker' group. Each task in the group will be
# scheduled onto the same machine.
group "broker" {
# Control the number of instances of this group.
# Defaults to 1
# count = 1
# Configure the restart policy for the task group. If not provided, a
# default is used based on the job type.
restart {
# The number of attempts to run the job within the specified interval.
attempts = 10
interval = "5m"
# A delay between a task failing and a restart occurring.
delay = "25s"
# Mode controls what happens when a task has restarted "attempts"
# times within the interval. "delay" mode delays the next restart
# till the next interval. "fail" mode does not restart the task if
# "attempts" has been hit within the interval.
mode = "delay"
}
# Define a task to run
task "rabbitmq" {
# Use Docker to run the task.
driver = "docker"
# Configure Docker driver with the image
config {
image = "rabbitmq:management"
port_map {
amqp = 5672
http = 15672
}
}
service {
name = "rabbitmq"
tags = ["app", "rabbitmq"]
port = "amqp"
check {
port = "amqp"
type = "tcp"
interval = "10s"
timeout = "2s"
}
}
service {
name = "rabbitmq-management"
tags = ["app", "rabbitmq", "ui"]
port = "http"
check {
port = "http"
type = "tcp"
interval = "10s"
timeout = "2s"
}
}
# We must specify the resources required for
# this task to ensure it runs on a machine with
# enough capacity.
resources {
cpu = 500 # 500 MHz
memory = 256 # 256MB
network {
mbits = 10
port "amqp" {}
port "http" {}
}
}
}
}
}