sujiar37 / AWX-HA-InstanceGroup

Build AWX clustering on Docker Standalone Installation
MIT License
107 stars 39 forks source link

Jobs never starts, struck at Pending state for ever #17

Closed Sreenadh8 closed 4 years ago

Sreenadh8 commented 4 years ago

Hi Sujith,

Below is my ansible hosts file, i have 3 systems, web1, Agent node1 and Agent Node2 , External aws RDS . Deployed the HA setup without any errors, RabbitMQ cluster is working fine, all nodes are part of cluster, I am not sure what i am missing... could you please someone help...

issues :

1) Jobs never starts.. 2) Agent Node2 did not reflect when trying add to instance group.

my ansible hosts

[all]

[awx_instance_group_web] web1

[awx_instance_group_web:vars] ansible_connection= ssh ansible_ssh_user= root ansible_ssh_pass= xxxxxxxx ansible_become= yes

[awx_instance_group_task] node1 node2

[awx_instance_group_task:vars] ansible_connection= ssh ansible_ssh_user= root ansible_ssh_pass= xxxxxx ansible_become= yes

To Reproduce use above mentioned 3 node cluster and run playbook again..

Expected behavior

1) jobs should run. 2) we want both Agent Nodes 1 & 2 should reflect and balance the jobs load .. image

image

*Additional context

sujiar37 commented 4 years ago

@Sreenadh8 , the issue seems to be those nodes were not registered at initial run / rabbitmq cluster has some connection issues. Couple of things you may have to take a look and confirm

  1. All these nodes can communicate each other with their hostnames.
  2. Verify cluster status via the command /sbin/rabbitmqctl cluster_status and make sure it returns value with all the nodes [ web1 & 2 agent nodes ]
  3. Make sure ports are opened and excluded from firewall to verify successful communication between all these hosts
  4. If the problem is not above, then please go through below the Known issues and analyze it and restart manually if required. You can run these playbook multiple times even after restarting the machine.
Sreenadh8 commented 4 years ago

Hi Sujith,

thanks for your response...all above points seems to be fine, however i do see below errors, could you advise further ?

[2019-11-04 08:20:11,901: ERROR/Process-1] beat: Connection error: failed to resolve broker hostname. Trying again in 2.0 seconds... [2019-11-04 08:20:13,912: ERROR/Process-1] beat: Connection error: failed to resolve broker hostname. Trying again in 4.0 seconds... [2019-11-04 08:20:17,926: ERROR/Process-1] beat: Connection error: failed to resolve broker hostname. Trying again in 6.0 seconds... [2019-11-04 08:20:23,942: ERROR/Process-1] beat: Connection error: failed to resolve broker hostname. Trying again in 8.0 seconds... [2019-11-04 08:20:31,972: ERROR/Process-1] beat: Connection error: failed to resolve broker hostname. Trying again in 10.0 seconds... [2019-11-04 08:20:41,997: ERROR/Process-1] beat: Connection error: failed to resolve broker hostname. Trying again in 12.0 seconds... [2019-11-04 08:20:54,019: ERROR/Process-1] beat: Connection error: failed to resolve broker hostname. Trying again in 14.0 seconds... RESULT 2 OKREADY [2019-11-04 08:21:08,116: ERROR/Process-1] beat: Connection error: failed to resolve broker hostname. Trying again in 16.0 seconds... [2019-11-04 08:21:24,142: ERROR/Process-1] beat: Connection error: failed to resolve broker hostname. Trying again in 18.0 seconds... [2019-11-04 08:21:42,177: ERROR/Process-1] beat: Connection error: failed to resolve broker hostname. Trying again in 20.0 seconds...

Regards, Sreenadh

sujiar37 commented 4 years ago

@Sreenadh8 This could be the reason when containers were unable to resolve the hostname of the host machine. Please review the docker-compose.yml file under /var/lib/awx/build_image directory and see whether you can ping to the host machine inside the container.

https://github.com/sujiar37/AWX-HA-InstanceGroup/blob/f6393ed4e93d6f01eccf316302f24b6335ea4d89/roles/awx_ha/templates/docker-compose.yml.j2#L17

The logs more likely look like this if it is not able to communicate rabbitmq cluster, here the host machine is node2, but it is not resolvable inside the container.

127.0.0.1 | FAILED! => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/libexec/platform-python"
    },
    "changed": false,
    "elapsed": 300,
    "msg": "**Timeout when waiting for node2:5672**"
sujiar37 commented 4 years ago

@Sreenadh8, thank you for reporting this. The fix has been implemented along with the upgrade of AWX's latest version. You may please test it and let me know if you have any feedback regarding this. Between, here is the fix if containers unable to communicate host machine via DNS,

https://github.com/sujiar37/AWX-HA-InstanceGroup/blob/08ef1ab4a71fa72b6edad91a49f51d6386bd22f7/roles/awx_ha/tasks/setup_env.yml#L40-L43

https://github.com/sujiar37/AWX-HA-InstanceGroup/blob/08ef1ab4a71fa72b6edad91a49f51d6386bd22f7/roles/awx_ha/templates/launch_awx.sh.j2#L2

https://github.com/sujiar37/AWX-HA-InstanceGroup/blob/08ef1ab4a71fa72b6edad91a49f51d6386bd22f7/roles/awx_ha/templates/launch_awx_task.sh.j2#L2

Sreenadh8 commented 4 years ago

@sujiar37 Thank you for your assistance, Yep, you are right, in fact i figured-out yesterday and forgot to update you on this thread... now, I have deployed awx 7.0.0 and tested HA functionality, it works fine as expected...and will be testing with latest version 9.0.1 tomorrow and will update you the sanity checks status....once again thanks for your response.

Regards, Sreenadh

sujiar37 commented 4 years ago

@Sreenadh8 , Make it much easier for everyone, check these instructions for vagrant here to play with sandbox environment.

Sreenadh8 commented 4 years ago

@sujiar37 you are a hero... tested with 9.0.1 and your fix for host entries inside container worked fine, thank you... and 9.0.1 looks good and solid, migrated from 7.0 to 9.0.1 without losing data, jobs and HA functionality working well as expected...nicely done.

Regards, Sreenadh

Sreenadh8 commented 4 years ago

@sujiar37 just one requirement/feature request from my end before we entered into production HA setup... could you allow us or let us know how to change the default awx logo after logged-in to console...we want to make sure that our own organization custom logo to be presented instead of awx default logo( considering due to management audit organization policies ) - could you help with feature please... I will open up another feature request if you want a separate thread for this requirement... thank you..

image

Regards, Sreenadh

sujiar37 commented 4 years ago

@Sreenadh8 happy that everything works out of the box. You could modify the logo which is available at the settings -> system (if I had remember correctly) from AWX GUI. More related details can found via official Ansible tower documentation