Deploying with Docker Compose
Neutree supports deploying monitoring components and the control plane to servers or virtual machines using Docker. It is recommended to deploy the monitoring components and the control plane on separate servers or virtual machines on different hosts to improve platform availability and performance.
Configuring the operating system
Based on the operating system type of your server or virtual machine, follow the corresponding section to configure the system and install Docker as the container runtime.
System configuration
-
Configure static IP addresses:
Terminal window sudo vi /etc/sysconfig/network-scripts/ifcfg-<interface>Replace
<interface>with the network interface name, for exampleeth0. -
Configure the DNS server:
Terminal window sudo vi /etc/resolv.conf -
Disable the firewall:
Terminal window sudo systemctl stop firewalld && sudo systemctl disable firewalld -
Disable SELinux:
Terminal window echo -e "SELINUX=disabled\nSELINUXTYPE=targeted" | sudo tee /etc/selinux/configsudo setenforce 0
-
Configure static IP addresses and a DNS server:
Terminal window sudo vi /etc/netplan/50-cloud-init.yaml -
Apply the network configuration:
Terminal window sudo netplan apply -
Disable the firewall:
Terminal window sudo ufw disable -
Optional: disable AppArmor as needed:
Terminal window sudo systemctl disable apparmor && sudo systemctl stop apparmor -
Restart the operating system for the configuration to take effect:
Terminal window sudo reboot
Installing Docker
-
Install Docker CE:
Terminal window sudo dnf -y install dnf-plugins-coresudo dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.reposudo dnf -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -
Start the Docker service:
Terminal window sudo systemctl enable --now docker -
Confirm that Docker is successfully installed:
Terminal window docker --version -
Restart the operating system for the configuration to take effect:
Terminal window sudo reboot
-
Update the package index:
Terminal window sudo apt-get updatesudo apt-get -y install ca-certificates curl -
Add the Docker GPG key:
Terminal window sudo install -m 0755 -d /etc/apt/keyringssudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.ascsudo chmod a+r /etc/apt/keyrings/docker.asc -
Add the Docker repository:
Terminal window echo \"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \sudo tee /etc/apt/sources.list.d/docker.list > /dev/null -
Install Docker CE:
Terminal window sudo apt-get updatesudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -
Start the Docker service:
Terminal window sudo systemctl enable --now docker -
Confirm that Docker is successfully installed:
Terminal window docker --version
Loading control plane offline images
Log in to the server or virtual machine where the control plane and monitoring components will be deployed, and load the control plane offline images.
-
Download version 1.0.1 of the Neutree CLI tool and the control plane offline image according to the server’s CPU architecture.
-
Grant executable permission to the CLI tool:
Terminal window chmod +x neutree-cli-<arch>Replace
<arch>with the server’s CPU architecture:amd64oraarch64. -
Load the control plane offline images using the CLI tool:
Information
If your environment has internet access and supports pulling container images from Docker Hub, skip this step.
Terminal window ./neutree-cli-<arch> import controlplane \--package <controlplane_package> \--localParameter Description <arch>The server’s CPU architecture: amd64oraarch64.<controlplane_package>The control plane offline image name, in the format neutree-controlplane-v1.0.1-enterprise-<arch>.tar.gz.Terminal window ./neutree-cli-<arch> import controlplane \--package <controlplane_package> \--mirror-registry <mirror_registry> \[--registry-project <registry_project>] \--registry-username <registry_username> \--registry-password <registry_password>Parameter Description <arch>The server’s CPU architecture: amd64oraarch64.<controlplane_package>The control plane offline image name, in the format neutree-controlplane-v1.0.1-enterprise-<arch>.tar.gz.<mirror_registry>The registry address. Enter an OCI-compatible registry address without the https://prefix.[--registry-project <registry_project>]Optional. The project name in the registry. Ensure the corresponding project has been created in advance. <registry_username>The registry user’s username. The user must have permission to upload images. <registry_password>The registry user’s login password or access key (such as a token).
Deploying monitoring components
The monitoring components provide observability support for the entire platform.
-
Start the monitoring component service:
Terminal window ./neutree-cli-<arch> launch obs-stackReplace
<arch>with the server’s CPU architecture:amd64oraarch64.Terminal window ./neutree-cli-<arch> launch obs-stack \--mirror-registry <mirror_registry> \[--registry-project <registry_project>]Parameter Description <arch>The server’s CPU architecture: amd64oraarch64.<mirror_registry>The registry address. Enter an OCI-compatible registry address without the https://prefix.[--registry-project <registry_project>]Optional. The project name in the registry. Ensure the corresponding project has been created in advance. -
Go to
http://<obstack_ip>:3030/. If the Grafana login page is displayed, the monitoring components have been deployed successfully.Replace
<obstack_ip>with the IP address of the server where the monitoring components are deployed.
Deploying the control plane
The control plane provides core functions such as platform management, user interface, and API services.
-
Run the following command in a terminal to generate a random JWT secret:
Terminal window openssl rand -base64 32 | tr '+/' '-_' | tr -d '='Information
Neutree uses JWT (JSON Web Token) for authentication and authorization. The JWT secret is used to ensure the security of JWTs.
-
Start the control plane service:
Terminal window ./neutree-cli-<arch> launch neutree-core \--version=v1.0.1-enterprise \--metrics-remote-write-url=http://<obstack_ip>:8480/insert/0/prometheus/ \--jwt-secret=<jwt_secret> \--grafana-url=http://<obstack_ip>:3030 \--admin-password=<admin_password> \Parameter Description <arch>The server’s CPU architecture: amd64oraarch64.<obstack_ip>The IP address of the server where the monitoring components are deployed. <jwt_secret>The JWT secret string generated in step 1. <admin_password>The initial password for Neutree administrator. Optional. It is recommended to set a custom initial password. If left blank, the system generates one automatically; retrieve it after deployment via docker logs -f post-migration-hook.Terminal window ./neutree-cli-<arch> launch neutree-core \--version=v1.0.1-enterprise \--metrics-remote-write-url=http://<obstack_ip>:8480/insert/0/prometheus/ \--jwt-secret=<jwt_secret> \--grafana-url=http://<obstack_ip>:3030 \--admin-password=<admin_password> \--mirror-registry=<mirror_registry> \[--registry-project <registry_project>]Parameter Description <arch>The server’s CPU architecture: amd64oraarch64.<obstack_ip>The IP address of the server where the monitoring components are deployed. <jwt_secret>The JWT secret string generated in step 1. <admin_password>The initial password for Neutree administrator. Optional. It is recommended to set a custom initial password. If left blank, the system generates one automatically; retrieve it after deployment via docker logs -f post-migration-hook.<mirror_registry>The registry address. Enter an OCI-compatible registry address without the https://prefix.[--registry-project <registry_project>]Optional. The project name in the registry. Ensure the corresponding project has been created in advance. -
Check the service status:
Terminal window docker ps -
Go to
http://<control_plane_ip>:3000using the administrator accountadmin@neutree.localand the initial password. If the Neutree management interface is accessible, the deployment is successful.Replace
<control_plane_ip>with the IP address of the server where the control plane is deployed.