Single Server Docker Deployment (Simple Install)

This article details how to deploy the Metric Insights application on a single server. Because this is a non-orchestrated deployment (meaning there is no automated management of the containers), it is called 'Simple Install'.

PREREQUISITES: 

For servers without outbound access, the host machine must have the following packages installed manually to support the application:

For servers with outbound access, the packages above are installed by the Metric Insights installer automatically. 

Please ensure enough disk space is available for the following directories (if configured as separate partitions), as mentioned in What are the system requirements for a Metric Insights server?:

  • /var/lib 
  • /opt or /app
  • /home
  • /tmp

https://docs.docker.com/compose/install/

https://docs.docker.com/engine/install/centos/

Table of contents:

Simple Installation Architecture

  1. Architecture Diagram for v6
  2. Architecture Diagram for v7
  3. Connect to the Server via SSH
  4. Download the Installation Package of the Metric Insights Application
  5. Unzip the Archive and Download it to the Server
  6. Deploy the Metric Insights Application
  7. Basic Console Commands
  8. Security

Supported Operating System Versions

MI Version CentOS RHEL Oracle Linux Ubuntu Debian Amazon Linux
v6 CentOS 7* RHEL 7*, 8, 9 Oracle Linux 7, 8, 9 Ubuntu 20.04, 22.04, 24.04
Debian 10, 11, 12
Amazon Linux 2, Amazon Linux 2023
v7 - RHEL 8, 9 Oracle Linux 7, 8, 9 Ubuntu 20.04, 22.04, 24.04 Debian 11, 12 Amazon Linux 2, Amazon Linux 2023

* CentOS 7 and RHEL 7 are supported by v6.4.5 installation package, but these OS versions are no longer supported officially by their maintainers.

Simple Installation Architecture

See the architecture diagram for your MI application version:

Architecture Diagram for v6

The deployment scheme consists of the following services deployed as individual containers (1 service per container):

Required services:

  1. Web Master
  2. Web Slave
  3. Data Analyzer
  4. Data Processor
  5. Seed
  6. MySQL 
  7. Monitoring
  8. Redis

Optional services:

  1. Remote Data Processor (for BI Tools that require integrating from a Windows environment instead of Linux)

If you are using a Firewall on the Linux machine, the following ports are necessary for Metric Insights to work correctly:

  • 80, 443 - HTTP and HTTPS ports for the Web Application (by default redirection to 443)
  • 32550 - TCP port for the Data Processor service
  • 32551 - TCP port for the Seed service
  • 3306 - MySQL port for external access to the database
  • 8081 - TCP port for the Monitoring service (separate GUI service that admins can use to monitor the health of the application containers in a browser)

Architecture Diagram for v7

The deployment scheme consists of the following services deployed as individual containers (1 service per container):

Required services:

  1. Web Master
  2. Web Slave
  3. Data Analyzer
  4. Data Processor
  5. MySQL 
  6. Console
  7. Redis
  8. Image Generator

Optional services:

  1. Remote Data Processor (for BI Tools that require integrating from a Windows environment instead of Linux)

If you are using a Firewall on the Linux machine, the following ports are necessary for Metric Insights to work correctly:

  • 80, 443 - HTTP and HTTPS ports for the Web Application (by default redirection to 443)
  • 32550 - TCP port for the Data Processor service
  • 3306 - MySQL port for external access to the database
  • 8081 - TCP port for the Console service

1. Connect to the Server via SSH

The Metric Insights application must be installed as user root or as a user with sudo privileges (added to the wheel or sudo group, thereby included in the sudoers list). The Docker daemon binds to a Unix socket instead of a TCP port, therefore Unix sockets are owned by user root and accessible by users with sudo privileges.

Connect to the server using  ssh root@<server_ip>.

2. Download the Installation Package of the Metric Insights Application

See the download instructions for your MI application version:

Download v6 Installation Package

  1. Depending on the version, you are provided with a link to the corresponding installation package
  2. Enter Username and Password that are provided by the Metric Insights support team
  3. Confirm the agreement with the Terms and Conditions of the Metric Insights usage
  4. [Submit]. After you click the button, the .tar.gz archive with all Docker images and binaries will be downloaded to the local host.  

Download v7 Installation Package

Access https://get.metricinsights.com/ to download the installation package.

3. Unzip the Archive and Download it to the Server

