Star

Guides

How to get started, and accomplish tasks, using Thingsboard.

Cluster setup

This guide will help you to setup Thingsboard in cluster mode.

Assumptions

Thingsboard requires Zookeeper for cluster coordination and Cassandra as a NoSQL database. You can host Cassandra on the same nodes where you install Thingsboard or on separate nodes.

We assume following topology

image

In this case, both Zookeeper and Cassandra nodes are deployed in cluster mode. We use two nodes clusters only for demonstration purposes. This is not recommended for production.

Let’s assume following hostnames:

We will use default ports for Cassandra (9042) and Zookeeper(2181).

Installation

You can install Thingsboard services using single node installation guide Please note that you don’t need to execute “Provision database schema and initial data” step only once per cluster.

Configuration

You will need to change following Zookeeper and Cassandra parameters in thingsboard.yml

zk:
  enabled: "${ZOOKEEPER_ENABLED:true}"
  url: "${ZOOKEEPER_URL:zk1:2181,zk2:2181}"

cassandra:
  url: "${CASSANDRA_URL:c1:9042,c2:9042}"

Also, you need to specify rpc.bind_host to match your current host for each thingsboard server. For example, tb1 configuration:

rpc:
  bind_host: "${RPC_HOST:tb1}"

Networking

Following ports need to be accessible within cluster for corresponding servers:

Following Thingsboard server ports need to be accessible outside cluster for device connectivity:

Load Balancing