datastax / pulsar-ansible

Apache License 2.0
4 stars 9 forks source link

Add playbook checking if pulsar components are ready #12

Closed MMirelli closed 2 years ago

MMirelli commented 2 years ago

Adds support to check if all pulsar components are ready and healthy.

Without this playbook, I am not sure how to ensure that all components are up and running. Please let me know if you know a better way of doing this.

dave2wave commented 2 years ago

@MMirelli

LGTM except one comment

role "misc/_check_svc_status" is only setting a proper value to variable "srvStarted". It would be clearer to add a "post_task" to print out the content of "srvStarted".

@yabinmeng would you please provide an example post task for this. Thanks!

yabinmeng commented 2 years ago

@MMirelli @dave2wave I want to pause this PR for the moment. This particular task is actually part of a broader scope of work that I'm working on.

If you just want to double check the status of every host, you don't need to create a playbook. A much simpler way (as a customer is using) is to use Ansible ad-hoc commands: https://docs.ansible.com/ansible/latest/user_guide/intro_adhoc.html

An example to check the server listening port on every broker host would be:

ansible -i hosts_MyCluster1.ini --private-key </path/to/ssh/private/key> -u <ssh_user> broker -a "sudo netstat -ntlp"

10.166.91.193 | CHANGED | rc=0 >>
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      17452/sshd          
tcp        0      0 0.0.0.0:6650            0.0.0.0:*               LISTEN      21485/java          
tcp        0      0 0.0.0.0:8443            0.0.0.0:*               LISTEN      21485/java          
tcp        0      0 0.0.0.0:6651            0.0.0.0:*               LISTEN      21485/java          
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      21485/java          
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      725/systemd-resolve 
tcp6       0      0 :::22                   :::*                    LISTEN      17452/sshd 
yabinmeng commented 2 years ago

This is covered by by PR #19