Typically, the Metric Insights installation package is uploaded to the server as a tar ball file as in MetricInsights-Installer-vX.X.X-Full.tar.gz.

  • When this tar ball has been placed on the server, please unzip the tar ball with the command tar -xvf MetricInsights-Installer-vX.X.X-Full.tar.gz.
  • Once the tar ball file has been unzipped, then please go inside the installer directory with the command cd MetricInsights-Installer-vX.X.X-Full
  • Once inside the installer directory, proceed to Step 4 below

See the description of installation package contents for your MI application version:

Installation Package Contents for v6

Folder/file title  Name
base  Folder with default /opt/mi file system for the Metric Insights application.
data Folder with binaries and miscellaneous data.
scripts Folder with a set of auxiliary scripts.
utils  Folder with common libraries used by installer.py. 
build.propertis File that contains the Metric Insights components versions.
installer

Python script that initializes the deployment process of the Metric Insights application. 

readme Markdown file with the information required to deploy the application and understand the Patcher tool.
uninstaller

Python script that uninstalls the Metric Insights application. 

Installation Package Contents for v7

Folders:

  1. base contains the default /opt/mi file system for the Metric Insights application.
  2. data contains binaries and miscellaneous data, such as:
    • Docker images for MI services, binary files for application launch, and pre-packed binaries for Docker installation
  3. scripts contains a set of auxiliary scripts.
  4. utils contains common libraries used by installer.py

Files:

  1. build.properties contains the Metric Insights components versions.
  2. installer.py is a Python script that initializes the deployment process of the Metric Insights application. 
  3. readme.md is a markdown file with the information required to deploy the application and understand the Patcher tool.
  4. uninstaller.py is a Python script that uninstalls the Metric Insights application.

4. Deploy the Metric Insights Application

It is very important to set a correct timezone for the application when running the installer using the --timezone parameter.

If a database is running on a remote server that has timezone different from the application timezone, specify a timezone of the remote database server using the --mysql-timezone parameter. This is an example of installing the application with MySQL running on a local host where the timezone is set to Pacific Time. Setting the --bind-address to 0.0.0.0 is also key:

./installer.py --bind-address 0.0.0.0 --timezone 'US/Pacific' -vv

Use the ./installer.py --timezone-list command to see the list of available timezones.

  • If MySQL runs on the local host, run sudo ./installer.py --bind-address 0.0.0.0 --timezone <timezone> -vv.
  • If  MySQL runs on a remote database server:
    • If the remote database server has the same timezone as the Metric Insights application: sudo ./installer.py --bind-address 0.0.0.0 --db-hostname <remote DB host> --db-user <remote DB root username> --db-password <remote DB root password> --timezone <timezone> -vv
    • If the remote database server has a different timezone than the application: sudo ./installer.py --bind-address 0.0.0.0 --db-hostname <remote DB host> --db-user <remote DB root username> --db-password <remote DB root password> --timezone <timezone> --mysql-timezone <MySQL timezone> -vv

NOTE: Beginning v6.4.5, if parameter --db-hostname is enabled, you no longer need to specify components using the --components parameter.

Once the installation is complete, you will see a "Metric Insights vX.x.x installed successfully" message.

The "Waiting while all provision actions are completed" can take a while, so it's not so unusual. While it's running, in a separate terminal, tail /opt/mi/log/web.log to see what it's performing.

If you need to customize some processes after the application deployment, see Configuring Custom Components article.  

5. Basic Console Commands

Basic console commands can be checked by running ./installer.py -h.

NOTES:

  • The following list of utilities are available to use on the host.
  • All of these tools become available only if the Web Component is installed.

See the console commands for your MI application version:

Console Commands for v6

mi-web Wrapper for docker-compose; used to enter the Web docker container directly
mi-dataprocessor Wrapper for docker-compose; used to enter the Data Processor docker container directly
mi-seed Wrapper for docker-compose; used to enter the Seed docker container directly
mi-console Wrapper for docker-compose; used to enter the Monitoring docker container directly
mi-data-analyzer Wrapper for docker-compose; used to enter the Data Analyzer docker container directly
mi-mysql Wrapper for docker-compose; used to enter the MySQL docker container directly, if MySQL is installed locally
mi-redis Wrapper for docker-compose; used to enter the Redis docker container directly
mi-control Wrapper for docker-compose; used to manage Metric Insights docker containers (stop, start, restart, etc.)
mi-version Displays the Metric Insights version in the command line

The following list of parameters can be used when running the installer from the Help:

