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 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 Inventory File Template file.
Below are list of prerequisites required for creating the VM's and installing the MySQL Cluster.
- VM's needed for installing the MySQL Cluster will be created as part of the VM creation procedures Install VMs for MySQL Nodes and Management Server.
- 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. - The host running the docker image must have docker installed.
- A defined and installed site hosts.ini inventory file should also be present..
- Download MySQL Cluster
Manager software as specified in
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
- db-install container will deploy MySQL cluster in these VM's as per configuration provided in the Inventory File Preparation file.
- The steps below will install different MySQL Cluster nodes(Management nodes, Data nodes and SQL nodes) in these VM's.
- MySQL NDB Cluster : https://dev.mysql.com/doc/refman/5.7/en/mysql-cluster.html
- MySQL Cluster Manager: https://dev.mysql.com/doc/mysql-cluster-manager/1.4/en/
Table 3-12 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 Installation PreFlight Checklist |
|||
2 ![]() |
Check if MySQL Cluster node VM's are created |
Check if MySQL Cluster node VM's are created in the Kuberentes Master nodes and Storage Hosts.
|
|||
3 ![]() |
Create MySQL Cluster Node VM | If VM's are not created then follow below steps to create MySQL Cluster Node VM's in kubernetes Master nodes and Storage Hosts. Execute Install VMs for MySQL Nodes and Management Server for Installing VM's. | |||
4 ![]() |
Configure
occne_mysqlndb_DataMemory
variable in the hosts.ini file
|
Check the
Configure
|
|||
5 ![]() |
Note down the db install container name | Note down the db install container name as
specified in the manifest.
|
|||
6 ![]() |
Configure the MySQL NDB Cluster with predefined database | To configure the MySQL NDB Cluster with
predefined database, tables and configurations related to different NF's, the
.sql scripts can be copied in to the initdb_once and initdb directories. The
.sql scripts in the initdb_once directory will be deleted after db_install
container execute the .sql scripts.
$ sudo su $ mkdir -p /var/occne/<cluster_name>/initdb_once $ mkdir -p /var/occne/<cluster_name>/initdb $ cp <source_path>/initdb_once/*.sql /var/occne/<cluster_name>/initdb_once/ $ cp <source_path>/initdb/*.sql /var/occne/<cluster_name>/initdb/ Example: $ sudo su $ mkdir -p /var/occne/rainbow/initdb_once $ mkdir -p /var/occne/rainbow/initdb $ cp /var/occne/nfscripts/initdb_once/*.sql /var/occne/<cluster_name>/initdb_once/ $ cp /var/occne/nfscripts/initdb/*.sql /var/occne/<cluster_name>/initdb/ Note: The *.sql scripts should be copied in to the bastion host, so the db_install container can create the databases, tables and configurations in the MySQL NDB Cluster. |
|||
7 ![]() |
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.
|
|||
8 ![]() |
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.2.0 \ /test/cluster_test |
|||
9 ![]() |
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.
Perform this step for all the remaining SQL nodes. Note:
Here
|
Uninstall MySQL Cluster Manager and MySQL NDB Cluster
Table 3-13 Uninstall MySQL Cluster Manager and MySQL NDB Cluster
Step | Procedure | Description |
---|---|---|
1 ![]() |
Login in to the Bastion host | Login in to the Bastion host, IP address of this bastion host is noted in the Installation PreFlight Checklist |
2 ![]() |
Run db_install | Run db_install docker container
$ 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> /bin/bash 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.2.0 /bin/bash |
3 ![]() |
Uninstall MYSQL NDB Cluster | Un-install MySQL NDB Cluster.
$ ansible-playbook -i /host/hosts.ini --become --become-user=root \ --private-key /host/.ssh/occne_id_rsa /occne/cleanup.yaml $ exit |