Installing Shared RDBMS

This topic describes how to install the Shared RDMBS feature for HPE Ezmeral Runtime Enterprise. The Shared RDBMS feature is a common backend database service for application components across Kubernetes compute clusters.

Prerequisites:
  • Required access rights: Kubernetes Administrator
  • Kubernetes cluster software requirements:
    • Host OS is a minimum of RHEL 8 or SUSE 15 (SP2 or SP3)
    • Storage Class is configured (Data Fabric or any other CSI)
    • Helm 3

About Shared RDBMS

IMPORTANT Install the Shared RDBMS feature (MySQL CE Operator 8.0.30) only one time per HPE Ezmeral Runtime Enterprise installation.

The Shared RDBMS feature provides common storage for ML components to manage metadata, and is accessible across Kubernetes clusters within HPE Ezmeral Runtime Enterprise.

The following HPE Ezmeral Runtime Enterprise components use the Shared RDBMS feature:
  • Secure Model Management
  • EzSQL

Installing Shared RDBMS

  1. On a Kubernetes cluster master node, download the MySQL application bundle:
    # wget https://ezml-release.s3.amazonaws.com/5.6.0/mysql-cluster-ere560.tar.gz
    
    # tar  xvzf mysql-cluster.tar.gz && cd mysql-cluster 
  2. (Optional): Before installing the Shared RDBMS feature, you can customize parameters for your InnoDB cluster. You can perform customization based on factors such as size of Kubernetes cluster, number of applications, or load of read/write operations.

    To customize parameters, review and update values.yaml under the InnoDB chart. See Customizing InnoDB Values.

  3. On a HPE Ezmeral Runtime Enterprise Kubernetes cluster master node, run the ezmysql installation script:
    # ./ezmysql_install.sh
    The script prompts you to enter a password. Make a note of the password that you use.
    The script performs the following:
    • Creates a namespace ezmysql
    • Installs MySQL Operator
    • Installs MySQL InnoDB Cluster
    • Configures the router for HA
    • Configures HPA for auto-scaling
    • Provides a Gateway endpoint of MySQL instance for connectivity
  4. To check that the MySQL server is accessible after successful install, you can verify MySQL cluster connectivity. To verify connectivity, use one of the following options:
    • Option 1: Use the MySQL endpoint details provided from the step 3 output and the same password given during installation in step 3:
      mysql -u <user-name> -p -h <host> -P <port>
      For example:
      # mysql -u root -p -h example.hpecorp.net -P 10022
    • Option 2: Use a different client or application with root as the username and password.
  5. (Optional) You can upgrade the MySQL version for your Shared RDBMS installation. Proceed as follows to upgrade the MySQL version from version 8.0.30 to version 8.0.31:
    1. Download and extract the latest MySQL version:
      # wget https://ezml-release.s3.amazonaws.com/5.6.0/mysql-cluster-ere560.tar.gz;tar -zxvf mysql-cluster-ere560.tar.gz;cd mysql-cluster;chmod +x ezmysql_upgrade.sh
    2. Start the MySQL version upgrade:
      # sh ezmysql_upgrade.sh
      The upgrade completes in about 10 minutes.

Customizing InnoDB Values

You can customize the following parameters by using ./mysql-innodbcluster/values.yaml:
  • User name: The default value is root.
    credentials: 
      root: 
        user: root 
  • Instances: You can change server and router instances.
    • Server instances refers to the number of MySQL servers required.
    • Routers are used to control the communication between MySQL servers for load balancing.
    serverInstances: 3 
    routerInstances: 1 
  • Storage size: You can update the storage size for MySQL InnoDB clusters. Data volume is used for persistent storage of application data.

    The default value is 40Gi.

    datadirVolumeClaimTemplate: 
      accessModes: ReadWriteOnce 
      resources: 
        requests: 
          storage: 40Gi 
  • Resource limits: You can update resource parameters such as CPU and memory according to your requirements.

    The default value for memory is 3G and the default value for CPU is 400m.

    resource: 
        request: 
          memory: "2G" 
          cpu: "200m" 
        limits: 
          memory: "3G" 
          cpu: "400m" 
  • Replicas: You can increase the number of replicas in case of high load.

    The default setting is minReplicas: 3 and maxReplicas: 5.

    hpa: 
      spec: 
        maxReplicas: 5 
        minReplicas: 3 
        metricsCpuAverageUtilization: 70 
        metricsMemoryAverageUtilization: 70

    For best performance, do not change the values for metricsCpuAverageUtilization and metricsMemoryAverageUtilization.

Creating Backups and a Backup Schedule

Update backup PVC size and schedule: The default PVC value is 100Gi and default backup frequency is one time per day. For example:
backup: 
  schedule: "0 1 * * *" 
  pvcSize: 100Gi
Editing the backup schedule:
NOTE Before editing the backup schedule, ensure that MySQL is running and has backups scheduled.
  • If you want to stop the backup scheduler or change the backup frequency, you can edit cronjob.batch/sqlapp-backup-job with the following command:
    #kubectl edit cronjob.batch/sqlapp-backup-job -n ezmysql
  • To suspend the backup scheduler, look for the suspend key and set it to True.
  • To change the frequency of backup, edit the schedule key values.
For example:
schedule: "0 2 * * *" 
suspend: false 
Restoring the MySQL database from backup:
You can restore a database from a backup dump by running the following script:
# ./ezmysql_restore.sh
This script restores the MySQL database from the backup taken on the PVC. You can fetch the full backup from the following tenant share path:
path: /opt/bluedata/mapr/mnt/<df-cluster>/<pvc-volume-path>/<backup-dump>
For example:
/opt/bluedata/mapr/mnt/df01/844d9e48-k8s-6--sklyrckwmf/EZML_14102022_06_40/

Uninstalling MySQL Operator and MySQL InnoDB Cluster

IMPORTANT Do not uninstall MySQL Operator and MySQL InnoDB Cluster unless you are performing a POC or other test.
NOTE The uninstallation script is customized for ezmysql namespaces only. Namespaces are cleaned after each uninstall, and PVCs are deleted.

To uninstall MySQL Operator and MySQL InnoDB Cluster, proceed as follows:

  1. Run the uninstallation script:
    # ./ezmysql_uninstall.sh 
    The following actions are performed:
    • Uninstalls MySQL InnoDB Cluster
    • Uninstalls MySQL Operator
    • Deletes PVCs
  2. On successful uninstallation, the following message appears:
    No resources found in ezmysql namespace.