Manoj Kalluri
Manoj Kalluri

Reputation: 1474

ansible playbook - task was never completed ,no results and still running on my console

Hi here is my playbook

---

- hosts: pupservers
  sudo: yes

  tasks:
  - name: start kafka
    command: /home/ec2-user/kafka_2.11-0.9.0.0/bin/kafka-server-start.sh /home/ec2-user/kafka_2.11-0.9.0.0/config/server.properties

I actually try to start kafka broker- the actual command is

bin/kafka-server-start.sh config/server.properties

when I hit this command on kafka broker server then the command executes and I will never get control of that console - if I click ctrl+c then kafka broker stopps

now when I used ansible playbook and executed this playboon from by ansible server to start kafka in its broker server then kafka starts running,but I lost control of my console,if I click ctrl+c then I it is stopping kafka broker

enter image description here

this was my output on ansible console ouput ,task never completes and If I aborts then broker stops

Upvotes: 1

Views: 575

Answers (2)

Manoj Kalluri
Manoj Kalluri

Reputation: 1474

kafka scripts are running on foreground in the nodes,so I am not able to get back control ,to solve this problem I ran scripts in background using -daemon then my script runs in background and I gets back the control

Upvotes: 2

Aida Paul
Aida Paul

Reputation: 2722

It looks like your kafka starting script is blocking and you expect it to run in the background. To go around it you will have to wrap it with some script that will start it in background, like supervisor.

Upvotes: 3

Related Questions