--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project...@googlegroups.com.
To post to this group, send email to awx-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/a261f703-5ddc-4b40-9512-d5181ec59380%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hey Matthew,
So here's some background. We're attempting to set AWX up w/
HA. So instead of internally hosted single MQ or Postgres
Docker images, we want to connect them to Highly Available
PostgreSQL and RabbitMQ clusters we have in containers or
otherwise. What this means we only have to take care of the
Docker/AWX GUI container and not the single RabbitMQ and single
PostgreSQL containers, should issues arise within it.
Having said that, I would only need to cater to the AWX container and any number of instances of it on separate hosts for redundancy.
In regards to keeping everything in the Docker containers, how can I achieve HA via 3 redundant AWX instances assuming everything is kept in the Docker containers? Assume OpenShift, Kubernetes are not available and I'm using VM's w/ Docker ( Assuming KVM and VMWare for example ) . Using the various documentation pages available, I'm still having trouble visualizing how the 3 x RabbitMQ instances and 3 x PostgreSQL instances are clustered and talk to each other in the event 1-2 nodes go offline. What replication is used on the 3 instances of PostgreSQL and the 3 instances of RabbitMQ, for example, if everything is kept in Docker Containers.
This all feeds into the supportability realm of things.
Cheers,
TK
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/dcb8ad11-53ad-4538-8bf3-bc1ebeba56d6%40googlegroups.com.
[root@awx-m01 installer]# cat inventory |grep -v "#"
localhost ansible_connection=local ansible_python_interpreter="/usr/bin/env python"
[all:vars]
dockerhub_base=ansible
awx_task_hostname=awx
awx_web_hostname=awxweb
postgres_data_dir=/tmp/pgdocker
host_port=80
docker_compose_dir=/var/lib/awx
pg_hostname=psql-c01
pg_username=awx
pg_password=awxpass
pg_database=awx
pg_port=5432
rabbitmq_host=rmq-c01
rabbitmq_port=5672
rabbitmq_vhost=tower
rabbitmq_username=tower
rabbitmq_password='password'
rabbitmq_cookie=rabbitmqcookie
admin_user=admin
admin_password=password
create_preload_data=True
secret_key=awxsecret
[root@awx-m01 installer]#
[root@awx-m01 awx]# git status
# On branch devel
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: installer/inventory
# modified: installer/roles/local_docker/tasks/standalone.yml
# modified: installer/roles/local_docker/templates/docker-compose.yml.j2
#
no changes added to commit (use "git add" and/or "git commit -a")
[root@awx-m01 awx]#
[root@awx-m01 awx]# git diff
diff --git a/installer/inventory b/installer/inventory
index 847ba60..980b674 100644
--- a/installer/inventory
+++ b/installer/inventory
@@ -62,15 +62,22 @@ docker_compose_dir=/var/lib/awx
# Set pg_hostname if you have an external postgres server, otherwise
# a new postgres service will be created
-# pg_hostname=postgresql
+pg_hostname=psql-c01
pg_username=awx
pg_password=awxpass
pg_database=awx
pg_port=5432
# RabbitMQ Configuration
-rabbitmq_password=awxpass
-rabbitmq_erlang_cookie=cookiemonster
+# rabbitmq_password=awxpass
+# rabbitmq_erlang_cookie=cookiemonster
+
+rabbitmq_host=rmq-c01
+rabbitmq_port=5672
+rabbitmq_vhost=tower
+rabbitmq_username=tower
+rabbitmq_password='password'
+rabbitmq_cookie=rabbitmqcookie
# Use a local distribution build container image for building the AWX package
# This is helpful if you don't want to bother installing the build-time dependencies as
diff --git a/installer/roles/local_docker/tasks/standalone.yml b/installer/roles/local_docker/tasks/standalone.yml
index ad7a064..9f05872 100644
--- a/installer/roles/local_docker/tasks/standalone.yml
+++ b/installer/roles/local_docker/tasks/standalone.yml
@@ -26,6 +26,7 @@
RABBITMQ_ERLANG_COOKIE: "{{ rabbitmq_erlang_cookie }}"
RABBITMQ_DEFAULT_USER: "{{ rabbitmq_default_username }}"
RABBITMQ_DEFAULT_PASS: "{{ rabbitmq_default_password }}"
+ when: rabbitmq_host is not defined or rabbitmq_host == ''
register: rabbitmq_container_activate
- name: Activate memcached container
@@ -40,41 +41,72 @@
seconds: 15
when: postgres_container_activate.changed or rabbitmq_container_activate.changed
+
+
+
+- name: Set properties without postgres and rabbitmq for awx_web
+ set_fact:
+ pg_hostname_actual: "{{ pg_hostname }}"
+ rabbitmq_host_actual: "{{ rabbitmq_host }}"
+ awx_web_container_links:
+ - memcached
+ when: pg_hostname is defined and rabbitmq_host is defined
+
- name: Set properties without postgres for awx_web
set_fact:
pg_hostname_actual: "{{ pg_hostname }}"
+ rabbitmq_host_actual: rabbitmq
awx_web_container_links:
- rabbitmq
- memcached
- when: pg_hostname is defined
+ when: pg_hostname is defined and ( rabbitmq_host is not defined or rabbitmq_host == "" )
- name: Set properties with postgres for awx_web
set_fact:
pg_hostname_actual: postgres
+ rabbitmq_host_actual: rabbitmq
awx_web_container_links:
- rabbitmq
- memcached
- postgres
- when: pg_hostname is not defined or pg_hostname == ''
+ when: ( pg_hostname is not defined or pg_hostname == '' ) and ( rabbitmq_host is not defined or rabbitmq_host == "" )
+
+
+
+
+
+- name: Set properties without postgres and rabbitmq for awx_task
+ set_fact:
+ pg_hostname_actual: "{{ pg_hostname }}"
+ rabbitmq_host_actual: "{{ rabbitmq_host }}"
+ awx_task_container_links:
+ - memcached
+ - awx_web:awxweb
+ when: pg_hostname is defined and rabbitmq_host is defined
- name: Set properties without postgres for awx_task
set_fact:
pg_hostname_actual: "{{ pg_hostname }}"
+ rabbitmq_host_actual: rabbitmq
awx_task_container_links:
- rabbitmq
- memcached
- awx_web:awxweb
- when: pg_hostname is defined
+ when: pg_hostname is defined and ( rabbitmq_host is not defined or rabbitmq_host == "" )
- name: Set properties with postgres for awx_task
set_fact:
pg_hostname_actual: postgres
+ rabbitmq_host_actual: rabbitmq
awx_task_container_links:
- rabbitmq
- memcached
- awx_web:awxweb
- postgres
- when: pg_hostname is not defined or pg_hostname == ''
+ when: pg_hostname is not defined or pg_hostname == '' and ( rabbitmq_host is not defined or rabbitmq_host == "" )
+
+
+
- name: Activate AWX Web Container
docker_container:
@@ -106,7 +138,7 @@
DATABASE_HOST: "{{ pg_hostname_actual }}"
RABBITMQ_USER: "{{ rabbitmq_default_username }}"
RABBITMQ_PASSWORD: "{{ rabbitmq_default_password }}"
- RABBITMQ_HOST: "rabbitmq"
+ RABBITMQ_HOST: "{{ rabbitmq_host_actual }}"
RABBITMQ_PORT: "{{ rabbitmq_port }}"
RABBITMQ_VHOST: "{{ rabbitmq_default_vhost }}"
MEMCACHED_HOST: "memcached"
@@ -147,7 +179,7 @@
DATABASE_PORT: "{{ pg_port }}"
RABBITMQ_USER: "{{ rabbitmq_default_username }}"
RABBITMQ_PASSWORD: "{{ rabbitmq_default_password }}"
- RABBITMQ_HOST: "rabbitmq"
+ RABBITMQ_HOST: "{{ rabbitmq_host_actual }}"
RABBITMQ_PORT: "{{ rabbitmq_port }}"
RABBITMQ_VHOST: "{{ rabbitmq_default_vhost }}"
MEMCACHED_HOST: "memcached"
diff --git a/installer/roles/local_docker/templates/docker-compose.yml.j2 b/installer/roles/local_docker/templates/docker-compose.yml.j2
index 5e227bf..d2a7e31 100644
--- a/installer/roles/local_docker/templates/docker-compose.yml.j2
+++ b/installer/roles/local_docker/templates/docker-compose.yml.j2
@@ -5,9 +5,11 @@ services:
web:
image: {{ awx_web_docker_actual_image }}
depends_on:
+ {% if pg_hostname is not defined %}
- rabbitmq
+ {% endif %}
- memcached
- {% if pg_hostname is not defined %}
+ {% if rabbitmq_host is not defined %}
- postgres
{% endif %}
ports:
[root@awx-m01 awx]#
[root@awx-m01 awx]#
[root@awx ~]# ./r-rmq.py
[*] Waiting for messages. To exit press CTRL+C
[x] Received 'Blah! Blah! World!'
[x] Received 'Blah! Blah! World!'
[x] Received 'Blah! Blah! World!'
[x] Received 'Blah! Blah! World!'
[x] Received 'Blah! Blah! World!'
[root@awxweb awx]# ./s-mq.py
[x] Sent 'Blah! Blah! World!'
[root@awxweb awx]# ./s-mq.py
[x] Sent 'Blah! Blah! World!'
[root@awxweb awx]# ./s-mq.py
[x] Sent 'Blah! Blah! World!'
[root@awxweb awx]#
+ when: ( pg_hostname is not defined </spa
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Error creating container: 500 Server Error: Internal Server Error (\"{\"message\":\"Could not get container for rabbitmq\"}\")"}
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/c6830218-bc6c-478a-ac09-d055fe1f93f0%40googlegroups.com.