jaytaylor / ansible-kafka

Ansible Kafka role
https://galaxy.ansible.com/jaytaylor/kafka/
Other
67 stars 52 forks source link

Upstart configuration fails with CentOS 6.8 (upstart 0.6.5) #26

Closed ledroide closed 7 years ago

ledroide commented 7 years ago

There is an unsupported syntax in /etc/init/kafka.conf

serge:~$ cat /etc/centos-release 
CentOS release 6.8 (Final)
serge:~$ initctl version
init (upstart 0.6.5)
serge:~$ initctl status kafka
initctl: Unknown job: kafka
serge:~$ initctl start kafka 
initctl: Unknown job: kafka
serge:~$ initctl list | grep kafka ; echo $?
1
serge:~$ initctl log-priority debug && initctl --verbose reload-configuration
serge:~$ tail -n 4 -f /var/log/messages
Jun  2 03:42:18 serge-opo-1 init: Reloading configuration
Jun  2 03:42:18 serge-opo-1 init: Loading configuration from /etc/init.conf
Jun  2 03:42:18 serge-opo-1 init: Loading configuration from /etc/init
Jun  2 03:42:18 serge-opo-1 init: /etc/init/kafka.conf:9: Unknown stanza
ledroide commented 7 years ago

Partly solved. Removed line "console log" from /etc/init/kafka.conf and reloaded upstart config :

serge:~$ initctl --verbose reload-configuration
serge:~$ initctl status kafka
kafka stop/waiting
initctl start kafka
serge:~$ kafka start/running, process 17791

Unfortunately, kafka crashes immediately after start, with no clue in /var/log/kafka/kafka.* ; anyway the upstart issue should be solved just by removing "console log" from /etc/init/kafka.conf.

ledroide commented 7 years ago

Also solved init script in /etc/init/kafka.conf , which has unsupported options for CentOS 6.8. Replace this line : exec sudo --set-home --user="${USER}" --group="${GROUP}" /bin/sh -c "${KAFKA_OPTS} /usr/local/kafka/bin/kafka-server-start.sh /etc/kafka/server.properties 1>>${STDOUT} 2>>${STDERR}" by : exec sudo -H -u ${USER} -g ${GROUP} /bin/sh -c "${KAFKA_OPTS} /usr/local/kafka/bin/kafka-server-start.sh {{ kafka_conf_dir }}/server.properties 1>>${STDOUT} 2>>${STDERR}" then it works and launches kafka. This change has no incidence on CentOS 7 until upstart is now replaced by systemd. Pull request for bugfix on template kafka.conf.j2 coming soon...

jaytaylor commented 7 years ago

@ledroide Are you hooking us up with Centos compatibility!?!?

...

Awesome!