我运行了这段代码:
job "zookeeper" {
constraint {
attribute = "${attr.unique.network.ip-address}"
value = "130.250.58.163"
}
datacenters = ["nosql_dc"]
type = "service"
group "zookeeper" {
count = 1
restart {
attempts = 0
}
task "instance" {
driver = "raw_exec"
kill_timeout = "60s"
resources {
network {
port "zookeeper_port" {
static = 2181
}
}
}
config {
command = "/nosql/zookeeper/bin/zkServer.sh"
args = ["start"]
}
service {
name = "zookeeper"
port = "zookeeper_port"
check {
name = "Zookeeper Check"
type = "tcp"
interval = "30s"
timeout = "10s"
port = "zookeeper_port"
}
}
}
}
}
一切看起来都不错,但似乎 nomad 杀死了进程
运行后的结果:
仍然错误:
当我检查ps -ef | grep zoo
该过程时不存在。