| layout | docwithnav-pe | |
|---|---|---|
| assignees |
|
|
| title | ThingsBoard Professional Edition cluster setup with Docker Compose guide | |
| description | ThingsBoard Professional Edition cluster setup with Docker Compose guide | |
| redirect_from | /docs/user-guide/install/pe/docker-cassandra/ |
- TOC {:toc}
{% assign docsPrefix = "pe/" %}
This guide will help you to setup ThingsBoard in cluster mode with Docker Compose. For this purpose, we will use docker container images available on Docker Hub.
ThingsBoard Microservices are running in dockerized environment. Before starting please make sure Docker Engine and Docker Compose are installed in your system.
{% include templates/install/docker-install.md %}
{% capture rule_engine_note %} Please note that for the deployment of Rule Engine as a separate service, an additional separate License Key is required. {% endcapture %} {% include templates/info-banner.md content=rule_engine_note %}
{% include templates/install/docker-install-note.md %}
{% include templates/install/dockerhub/pull.md %}
git clone -b release-{{ site.release.ce_ver }} https://github.com/thingsboard/thingsboard-pe-docker-compose.git tb-pe-docker-compose --depth 1
cd tb-pe-docker-compose{: .copy-code}
We assume you have already chosen your subscription plan or decided to purchase a perpetual license. If not, please navigate to pricing page to select the best license option for your case and get your license. See How-to get pay-as-you-go subscription{:target="_blank"} or How-to get perpetual license{:target="_blank"} for more details.
IMPORTANT NOTE: if you decide to use an advanced deployment type, make sure you have purchased a license key for at least four instances of ThingsBoard PE. Otherwise, you need to modify the local copy of docker-compose.yml) to use the number of ThingsBoard instances that you've purchased. We will reference the license key you have obtained during this step as PUT_YOUR_LICENSE_SECRET_HERE later in this guide.
nano tb-node.env{: .copy-code}
and put the license secret parameter instead of "PUT_YOUR_LICENSE_SECRET_HERE":
# ThingsBoard server configuration
...
TB_LICENSE_SECRET=PUT_YOUR_LICENSE_SECRET_HEREStarting ThingsBoard v2.2, it is possible to install ThingsBoard cluster using new microservices architecture and docker containers. See microservices architecture page for more details.
The docker compose scripts support three deployment modes. In order to set the deployment mode, change the value of TB_SETUP variable in .env file to one of the following:
basic(recommended, set by default) - ThingsBoard Core and Rule Engine are launched inside one JVM (requires only one license). MQTT, CoAP and HTTP transports are launched in separate containers.monolith- ThingsBoard Core and Rule Engine are launched inside one JVM (requires only one license). MQTT, CoAP and HTTP transports are also launched in the same JVM to minimize memory footprint and server requirements.advanced- ThingsBoard Core and Rule Engine are launched in separate containers and are replicated one JVM (requires 4 licenses).
All deployment modes support separate JS executors, Redis, and different queues.
{% include templates/install/configure-db-docker-compose.md %}
{% include templates/install/install-queue-docker-compose.md %}
{% capture contenttogglespecqueue %} Kafka (default, recommended for on-prem, production installations)%,%kafka%,%templates/install/cluster-queue-kafka.md%br% Confluent Cloud (Event Streaming Platform based on Kafka)%,%confluent-cloud%,%templates/install/cluster-queue-confluent-cloud.md{% endcapture %} {% include content-toggle.liquid content-toggle-id="ubuntuThingsboardQueue" toggle-spec=contenttogglespecqueue %}
{% include templates/install/configure-monitoring-docker-compose.md %}
You may optionally install Trendz Analytics any time using the following steps:
Edit the configuration file:
nano .env{: .copy-code}
You'll need to make sure that TRENDZ_ENABLED variable set to true:
TRENDZ_ENABLED=trueYou can read about Trendz Analytics here.
{% include templates/install/docker/docker-compose-setup-volumes.md %}
{% assign dockerComposeFileLocation = "-f $TB_SETUP/docker-compose.yml " %} {% assign peEdition = true %} {% include templates/install/docker/docker-compose-setup-running.md %}
{% include templates/install/generate_certificate_docker-compose.md %}
{% include templates/install/upgrade-thingsboard.md %}
Trendz Analytics have different version system, and should be updated separately from ThingsBoard platform main services.
To update Trendz, it's necessary to edit .env file to set "TRENDZ_VERSION" to target version (e.g. set it to {{ site.release.trendz_ver }} if you are upgrading to the latest). Then, execute the following commands:
./docker-stop-services.sh
./docker-upgrade-trendz.sh
./docker-start-services.sh{: .copy-code}
Note that you can upgrade Trendz from any version to the latest (for example, 1.12.0 -> {{ site.release.trendz_ver }} etc).
{% assign currentGuide = "InstallationGuides" %}{% include templates/guides-banner.md %}