Upgrading in-place Metric Insights v6.x Deployed in an Orchestrated Environment

This article covers in detail how to upgrade in-place Metric Insights v6.x deployed in an orchestrated environment.

In order to upgrade your Metric Insights application, you will need to:

  1. Create a backup
  2. Download and unpack the new MI installer
  3. Run the installer according to the system's deployment type, see the examples:

For information on upgrading non-orchestrated environments (also known as Simple Install) refer to Upgrading-in-place Metric Insights v6.x.

Note: Make sure that the .env files and secrets are valid and do not need to be re-created before updating the Metric Insights application.

1. Create a Backup of Metric Insights

Make sure that a backup already exists, or create a new one by running:

$ mi-app-backup -vv

Note: Backups are stored in /opt/mi/backup.

2. Download and Unpack the Metric Insights v6.x Installer

Contact Metric Insights Support for the v6.x installer. Once you receive the download link, download the install package and copy it to the MI server.

Untar the MI v6 install package by running the following tar command:

$ tar xvf MetricInsights-Installer-v6.x.x-Full.tar.gz

Move to the v6.2.1 install directory:

$ cd MetricInsights-Installer-v6.x.x-Full

3. Run the Installer

If your application's architecture has not changed, run the same installer command that has been used before, otherwise, proceed with the commands described below according to the application's deployment type.

Upgrading MI Deployed on Kubernetes

Before running the installer,  identify what timezone the Metric Insights application should be in. Note the timezone values to use below.

  • If the remote DB server has the same timezone as MI app:

./installer.py kubernetes --storage-class nfs  --nfs-server-address <nfs.example.com> --ingress-controller-type  nginx --hostname <MI-hostname> --dp-hostname  <dataprocessor_hostname> --registry <registry-url>  --timezone  <MI app timezone> -o <manifest filename>.yml

  • If the remote DB server has a different timezone than MI app:

./installer.py kubernetes --storage-class nfs  --nfs-server-address <nfs.example.com> --ingress-controller-type  nginx --hostname <MI-hostname> --dp-hostname  <dataprocessor_hostname> --registry <registry-url>  --timezone <MI app timezone> --mysql-timezone <remote database  server timezone> -o <manifest filename>.yml

The key here is using the -o option for the output file and then specifying a file name with a *.yml extension (yaml file).

See ./installer.py kubernetes --help for more options.

Next, deploy the Metric Insights application to the K8 namespace using the newly created deployment configuration file:

$ kubectl --namespace <MI-namespace> apply -f <manifest filename>.yml 
Upgrading MI Deployed on OpenShift

To create a deployment configuration file (also called a  manifest), use the Metric Insights installer to generate a yaml file. Here's an example where we are setting the following values:

  • Kubernetes Type = openshift
  • Storage Type = NFS
  • NFS server address = 192.168.33.10
  • Private Docker Registry

OpenShift 3:

If the remote DB server has the same timezone as MI app: 

./installer.py kubernetes --type openshift --storage-class nfs  --nfs-server-address <nfs.example.com> --ingress-controller-type  nginx --hostname <MI-hostname> --dp-hostname  <dataprocessor_hostname> --registry <registry-url>  --timezone <MI app timezone> -o <manifest filename>.yml

If the remote DB server has a different timezone than MI app:

./installer.py kubernetes --type openshift --storage-class nfs  --nfs-server-address <nfs.example.com> --ingress-controller-type  nginx --hostname <MI-hostname> --dp-hostname  <dataprocessor_hostname> --registry <registry-url>  --timezone <MI app timezone> --mysql-timezone <remote  databaseserver timezone> -o <manifest filename>.yml

OpenShift 4:

If the remote DB server has the same timezone as MI app: 

./installer.py kubernetes --storage-class nfs --nfs-server-address <nfs.example.com> --ingress-controller-type  nginx --hostname <MI-hostname> --dp-hostname  <dataprocessor_hostname> --registry <registry-url>  --timezone <MI app timezone> -o <manifest filename>.yml

If the remote DB server has a different timezone than MI app:

./installer.py kubernetes --storage-class nfs  --nfs-server-address <nfs.example.com> --ingress-controller-type  nginx --hostname <MI-hostname> --dp-hostname  <dataprocessor_hostname> --registry <registry-url>  --timezone <MI app timezone> --mysql-timezone <remote  databaseserver timezone> -o <manifest filename>.yml

The key here is using the -o option for the output file and then specifying a file name with a *.yml extension (yaml file).

Run ./installer.py kubernetes --help to see the list of available installer options.

Next, deploy the Metric Insights application by applying the newly created deployment configuration file:

$ oc apply -f application.yml 
Upgrading MI Deployed on Docker Swarm
  • If the remote DB server has the same timezone as MI app: ./installer.py swarm --timezone <MI app timezone> -o <manifest filename>.yml
  • If the remote DB server has a different timezone than MI app: ./installer.py swarm --timezone <MI app timezone> --mysql-timezone <remote database server timezone> -o <manifest filename>.yml
  • If the Metric Insights Docker images will be pulled from a private Docker registry, use the --registry option along with the Docker registry URL as in ./installer.py swarm... --registry docker.metricinsights.com. When providing a registry URL, be sure to not include “https://.” The supported values are <hostname> or <hostname>:<port> without any protocol.

Note: Run ./installer.py swarm --help to see the list of available installer options.

To deploy docker swarm using the deployment manifest, use the docker stack deploy command:

$ docker stack deploy -c mi-swarm.yml --with-registry-auth mi
Upgrading MI Deployed on Amazon ECS (Terraform, Cloudformation)
HashiCorp Terraform
  1. Run the installer:
./installer.py ecs --type terraform -o ./modules/metricinsights/
  1. Create Terraform execution plan:
$ terraform plan
  1. Apply the created plan:
$ terraform apply
Cloudformation
  • If the remote DB server has the same timezone as MI app: ./installer.py ecs --timezone <MI app timezone> -o <manifest filename>.json
  • If the remote DB server has a different timezone than MI app: ./installer.py  ecs --timezone <MI app timezone> --mysql-timezone <remote  database server timezone> -o <filename>.json

Note: Run ./installer.py ecs --help to see the list of available installer options.

Once the manifest is generated, apply it via AWS console.