Go to primary content
Oracle® Communications OC-CNE Installation Guide
Release 1.0
F16979-01
Go To Table Of Contents
Contents

Previous
Previous
Next
Next

Database Tier Installer

Prerequisites

This procedure documents the steps for installing the MySQL Cluster on VM's. Here VM's will be created manually using the virt-install CLI tool; MySQL Cluster will be installed using the db-install docker container.

For Installing the MySQL Cluster on these VM's requires an use of the an inventory file (hosts.ini) where all the MySQL node IP Address are configured. This Inventory file provides the db-install docker container with all the necessary information about the MySQL cluster.

MySQL Cluster will be installed using the MySQL Cluster Manager binary release which includes MySQL NDB Cluster version. Download MySQL Cluster Manager version as specified in the OCCNE 1.0 Installation PreFlight Checklist.

In OCCNE platform, all the NF's will need a database to store application data, so MySQL Cluster is installed for storing all the application and config data for NF's. For installing MySQL Cluster, VM's will be created in kubernetes master nodes and Database Servers as configured in the OCCNE Inventory File Template file.

Below are list of prerequisites required for creating the VM's and installing the MySQL Cluster.

  1. VM's needed for installing the MySQL Cluster will be created as part of the VM creation procedures OCCNE Install VMs for MySQL Nodes and Management Server.
  2. SSH keys generated during the host provisioning in /var/occne/<cluster_name> directory, these SSH keys will be configured in these VM's as part of the OCCNE Install VMs for MySQL Nodes and Management Server, so that db-install container can install these VM's with the MySQL Cluster software.
  3. The host running the docker image must have docker installed.
  4. A defined and installed site hosts.ini inventory file should also be present..
  5. Download MySQL Cluster Manager software as specified in OCCNE 1.0 Installation PreFlight Checklist and place it in the /var/occne directory in bastion host(Management VM).

Limitations and Expectations

References

Steps to perform OCCNE Database Tier Installer

  1. db-install container will deploy MySQL cluster in these VM's as per configuration provided in the OCCNE Inventory File Template file.
  2. The steps below will install different MySQL Cluster nodes(Management nodes, Data nodes and SQL nodes) in these VM's.

Table 3-13 OCCNE Database Tier Installer

Step # Procedure Description

1

Login in to the Management Node

Login in to the Management Node using the IP address noted in the OCCNE 1.0 Installation PreFlight Checklist

2

Configure occne_mysqlndb_DataMemory variable in the hosts.ini file

Check the /var/occne/<cluster_name> directory which has been created during the os install procedure, as specified in the OCCNE Oracle Linux OS Installer, this directory consists of the hosts.ini inventory file and SSH keys generated during the os-install, which will be used by db-install container to install MySQL Cluster.

Configure occne_mysqlndb_DataMemory variable in the hosts.ini file as documented in OCCNE Inventory File Preparation, value for this variable can be obtained from the OCCNE Install VMs for MySQL Nodes and Management Server.

3

Note down the db install container name Note down the db install container name as specified in the manifest.
Container Name db_install_container_name db_install:0.1.0-beta.3
Note: This container will be used in the next step while running the db install container which will install MySQL Cluster

4

Run db-install container
The db-install container will install MySQL Cluster on VM's configured in the host.ini inventory file. All the above steps should be performed before running the db-install container. Replace <customer_repo_location> and <db_install_container_name> in below docker command and docker-compose.yaml file.
  1. Using docker
    $ docker run -it --network host --cap-add=NET_ADMIN \
    -v /var/occne/<cluster_name>:/host \
    -v /var/occne:/var/occne:rw \
    <customer_repo_location>/<db_install_container_name>
    For Example:
    $ docker run -it --network host --cap-add=NET_ADMIN \
    -v /var/occne/rainbow/:/host \
    -v /var/occne:/var/occne:rw \
    reg-1:5000/db_install:1.0.1
  2. Using docker-compose
    1. Create a docker-compose.yaml file in the /var/occne/<cluster_name> directory.

      Using docker-compose
      $ vi docker-compose.yaml
      db_install_<cluster_name>:
        net: host
        stdin_open: true
        tty: true
        image: <customer_repo_location>/<db_install_container_name>
        container_name: <cluster_name>_db_installer
        cap_add:
          - NET_ADMIN
        volumes:
          - /var/occne/<cluster_name>:/host
          - /var/occne:/var/occne:rw
      Note: In above docker-compose.yaml file cluster_name should be replaced with the cluster directory name.
    2. Run the docker-compose yaml file
      Running docker-compose
      $ docker-compose run --rm db_install_<cluster_name>

      For example:

      If the directory name created as OccneCluster then cluster_name should be replaced with "OccneCluster".
      $ docker-compose run --rm db_install_<cluster_name>

    db_install container will take around 5 to 10 mins for installing the MySQL Cluster nodes in these VM's, After db_install container is completed MySQL DB is installed in the VM's as configured in the hosts.ini file.

5

Test the MySQL Cluster Test the MySQL Cluster by executing the following command:
$ docker run -it --network host --cap-add=NET_ADMIN \
-v /var/occne/<cluster_name>:/host \
-v /var/occne:/var/occne:rw \
<customer_repo_location>/<db_install_container_name> \
/test/cluster_test 0
For Example:
$ docker run -it --network host --cap-add=NET_ADMIN \
          -v /var/occne/rainbow:/host \
          -v /var/occne:/var/occne:rw \
          reg-1:5000/db_install:1.0.1 \
          /test/cluster_test

6

Login to the each of the MySQL SQL nodes and change the MySQL root user password
As part of the installation of the MySQL Cluster, db_install container will generate the random password and marked as expired in the MySQL SQL nodes. This password is stored in /var/occnedb/mysqld_expired.log file. so we need to login to the each of the MySQL SQL nodes and change the MySQL root user password.
  1. Login to MySQL SQL Node VM.
  2. Login to mysql client as a root user.
    $ sudo su
    $ mysql -h 127.0.0.1 -uroot -p
  3. Enter expired random password for mysql root user stored in the /var/occnedb/mysqld_expired.log file:
    $ mysql -h 127.0.0.1 -uroot -p
     Enter password:
  4. Change Root Password:
    $ mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '<NEW_PASSWORD>';
    $ mysql> FLUSH PRIVILEGES;

Perform this step for all the remaining SQL nodes.

Note: Here NEW_PASSWORD is the password of the mysql root user.