Skip to main content

Deploying Docker Cluster

Background

This article will briefly describe how to quickly build a complete Metad analytics platform cluster using the docker run or docker-compose up command.

Applicable Scenarios

It is recommended to use the Metad analytics platform Docker containers to simplify the deployment process in SIT or DEV environments.

Source Code

The source code of this article can be found on GitHub: https://github.com/meta-d/installer/

Software Environment

SoftwareVersion
Docker20.0 or above
docker-compose2.10 or above

Standard Deployment

Please download the installation script provided by us

git clone https://github.com/meta-d/installer.git

Then, in the docker directory, first configure the environment variable file .env

cd installer/docker
cp env.tmpl .env
  • Set the value of INSTALLATION_MODE to standalone
  • Other password fields can be reset

Finally, execute the following command to start the service:

docker-compose -f docker-compose.yml up -d

Once the service is started, visit http://localhost/ to see the login page of the Metad analytics platform.

Domain

When deploying on a server, please modify the API_BASE_URL environment variable in the .env file from localhost to the domain name or IP address of the server. For example:

http://localhost:3000http://my-domain.com:3000

Detailed Configuration

Docker Compose Network Mode Explanation

There are two network modes suitable for deploying Metad analytics platform Docker:

  1. HOST mode suitable for deploying across multiple nodes. This mode is suitable for deploying different services on multiple node servers.
  2. Subnet Bridge mode suitable for deploying multiple service processes on a single node. This mode is suitable for deploying multiple services on a single node.

For demonstration purposes, this chapter only demonstrates the script written in Subnet Bridge mode.

Docker Compose Script

Deploying the Metad analytics platform requires 5 basic services, which are defined in the docker-compose.yml file:

  1. db: Database service, using the postgres database
  2. redis: Server cache service, using the redis database
  3. olap: OLAP engine service, using the metad-olap image
  4. api: Backend service, using the ocap-api image
  5. webapp: Frontend service, using the ocap-webapp image

Environment Variable Explanation

System parameters can be controlled through environment variables. Copy env.tmpl to .env and modify the parameters in it.

Some parameter explanations are as follows:

Environment VariableDescription
API_BASE_URLAPI service address (needs modification)
WEB_PORTPort of website
INSTALLATION_MODEInstallation mode (standalone: standard mode; with-doris: Doris integrated mode; with-starrocks: Starrocks integrated mode)
DB_NAMEDatabase name
DB_USERDatabase username
DB_PASSDatabase password
DB_PORTDatabase port
DB_HOSTDatabase address
REDIS_PASSWORDCache service password
WEBAPP_PORTWEB UI service port
NODE_ENVOperating environment: development or production
SENTRY_DSNSentry DSN
LOGGER_LEVELLog level
DEFAULT_LATITUDEDefault latitude
DEFAULT_LONGITUDEDefault longitude
DEFAULT_CURRENCYDefault currency
DEMODemo system