I know this isn't a bug but I believe the documentation should have more information on how to start the application in a "Production" like instance. Below is my systemd script which isn't working at this time. Of course if I login as the Kafka user and run the command manually it works as expected.
`[vagrant@oracle-72 ~]$ sudo systemctl status kafka-manager.service
● kafka-manager.service - Yahoo Kafka Manager
Loaded: loaded (/etc/systemd/system/kafka-manager.service; disabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Mon 2017-04-10 18:59:57 UTC; 34min ago
Process: 4018 ExecStart=/path_to_kafka_manager/kafka-manager-1.3.3.4/bin/kafka-manager -Dconfig.file=/path_to_kafka_manager/conf/application.conf (code=exited, status=1/FAILURE)
Main PID: 4018 (code=exited, status=1/FAILURE)
Apr 10 18:59:56 oracle-72.vagrantup.com systemd[1]: kafka-manager.service: main process exited, code=exited, status=1/FAILURE
Apr 10 18:59:56 oracle-72.vagrantup.com systemd[1]: Unit kafka-manager.service entered failed state.
Apr 10 18:59:56 oracle-72.vagrantup.com systemd[1]: kafka-manager.service failed.
Apr 10 18:59:57 oracle-72.vagrantup.com systemd[1]: kafka-manager.service holdoff time over, scheduling restart.
Apr 10 18:59:57 oracle-72.vagrantup.com systemd[1]: start request repeated too quickly for kafka-manager.service
Apr 10 18:59:57 oracle-72.vagrantup.com systemd[1]: Failed to start Yahoo Kafka Manager.
Apr 10 18:59:57 oracle-72.vagrantup.com systemd[1]: Unit kafka-manager.service entered failed state.
Apr 10 18:59:57 oracle-72.vagrantup.com systemd[1]: kafka-manager.service failed.`
`[Unit]
Description=Yahoo Kafka Manager
After=network.target
[Service]
PIDFile=/var/run/kafka-manager/kafka-manager.pid
WorkingDirectory=/path_to_kafka_manager/kafka-manager-1.3.3.4
ExecStart=/path_to_kafka_manager/kafka-manager-1.3.3.4/bin/kafka-manager -Dconfig.file=/path_to_kafka_manager/conf/application.conf
Restart=on-failure
User=kafka
Group=kafka
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target`
For what it's worth, this works for me.
In /etc/systemd/system/kafka-manager.service
[Unit]
Description=Kafka Manager
After=network.target
[Install]
WantedBy=multi-user.target
[Service]
ExecStart=/opt/kafka-manager-1.3.3.6/bin/kafka-manager
Type=simple
In /opt/kafka-manager-1.3.3.6/conf/application.conf
play.crypto.secret="some-secret"
play.http.requestHandler="play.http.DefaultHttpRequestHandler"
play.application.loader=loader.KafkaManagerLoader
pinned-dispatcher.type="PinnedDispatcher"
pinned-dispatcher.executor="thread-pool-executor"
kafka-manager.zkhosts="my-zookeeper-connection-string"
kafka-manager.base-zk-path="/a-chroot"
In /opt/kafka-manager-1.3.3.6/conf/application.ini
-Dapplication.home=/opt/kafka-manager-1.3.3.6
-Dpidfile.path=/opt/kafka-manager-1.3.3.6/kafka-manager.pid
-Dhttp.port=8080
I confirm, it's work with the option kafka-manager.base-zk-path="/a-chroot" set in conf/application.conf
# su - mq
sh> tee /usr/local/kafka-manager/conf/application.ini <<-'EOF'
-Dapplication.home=/usr/local/kafka-manager
-Dconfig.file=/usr/local/kafka-manager/conf/application.conf
-Dpidfile.path=/usr/local/kafka-manager/kafka-manager.pid
-Dhttp.port=9000
EOF
if
$JAVA_HOMEnot work,replace$JAVA_HOMEto your java install path.
# su - root
sh> tee /usr/lib/systemd/system/kafka-manager.service <<-'EOF'
[Unit]
Description=Kafka Manager
Documentation=https://github.com/yahoo/kafka-manager
Requires=network.target
After=network.target
[Service]
Type=simple
User=mq
Group=mq
WorkingDirectory=/usr/local/kafka-manager
ExecStart=/usr/local/kafka-manager/bin/kafka-manager -java-home $JAVA_HOME
StandardOutput=null
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
sh> systemctl daemon-reload
sh> systemctl enable kafka-manager --now
Most helpful comment
For what it's worth, this works for me.
In /etc/systemd/system/kafka-manager.service
In /opt/kafka-manager-1.3.3.6/conf/application.conf
In /opt/kafka-manager-1.3.3.6/conf/application.ini