AnsibleShipyard / ansible-zookeeper

Ansible playbook for ZooKeeper
MIT License
95 stars 114 forks source link

Zookeeper doesn't stop or restart properly on CentOS 6 #9

Closed dajobe closed 9 years ago

dajobe commented 9 years ago

I was looking into this and the upstart script was the cause; using su -c means that when the daemon is killed or restarted, only the 'su' process gets killed but the daemon itself does not, so it sits hanging on the :2181 port and then the new daemon instance can't run.

The fix I used which requires installing an the daemonize package was this change to the end of zookeeper.conf.j2:

...
expect daemon

script
    exec daemonize -u zookeeper -p /var/run/zookeeper.pid -o /var/log/zookeeper/init-zookeeper.log {{zookeeper_dir}}/bin/zkServer.sh start-foreground
end script

Although it would require tasks/RedHat.yml to be changed to add 'daemonize' to the 'Install OS Packages' list.

I actually fixed it with my own tasks overriding the defaults.

JasonGiedymin commented 9 years ago

Can you retest?

JasonGiedymin commented 9 years ago

No feedback, going to close this issue.