Hello all. I started to use nomad now for all the container based services. I have some other services like apache nifi that i will not use docker. I need to make something clear, cause i am a little confused.
Installation and setup of nifi comes from saltstack. So the server already have everything that need to start it. What is the correct job to make to start nifi service?
I tried with raw_exec like that
job "nifi" {
datacenters = ["dc1"]
type = "service"
group "nifi" {
count = 1
network {
port "nifi" {
static = 9443
}
}
task "nifi"{
driver = "raw_exec"
user = "nifi"
config {
command = "/bin/bash"
args = ["/opt/nifi/1.15/bin/nifi.sh", "start"]
}
service {
name = "nifi"
port = "nifi"
}
}
}
}
The job failed and keep restarting.
The user that nomad running is root. So the service should run like root? Unfortunately the logs from the allocation don’t give any clue.
nifi.sh: JAVA_HOME not set; results may vary
Java home:
NiFi home: /opt/nifi/1.15
Bootstrap Config File: /opt/nifi/1.15/conf/bootstrap.conf
Is the same stdout that i have when i run manually the
/opt/nifi/1.15/bin/nifi.sh start
and it start as expected.
Do i miss something of how the non containered job service should be? Maybe its better to exec with systemctl start nifi ?