Use rabbitmq-clusterer when deploying
Change-Id: I2a9c6fa16444a2142ab77f58d188eda84a2e59fd Partially-Implements: blueprint rabbitmq-clusterer
This commit is contained in:
parent
2e07be310a
commit
d01e9a43dd
@ -14,8 +14,10 @@
|
||||
dest: "{{ node_config_directory }}/rabbitmq/rabbitmq-env.conf" }
|
||||
- { src: "rabbitmq.config.j2",
|
||||
dest: "{{ node_config_directory }}/rabbitmq/rabbitmq.config" }
|
||||
- { src: "rabbitmq_clusterer.config.j2",
|
||||
dest: "{{ node_config_directory }}/rabbitmq/rabbitmq_clusterer.config" }
|
||||
|
||||
- name: Copying Rabbitmq JSON configuration file
|
||||
template:
|
||||
src: "roles/rabbitmq/templates/rabbitmq.json.j2"
|
||||
dest: "{{ node_config_directory }}/rabbitmq/config.json"
|
||||
dest: "{{ node_config_directory }}/rabbitmq/config.json"
|
||||
|
@ -4,8 +4,3 @@
|
||||
- include: bootstrap.yml
|
||||
|
||||
- include: start.yml
|
||||
|
||||
- name: Sleep while cluster starts
|
||||
command: sleep 5
|
||||
changed_when: False
|
||||
failed_when: False
|
||||
|
@ -1,7 +1,12 @@
|
||||
RABBITMQ_NODENAME=rabbit
|
||||
RABBITMQ_BOOT_MODULE=rabbit_clusterer
|
||||
|
||||
# See bug https://bugs.launchpad.net/ubuntu/+source/erlang/+bug/1374109
|
||||
{% if not kolla_base_distro in ['ubuntu', 'debian'] %}
|
||||
RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="-pa /usr/lib/rabbitmq/lib/rabbitmq_server-3.5.5/plugins/rabbitmq_clusterer-3.5.x-189b3a81.ez/rabbitmq_clusterer-3.5.x-189b3a81/ebin"
|
||||
# See bug https://bugs.launchpad.net/ubuntu/+source/erlang/+bug/1374109
|
||||
export ERL_EPMD_ADDRESS={{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
|
||||
{% else %}
|
||||
RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="-pa /usr/lib/rabbitmq/lib/rabbitmq_server-3.5.4/plugins/rabbitmq_clusterer-3.5.x-189b3a81.ez/rabbitmq_clusterer-3.5.x-189b3a81/ebin"
|
||||
{% endif %}
|
||||
|
||||
export ERL_EPMD_PORT={{ rabbitmq_epmd_port }}
|
||||
|
@ -10,17 +10,14 @@
|
||||
]},
|
||||
{default_user, <<"{{ rabbitmq_user }}">>},
|
||||
{default_pass, <<"{{ rabbitmq_password }}">>},
|
||||
{cluster_partition_handling, autoheal},
|
||||
{cluster_nodes, {[
|
||||
{% for host in groups['rabbitmq'] %}'rabbit@{{ hostvars[host]['ansible_hostname'] }}'{% if not loop.last %},{% endif %}{% endfor %}
|
||||
|
||||
], disc}}
|
||||
{cluster_partition_handling, autoheal}
|
||||
]},
|
||||
{rabbitmq_management, [
|
||||
{listener, [
|
||||
{ip, "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"},
|
||||
{port, {{ rabbitmq_management_port }}}
|
||||
]}
|
||||
]}
|
||||
]},
|
||||
{rabbitmq_clusterer, [{config, "/etc/rabbitmq/rabbitmq_clusterer.config"}]}
|
||||
].
|
||||
% EOF
|
||||
|
@ -12,6 +12,12 @@
|
||||
"dest": "/etc/rabbitmq/rabbitmq.config",
|
||||
"owner": "rabbitmq",
|
||||
"perm": "0600"
|
||||
},
|
||||
{
|
||||
"source": "{{ container_config_directory }}/rabbitmq_clusterer.config",
|
||||
"dest": "/etc/rabbitmq/rabbitmq_clusterer.config",
|
||||
"owner": "rabbitmq",
|
||||
"perm": "0600"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -0,0 +1,9 @@
|
||||
[
|
||||
{version, 1},
|
||||
{nodes, [
|
||||
{% for host in groups['rabbitmq'] %} {rabbit@{{ hostvars[host]['ansible_hostname'] }}, disc}{% if not loop.last %},{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
]},
|
||||
{gospel, {node, rabbit@{{ hostvars[groups['rabbitmq'][0]]['ansible_hostname'] }}}}
|
||||
].
|
@ -16,7 +16,6 @@
|
||||
- { role: mariadb, tags: mariadb, when: enable_mariadb | bool }
|
||||
|
||||
- hosts: rabbitmq
|
||||
serial: 1
|
||||
roles:
|
||||
- { role: rabbitmq, tags: rabbitmq, when: enable_rabbitmq | bool }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user