open-nomad/terraform/examples/spark/hdfs.nomad

92 lines
1.6 KiB
Plaintext
Raw Normal View History

2017-06-24 23:28:12 +00:00
job "hdfs" {
datacenters = [ "dc1" ]
group "NameNode" {
2017-06-24 23:28:12 +00:00
constraint {
operator = "distinct_hosts"
value = "true"
}
2017-06-24 23:28:12 +00:00
task "NameNode" {
2017-06-24 23:28:12 +00:00
driver = "docker"
2017-06-24 23:28:12 +00:00
config {
image = "rcgenova/hadoop-2.7.3"
command = "bash"
args = [ "-c", "hdfs namenode -format && exec hdfs namenode -D fs.defaultFS=hdfs://${NOMAD_ADDR_ipc}/ -D dfs.permissions.enabled=false" ]
network_mode = "host"
port_map {
ipc = 8020
ui = 50070
}
}
resources {
memory = 500
network {
port "ipc" {
static = "8020"
}
port "ui" {
static = "50070"
}
}
}
2017-06-24 23:28:12 +00:00
service {
name = "hdfs"
port = "ipc"
}
}
}
group "DataNode" {
2017-06-24 23:28:12 +00:00
count = 3
2017-06-24 23:28:12 +00:00
constraint {
operator = "distinct_hosts"
value = "true"
}
2017-06-24 23:28:12 +00:00
task "DataNode" {
2017-06-24 23:28:12 +00:00
driver = "docker"
2017-06-24 23:28:12 +00:00
config {
network_mode = "host"
image = "rcgenova/hadoop-2.7.3"
args = [ "hdfs", "datanode"
, "-D", "fs.defaultFS=hdfs://hdfs.service.consul/"
, "-D", "dfs.permissions.enabled=false"
]
port_map {
data = 50010
ipc = 50020
ui = 50075
}
}
resources {
memory = 500
network {
port "data" {
static = "50010"
}
port "ipc" {
static = "50020"
}
port "ui" {
static = "50075"
}
}
}
2017-06-24 23:28:12 +00:00
}
}
}