File: install_and_configure_ubuntu.rst

package info (click to toggle)
masakari 20.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,816 kB
  • sloc: python: 22,459; sh: 329; makefile: 68
file content (251 lines) | stat: -rw-r--r-- 9,861 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
.. _install-ubuntu:

Install and configure for Ubuntu
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This section describes how to install and configure Masakari for Ubuntu
18.04 (bionic).

Prerequisites
-------------

Before you install and configure the masakari service, you must create
databases, service credentials, and API endpoints.

#. To create the masakari database, follow these steps:

   * Use the database access client to connect to the database server
     as the ``root`` user:

     .. code-block:: console

        # mysql

   * Create the ``masakari`` database:

     .. code-block:: console

        mysql> CREATE DATABASE masakari CHARACTER SET utf8;

   * Grant access privileges to the databases:

     .. code-block:: console

        mysql> GRANT ALL PRIVILEGES ON masakari.* TO 'username'@'localhost' \
          IDENTIFIED BY 'MASAKARI_DBPASS';
        mysql> GRANT ALL PRIVILEGES ON masakari.* TO 'username'@'%' \
          IDENTIFIED BY 'MASAKARI_DBPASS';

     Replace ``MASAKARI_DBPASS`` with a suitable password.

   * Exit the database access client.

#. Source the ``admin`` credentials to gain access to admin-only CLI commands:

   .. code-block:: console

      $ . admin-openrc

#. Create the Masakari service credentials:

   * Create the ``masakari`` user with password as ``masakari``:

     .. code-block:: console

        $ openstack user create --password-prompt masakari

        User Password:
        Repeat User Password:
        +---------------------+----------------------------------+
        | Field               | Value                            |
        +---------------------+----------------------------------+
        | domain_id           | default                          |
        | enabled             | True                             |
        | id                  | 8a7dbf5279404537b1c7b86c033620fe |
        | name                | masakari                             |
        | options             | {}                               |
        | password_expires_at | None                             |
        +---------------------+----------------------------------+

   * Add the ``admin`` role to the ``masakari`` user:

     .. code-block:: console

        $ openstack role add --project service --user masakari admin

   * Create the ``masakari`` service entity:

     .. code-block:: console

        $ openstack service create --name masakari \
        --description "masakari high availability" instance-ha

        +-------------+----------------------------------+
        | Field       | Value                            |
        +-------------+----------------------------------+
        | description | masakari high availability       |
        | enabled     | True                             |
        | id          | 060d59eac51b4594815603d75a00aba2 |
        | name        | masakari                         |
        | type        | instance-ha                      |
        +-------------+----------------------------------+

#. Create the Masakari API service endpoints:

   .. code-block:: console

      $ openstack endpoint create --region RegionOne \
        masakari public http://<CONTROLLER_IP>/instance-ha/v1/$\(tenant_id\)s

      +--------------+-------------------------------------------------------+
      | Field        | Value                                                 |
      +--------------+-------------------------------------------------------+
      | enabled      | True                                                  |
      | id           | 38f7af91666a47cfb97b4dc790b94424                      |
      | interface    | public                                                 |
      | region       | RegionOne                                             |
      | region_id    | RegionOne                                             |
      | service_id   | 060d59eac51b4594815603d75a00aba2                      |
      | service_name | masakari                                              |
      | service_type | instance-ha                                           |
      | url          | http://<CONTROLLER_IP>/instance-ha/v1/$(tenant_id)s   |
      +--------------+-------------------------------------------------------+

      $ openstack endpoint create --region RegionOne \
        masakari internal http://<CONTROLLER_IP>/instance-ha/v1/$\(tenant_id\)s

      +--------------+-------------------------------------------------------+
      | Field        | Value                                                 |
      +--------------+-------------------------------------------------------+
      | enabled      | True                                                  |
      | id           | 38f7af91666a47cfb97b4dc790b94424                      |
      | interface    | internal                                              |
      | region       | RegionOne                                             |
      | region_id    | RegionOne                                             |
      | service_id   | 060d59eac51b4594815603d75a00aba2                      |
      | service_name | masakari                                              |
      | service_type | instance-ha                                           |
      | url          | http://<CONTROLLER_IP>/instance-ha/v1/$(tenant_id)s   |
      +--------------+-------------------------------------------------------+

      $ openstack endpoint create --region RegionOne \
        masakari admin http://<CONTROLLER_IP>/instance-ha/v1/$\(tenant_id\)s

      +--------------+-------------------------------------------------------+
      | Field        | Value                                                 |
      +--------------+-------------------------------------------------------+
      | enabled      | True                                                  |
      | id           | 38f7af91666a47cfb97b4dc790b94424                      |
      | interface    | admin                                                 |
      | region       | RegionOne                                             |
      | region_id    | RegionOne                                             |
      | service_id   | 060d59eac51b4594815603d75a00aba2                      |
      | service_name | masakari                                              |
      | service_type | instance-ha                                           |
      | url          | http://<CONTROLLER_IP>/instance-ha/v1/$(tenant_id)s   |
      +--------------+-------------------------------------------------------+

