manoj manoj - 7 months ago 66
Bash Question

how to run a kafka broker start script in background using ansible

How to run a Kafka broker start script written in ansible in background
when I am running it normally it is executing on the foreground and I'm unable to get back the control of terminal, if I close the terminal or Ctrl+c them Kafka broker will be stopped

My goal is after starting Kafka broker on the CLI, I need to run few more commands on that terminal to do some other tasks

ansible kafkabrokers -a "~/kafka_2.11-0.9.0.0/bin/kafka-server-start.sh ~/kafka_2.11-0.9.0.0/config/server.properties "


nohup and '&' are notworking

Answer

well I searched and found an answer for this is to use -daemon

ansible kafkabrokers -a  " ~/kafka_2.11-0.9.0.0/bin/kafka-server-start.sh -daemon ~/kafka_2.11-0.9.0.0/config/server.properties "
Comments