<commit_before>.. index:: HowTo: Backport RabbitMQ Pacemaker OCF script

.. raw:: pdf

     PageBreak

.. _backport-rabbitmq-ocf-op:

HowTo: Backport RabbitMQ Pacemaker OCF script
=============================================

Fuel 6.1 contains many fixes to the RabbitMQ OCF script
which makes the :ref:`RabbitMQ<rabbitmq-term>`
cluster more reliable and predictable.
This can be backported to the Fuel 5.1 and 6.0 releases
following the instructions below.
The older Fuel versions do not use Pacemaker for
RabbitMQ cluster management, hence the given changes to the OCF
script are not applicable for them.

.. note:: The OCF script in the Fuel 6.1 release also
   distributes and ensures the consistent Erlang
   cookie file among the all controller nodes.
   For backports to the older Fuel versions, this feature
   is disabled by default in the OCF script.
   If you think you want to enable it, please read
   carefully the details below.

#. Schedule maintenance window.

   .. warning:: Before performing any operations with RabbitMQ,
      you should schedule maintenance window,
      perform backups of all RabbitMQ mnesia files and OCF scripts,
      and stop all OpenStack services an all environment nodes,
      see :ref:`manage-openstack-services-op` for details.

   Mnesia files are located at ``/var/lib/rabbitmq/mnesia/`` and
   OCF files can be found at ``/usr/lib/ocf/resource.d/mirantis/``.

#. Inside the maintenance window, put the p_rabbitmq-server primitive
   in unmanaged state at one of the controller nodes:
   ::

       pcs resource unmanage master_p_rabbitmq-server

   or with the crm tool:
   ::

       crm resource unmanage master_p_rabbitmq-server

   .. note:: Normally, the crm tool can be installed from the
     crmsh package, by commands:
     ::

         yum install crmsh || apt-get install crmsh

#. Check the status. It should show p_rabbitmq-server primitives
   as "Unmanaged":
   ::

       pcs resource show

   or with the crm tool:
   ::

       crm_mon -1

   Unmanaged p_rabbitmq-server resources should look like:
   ::

          Master/Slave Set: master_p_rabbitmq-server [p_rabbitmq-server] (unmanaged) \
              p_rabbitmq-server  (ocf::fuel:rabbitmq-server):    Master node-1 (unmanaged) \
              p_rabbitmq-server  (ocf::fuel:rabbitmq-server):    Slave node-2 (unmanaged) \
              p_rabbitmq-server  (ocf::fuel:rabbitmq-server):    Slave node-3 (unmanaged) \

#. Download the latest OCF script from the fuel-library repository
   to the Fuel Master node:
   ::

       wget --no-check-certificate -O /etc/puppet/modules/nova/files/ocf/rabbitmq \
       https://raw.githubusercontent.com/stack \
       forge/fuel-library/stable/6.0/deployment/puppet/nova/files/ocf/rabbitmq
       chmod +x /etc/puppet/modules/nova/files/ocf/rabbitmq

   .. note:: For the Fuel 5.1 release update the link to use
             a "5.1" version in the download path.

#. Copy the script to all controllers:
   ::

       for i in $(fuel nodes --env <env_ID> | awk '/ready.*controller.*True/{print $1}'); \
       do scp /etc/puppet/modules/nova/files/ocf/rabbitmq \<commit_msg>Remove a space fixing a splitted github URL<commit_after>.. index:: HowTo: Backport RabbitMQ Pacemaker OCF script

.. raw:: pdf

     PageBreak

.. _backport-rabbitmq-ocf-op:

HowTo: Backport RabbitMQ Pacemaker OCF script
=============================================

Fuel 6.1 contains many fixes to the RabbitMQ OCF script
which makes the :ref:`RabbitMQ<rabbitmq-term>`
cluster more reliable and predictable.
This can be backported to the Fuel 5.1 and 6.0 releases
following the instructions below.
The older Fuel versions do not use Pacemaker for
RabbitMQ cluster management, hence the given changes to the OCF
script are not applicable for them.

.. note:: The OCF script in the Fuel 6.1 release also
   distributes and ensures the consistent Erlang
   cookie file among the all controller nodes.
   For backports to the older Fuel versions, this feature
   is disabled by default in the OCF script.
   If you think you want to enable it, please read
   carefully the details below.

#. Schedule maintenance window.

   .. warning:: Before performing any operations with RabbitMQ,
      you should schedule maintenance window,
      perform backups of all RabbitMQ mnesia files and OCF scripts,
      and stop all OpenStack services an all environment nodes,
      see :ref:`manage-openstack-services-op` for details.

   Mnesia files are located at ``/var/lib/rabbitmq/mnesia/`` and
   OCF files can be found at ``/usr/lib/ocf/resource.d/mirantis/``.

#. Inside the maintenance window, put the p_rabbitmq-server primitive
   in unmanaged state at one of the controller nodes:
   ::

       pcs resource unmanage master_p_rabbitmq-server

   or with the crm tool:
   ::

       crm resource unmanage master_p_rabbitmq-server

   .. note:: Normally, the crm tool can be installed from the
     crmsh package, by commands:
     ::

         yum install crmsh || apt-get install crmsh

#. Check the status. It should show p_rabbitmq-server primitives
   as "Unmanaged":
   ::

       pcs resource show

   or with the crm tool:
   ::

       crm_mon -1

   Unmanaged p_rabbitmq-server resources should look like:
   ::

          Master/Slave Set: master_p_rabbitmq-server [p_rabbitmq-server] (unmanaged) \
              p_rabbitmq-server  (ocf::fuel:rabbitmq-server):    Master node-1 (unmanaged) \
              p_rabbitmq-server  (ocf::fuel:rabbitmq-server):    Slave node-2 (unmanaged) \
              p_rabbitmq-server  (ocf::fuel:rabbitmq-server):    Slave node-3 (unmanaged) \

#. Download the latest OCF script from the fuel-library repository
   to the Fuel Master node:
   ::

       wget --no-check-certificate -O /etc/puppet/modules/nova/files/ocf/rabbitmq \
       https://raw.githubusercontent.com/stack\
       forge/fuel-library/stable/6.0/deployment/puppet/nova/files/ocf/rabbitmq
       chmod +x /etc/puppet/modules/nova/files/ocf/rabbitmq

   .. note:: For the Fuel 5.1 release update the link to use
             a "5.1" version in the download path.

#. Copy the script to all controllers:
   ::

       for i in $(fuel nodes --env <env_ID> | awk '/ready.*controller.*True/{print $1}'); \
       do scp /etc/puppet/modules/nova/files/ocf/rabbitmq \
{'fraction_non_alphanumeric': 0.09570591031532245, 'fraction_numerical': 0.006021232768182538, 'mean_word_length': 2.967316153362665, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '406935', 'n_tokens_mistral': 2014, 'n_tokens_neox': 1835, 'n_words': 685}