Positional Parameters
kubernetes Metric Insights Kubernetes Deployment Config Generator. Use --help with this command to get more details
ecs Metric Insights ECS Deployment Config Generator. Use --help with this command to get more details.
swarm Metric Insights Swarm Deployment Config Generator. Use --help with this command to get more details.
images Metric Insights Docker Images Manager. Use --help with this command to get more details.
Optional Parameters
-h, --help Show this help message and exit
-v, --verbose Verbose logging (default: False)
-y, --yes Assume "yes" on interactive requests (default: False)
--path INSTALL_PATH Base path for Metric Insights (default: /opt/mi)
--bind-address BIND_ADDRESS General bind address for listening by services (default: 10.8.0.234)
--hostname HOSTNAME Web service additional hostname (default: None)
--dp-hostname DATAPROCESSOR_HOSTNAME Data Processor service hostname for external services (default: 10.8.0.234)
--skip-packages Skip installation of any additional packages (default: False)
--show-packages Show packages required to run Metric Insights (default: False)
--db-ram-config DB_RAM_CONFIG Amount of RAM (integer value in gigabytes) on the Database Server. Options: [12,16,32] (default: None)
--db-dataset-hostname DB_DATASET_HOSTNAME MySQL hostname for Default Dataset Storage (default: mysql)
--db-hostname DB_HOSTNAME MySQL hostname of Database Server (default: mysql)
--db-name DB_NAME MySQL database name (default: dashboard)
--db-port DB_PORT MySQL port for db-hostname (default: 3306)
--db-user-host DB_USER_HOST A part of database username, which allows specifying user host on MySQL side. This string contains special characters or wildcard characters (default: %)
--db-user DB_USER MySQL admin user name to init Metric Insights database (default: root)
--db-dataset-user DB_DATASET_USER MySQL admin user for --db-dataset-hostname
--db-password DB_PASSWORD MySQL admin user password
--db-dataset-password DB_DATASET_PASSWORD MySQL admin user for --db-dataset-hostname
--dp-db-password DP_DB_PASSWORD MySQL dataprocessor user password
--timezone TIME_ZONE Set time zone (default: UTC)
--timezone-list List available Timezones
--mysql-timezone MYSQL_TIME_ZONE Set MySQL time zone if different from application
--restrict-access RESTRICT_ACCESS Comma-separated list of MI services that must not have outside access (default: None)
--unprivileged During install, skip actions that require root access. CAUTION: System must have required packages pre-installed
--seed-hostname DATAPROCESSOR_SEED_HOSTNAME Data Processor seed service hostname for external services (default: 10.8.0.234)
--dp-url DP_URL Set Data Processor REST-API URL (default: http://dataprocessor:8080)
--dp-user DP_USER Data Processor REST-API user (default: dataprocessor)
--dp-password DP_PASSWORD Password for Data Processor REST-API user
--components COMPONENTS Comma-separated list of components to deploy (default: web,mysql,dataprocessor,seed,data-analyzer,monitoring,redis)
--custom-component CUSTOM_COMPONENT Comma-separated list of custom components
--high-load Enable high-load configuration for Web service
--use-prior-command Use the last installation command
--show-prior-command Show the last installation command
--tmpdir TMP_FOLDER Specify the temp directory for MI services (default: /opt/mi/data/tmp)
--no-proxy NO_PROXY Comma-separated list of components which should not be accessed via proxy (default: localhost,127.0.0.1,web,dataprocessor,seed,monitoring,data-analyzer)
--proxy-server-address PROXY_SERVER_ADDRESS Proxy server address
--disable-logger Disable logger service for collecting logs
--setup Install and configure system packages without deploying the application
--privileged Enable privileged mode for all containers

Console Commands for v7

mi-web Wrapper for docker-compose; used to enter the Web docker container directly
mi-dataprocessor Wrapper for docker-compose; used to enter the Data Processor docker container directly
mi-console Wrapper for docker-compose; used to enter the Console docker container directly
mi-data-analyzer Wrapper for docker-compose; used to enter the Data Analyzer docker container directly
mi-mysql Wrapper for docker-compose; used to enter the MySQL docker container directly, if MySQL is installed locally
mi-image-generator Wrapper for docker-compose; used to enter the Image Generator docker container directly
mi-redis Wrapper for docker-compose; used to enter the Redis docker container directly
mi-control Wrapper for docker-compose; used to manage Metric Insights docker containers (stop, start, restart, etc.)
mi-version Displays the Metric Insights version in the command line

The following list of parameters can be used when running the installer from the Help:

Positional Parameters
kubernetes Metric Insights Kubernetes Deployment Config Generator. Use --help with this command to get more details
ecs Metric Insights ECS Deployment Config Generator. Use --help with this command to get more details.
swarm Metric Insights Swarm Deployment Config Generator. Use --help with this command to get more details.
images Metric Insights Docker Images Manager. Use --help with this command to get more details.
Optional Parameters
-h, --help Show this help message and exit
-v, --verbose Verbose logging (default: False)
-y, --yes Assume "yes" on interactive requests (default: False)
--path INSTALL_PATH Base path for Metric Insights (default: /opt/mi)
--bind-address BIND_ADDRESS General bind address for listening by services (default: 10.8.0.234)
--hostname HOSTNAME Web service additional hostname (default: None)
--dp-hostname DATAPROCESSOR_HOSTNAME Data Processor service hostname for external services (default: 10.8.0.234)
--skip-packages Skip installation of any additional packages (default: False)
--show-packages Show packages required to run Metric Insights (default: False)
--db-ram-config DB_RAM_CONFIG Amount of RAM (integer value in gigabytes) on the Database Server. Options: [12,16,32] (default: None)
--db-dataset-hostname DB_DATASET_HOSTNAME MySQL hostname for Default Dataset Storage (default: mysql)
--db-hostname DB_HOSTNAME MySQL hostname of Database Server (default: mysql)
--db-name DB_NAME MySQL database name (default: dashboard)
--db-port DB_PORT MySQL port for db-hostname (default: 3306)
--db-user-host DB_USER_HOST A part of database username, which allows to specify user host on MySQL side. This string contains special characters or wildcard characters (such as . or %). (default: %)
--db-user DB_USER MySQL admin user name to init Metric Insights database (default: root)
--db-dataset-user DB_DATASET_USER MySQL admin user for --db-dataset-hostname
--db-password DB_PASSWORD MySQL admin user password
--db-require-secure-transport Force require secure transport for all components. If local MySQL is used, it will be switched to secure mode.
--db-server-ca DB_SERVER_CA Set database server CA filename in /opt/mi/ssl. Not applied for local MySQL. Options --db-client-cert and --db-client-key are required.
--db-client-cert DB_CLIENT_CERT Set database client certificate filename in /opt/mi/ssl. Not applied for local MySQL. Options --db-server-ca and --db-client-key are required.
--db-client-key DB_CLIENT_KEY Set database client key filename in /opt/mi/ssl. Not applied for local MySQL. Options --db-server-ca and --db-client-cert are required.
--db-dataset-password DB_DATASET_PASSWORD MySQL admin user for --db-dataset-hostname
--dp-db-password DP_DB_PASSWORD MySQL dataprocessor user password
--memory-limit MEMORY_LIMIT Semicolon-separated list of MI services with memory limitation. Example: "web:2048M;redis:1024MB;dataprocessor:32G;image-generator:4GB"
--timezone TIME_ZONE Set time zone (default: UTC)
--timezone-list List available Timezones
--mysql-timezone MYSQL_TIME_ZONE Set MySQL time zone if different from application
--restrict-access RESTRICT_ACCESS Comma separated list of MI services that must not have outside access (default: None)
--unprivileged During install, skip actions that require root access. CAUTION: System must have required packages pre-installed
--dp-url DP_URL Set Data Processor REST-API URL (default: http://dataprocessor:8080)
--dp-user DP_USER Data Processor REST-API user (default: dataprocessor)
--dp-password DP_PASSWORD Password for Data Processor REST-API user
--components COMPONENTS Comma-separated list of components to deploy (default: web,mysql,dataprocessor,data-analyzer,console,redis,image-generator)
--custom-component CUSTOM_COMPONENT Comma-separated list of custom components
--high-load Enable high-load configuration for Web service
--use-prior-command Use the last installation command
--show-prior-command Show the last installation command
--tmpdir TMP_FOLDER Specify the temp directory for MI services (default: /opt/mi/data/tmp)
--no-proxy NO_PROXY Comma-separated list of components which should not be accessed via proxy (default: localhost,127.0.0.1,web,dataprocessor,console,data-analyzer)
--proxy-server-address PROXY_SERVER_ADDRESS Proxy server address
--disable-logger Disable logger service for collecting logs
--setup Install and configure system packages without deploying the application
--enable-remote-execution Allow remote commands execution from MI Console only
--require-2mfa Require 2MFA for MI Console users
--privileged Enable privileged mode for all containers
--skip-preflight-checks Skip preflight checks

6. Security

Comma-separated list of MI services that must not have outside access. By default, all services except are opened externally.

./installer.py --restrict-access mysql,dataprocessor

This allows for situations where only the UI is accessible externally.