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.
The source code of this article can be found on GitHub: https://github.com/meta-d/installer/
Software Environment
Software | Version |
---|---|
Docker | 20.0 or above |
docker-compose | 2.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.
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:3000
→ http://my-domain.com:3000
Detailed Configuration
Docker Compose Network Mode Explanation
There are two network modes suitable for deploying Metad analytics platform Docker:
- HOST mode suitable for deploying across multiple nodes. This mode is suitable for deploying different services on multiple node servers.
- 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:
- db: Database service, using the postgres database
- redis: Server cache service, using the redis database
- olap: OLAP engine service, using the metad-olap image
- api: Backend service, using the ocap-api image
- 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 Variable | Description |
---|---|
API_BASE_URL | API service address (needs modification) |
WEB_PORT | Port of website |
INSTALLATION_MODE | Installation mode (standalone : standard mode; with-doris : Doris integrated mode; with-starrocks : Starrocks integrated mode) |
DB_NAME | Database name |
DB_USER | Database username |
DB_PASS | Database password |
DB_PORT | Database port |
DB_HOST | Database address |
REDIS_PASSWORD | Cache service password |
WEBAPP_PORT | WEB UI service port |
NODE_ENV | Operating environment: development or production |
SENTRY_DSN | Sentry DSN |
LOGGER_LEVEL | Log level |
DEFAULT_LATITUDE | Default latitude |
DEFAULT_LONGITUDE | Default longitude |
DEFAULT_CURRENCY | Default currency |
DEMO | Demo system |