Install and configure Masakari
------------------------------

.. note::

   * You must install Masakari on the Controller Nodes only.

#. Clone masakari using:

   .. code-block:: console

      # git clone https://opendev.org/openstack/masakari.git

#. Prepare the masakari configuration files:

   #. Generate via tox:

      Go to ``/opt/stack/masakari`` and execute the command below.
      This will generate ``masakari.conf.sample``, a sample configuration file,
      at ``/opt/stack/masakari/etc/masakari/``:

      .. code-block:: console

         # tox -egenconfig

   #. Download from:

      # :download:`masakari.conf.sample </_static/masakari.conf.sample>`

   #. Rename ``masakari.conf.sample`` file to ``masakari.conf``,
      and edit sections as shown below:

      .. code-block:: ini

         [DEFAULT]
         transport_url = rabbit://stackrabbit:admin@<CONTROLLER_IP>:5672/
         graceful_shutdown_timeout = 5
         os_privileged_user_tenant = service
         os_privileged_user_password = admin
         os_privileged_user_auth_url = http://<CONTROLLER_IP>/identity
         os_privileged_user_name = nova
         logging_exception_prefix = %(color)s%(asctime)s.%(msecs)03d TRACE %(name)s [01;35m%(instance)s[00m
         logging_debug_format_suffix = [00;33mfrom (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d[00m
         logging_default_format_string = %(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s [[00;36m-%(color)s] [01;35m%(instance)s%(color)s%(message)s[00m
         logging_context_format_string = %(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s [[01;36m%(request_id)s [00;36m%(project_name)s %(user_name)s%(color)s] [01;35m%(instance)s%(color)s%(message)s[00m
         use_syslog = False
         debug = True
         masakari_api_workers = 2

         [database]
         connection = mysql+pymysql://root:admin@1<CONTROLLER_IP>/masakari?charset=utf8

         [keystone_authtoken]
         memcached_servers = localhost:11211
         cafile = /opt/stack/data/ca-bundle.pem
         project_domain_name = Default
         project_name = service
         user_domain_name = Default
         password = <MASAKARI_PASS>
         username = masakari
         auth_url = http://<CONTROLLER_IP>/identity
         auth_type = password

         [taskflow]
         connection = mysql+pymysql://root:admin@<CONTROLLER_IP>/masakari?charset=utf8

      .. note::

         Replace ``CONTROLLER_IP`` with the IP address of controller node.

         Replace ``MASAKARI_PASS`` with the password you chose for the
         ``masakari`` user in the Identity service.

   #. Create ``masakari`` directory in /etc/:

      Copy ``masakari.conf`` file to ``/etc/masakari/``

      .. code-block:: console

         # cp -p etc/masakari/masakari.conf.sample /etc/masakari/masakari.conf

#. To install masakari run setup.py from masakari:

   .. code-block:: console

      # cd masakari
      # sudo python -m pip install -r requirements.txt
      # sudo python setup.py install

#. Run below db command to sync database:

   .. code-block:: console

      # masakari-manage db sync

Finalize installation
---------------------

* Start masakari services:

  .. code-block:: console

     # masakari-api
     # masakari-engine