rabbitmq setup from secondary IP

Bug #1583655 reported by Sebastien Fuchs
34
This bug affects 6 people
Affects Status Importance Assigned to Milestone
kolla
Won't Fix
Wishlist
Satya Sanjibani Routray
Newton
Won't Fix
Wishlist
Satya Sanjibani Routray

Bug Description

If setup network is not the main interface (ie the same as ansible one), rabbitmq fails, even if the IP can be resolved:
"Hostname has to resolve to IP address of api_interface".

Ex:
network_interface: "eth1"

Analysis:
ansible/roles/rabbitmq/templates/rabbitmq_clusterer.config.j2 shows:
[
  {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'] }}'}}
].

Where {{ hostvars[host]['ansible_hostname'] }} resolves to the host running ansible (eth0).
It should resolve to the hostname attached to the IP of {{ network_interface }}.

Changed in kolla:
milestone: none → newton-rc2
status: New → Triaged
Changed in kolla:
status: Triaged → Confirmed
importance: Undecided → Low
Steven Dake (sdake)
Changed in kolla:
milestone: newton-rc2 → ocata-1
importance: Low → Critical
Revision history for this message
Jeffrey Zhang (jeffrey4l) wrote :

what's your api_interface value in globals.yml file?

In kolla, rabbitmq connect each other through api_interface, so in hosts file or dns server, the hostname name should be resolved to the {{ api_interface }} address.

Revision history for this message
bjolo (bjorn-lofdahl) wrote :

hi all,

I also consider this to be a bug. From an operator perspective, hostname will/should be resolved to the IP of the network_interface and not the API interface. In openstack, the API interface (or the internal interface as it is normally called) is an isolated network w/o a gateway. Thus it does not seem correct that the DNS or /etc/hosts resolution should point to the API interface.

As it is today, rabbitmq requires hostnames to work (it does not work with IPs for some reason). Kolla solves this by populating the hosts /etc/hosts file or relies on external DNS. Arguably this is not the correct solution. DNS will most likely point to the network_interface, and populating /etc/hosts might not be working for several reasons. Order in nsswitch.conf matters for once, and depending on operator organization /etc/hosts can be under the control of some other CM system and any changes will be reverted. Another aspect is that on minimalistic OS's, modifying local root fs is not possible. At least not dynamically. Remember that in kolla it should be simple to move/remove/add rabbitmq containers. Thus the solution needed for this is better if it is contained within kolla and not require any external dependencies.

One solution for this could be that the rabbitmq containers generates their own /etc/hosts file in the containers with the API interface IP and some constructed hostname. Remember this is only needed for rabbitmq clustering so it does not really matter what the hostnames are, as long as they are resolvable and points to the right IP/interface.

ex
hostnamames are node-a, node-b, node-c and DNS resolution points to network_interface

in the rabbitmq containers, the /etc/hosts file looks something like below where 10.0.0.0/24 is the api network.
10.0.0.10 node-a-api
10.0.0.11 node-b-api
10.0.0.12 node-c-api

Revision history for this message
Jeffrey Zhang (jeffrey4l) wrote :

sound a good idea. Could u push a PS for this?

Revision history for this message
Jeffrey Zhang (jeffrey4l) wrote :

Kolla is using --net host solution, so the hostname is not changeable.

another solution is use --add-host <hostname>:<ip> parameter, but it will overwrite all the host os's /etc/hosts file. not optimal too.

btw, here the official explanation about why rabbitmq requires hostname resolve.

[0] http://www.rabbitmq.com/networking.html#dns

Changed in kolla:
milestone: ocata-1 → ocata-2
Changed in kolla:
assignee: nobody → Satya Sanjibani Routray (satroutr)
assignee: Satya Sanjibani Routray (satroutr) → nobody
Changed in kolla:
assignee: nobody → Satya Sanjibani Routray (satroutr)
Revision history for this message
Vladislav Belogrudov (vlad-belogrudov) wrote :

I would suggest using simple dns containers as described in https://blueprints.launchpad.net/kolla/+spec/kolla-dns

Revision history for this message
Vladislav Belogrudov (vlad-belogrudov) wrote :

if dns containers are implemented one could write ansible for rabbits like this:

 'rabbit@rabbit1','rabbit@rabbit2','rabbit@rabbit3' up to max_rabbits defined

Changed in kolla:
milestone: ocata-2 → ocata-3
Changed in kolla:
assignee: Satya Sanjibani Routray (satroutr) → nobody
Revision history for this message
Satya Sanjibani Routray (satroutr) wrote :

I have the fix ready with me

Will be pushing the changes

Changed in kolla:
assignee: nobody → Satya Sanjibani Routray (satroutr)
Revision history for this message
Christian Berendt (berendt) wrote :

satroutr, the bug will be assigned to you after you pushed your review on gerrit.

Changed in kolla:
importance: Critical → Low
importance: Low → Wishlist
Revision history for this message
Satya Sanjibani Routray (satroutr) wrote :
Changed in kolla:
status: Confirmed → In Progress
Changed in kolla:
milestone: ocata-3 → ocata-rc1
Changed in kolla:
milestone: ocata-rc1 → pike-1
Changed in kolla:
milestone: pike-2 → pike-3
Changed in kolla:
milestone: pike-3 → pike-rc1
Changed in kolla:
milestone: pike-rc1 → queens-1
Changed in kolla:
milestone: queens-2 → queens-3
Changed in kolla:
milestone: queens-3 → queens-rc1
Changed in kolla:
milestone: queens-rc1 → queens-rc2
Changed in kolla:
milestone: queens-rc2 → rocky-1
Changed in kolla:
milestone: rocky-2 → rocky-3
Changed in kolla:
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.