- Prerequisites
- Step 1. Review the architecture page
- Step 2. Clone ThingsBoard CE Kubernetes scripts repository
- Step 3. Configure ThingsBoard database
- Step 5. Running
- Upgrading
- Next steps
This guide will help you to setup ThingsBoard in cluster mode using OpenShift.
Prerequisites
ThingsBoard Microservices run on the Kubernetes cluster. To deploy OpenShift cluster locally you’ll need to have Docker CE to run OpenShift containers and OpenShift Origin itself. Please follow these instructions to install all required software.
Log in to OpenShift cluster
To access OpenShift cluster you’ll have to login first. By default, you may login as the developer
user:
1
oc login -u developer -p developer
Create project
On the first start-up you should create the thingsboard
project.
To create it, please execute next command:
1
oc new-project thingsboard
Step 1. Review the architecture page
Starting ThingsBoard v2.2, it is possible to install ThingsBoard cluster using new microservices architecture and docker containers. See microservices architecture page for more details.
Step 2. Clone ThingsBoard CE Kubernetes scripts repository
1
2
git clone -b release-3.8.1 https://github.com/thingsboard/thingsboard-ce-k8s.git --depth 1
cd thingsboard-ce-k8s/openshift
Step 3. Configure ThingsBoard database
Before performing initial installation you can configure the type of database to be used with ThingsBoard.
In order to set database type change the value of DATABASE
variable in .env
file to one of the following:
postgres
- use PostgreSQL database;hybrid
- use PostgreSQL for entities database and Cassandra for timeseries database;
NOTE: According to the database type corresponding kubernetes resources will be deployed (see postgres.yml
and cassandra.yml
for details).
Step 5. Running
Execute the following command to run installation:
1
./k8s-install-tb.sh --loadDemo
Where:
--loadDemo
- optional argument. Whether to load additional demo data.
Execute the following command to deploy third-party resources:
1
./k8s-deploy-thirdparty.sh
Type ‘yes’ when prompted, if you are running ThingsBoard in high-availability
DEPLOYMENT_TYPE
for the first time or don’t have configured Redis cluster.
Execute the following command to deploy ThingsBoard resources:
1
./k8s-deploy-resources.sh
To see how to reach your ThingsBoard application on cluster, login as developer user (default password is developer too), open thingsboard
project, then go to Application -> Routes
menu and you’ll see all your configured routes.
The root route should look like https://tb-route-node-root-thingsboard.127.0.0.1.nip.io/
.
When you open it, you should see ThingsBoard login page.
Use the following default credentials:
- System Administrator: [email protected] / sysadmin
If you installed DataBase with demo data (using --loadDemo
flag) you can also use the following credentials:
- Tenant Administrator: [email protected] / tenant
- Customer User: [email protected] / customer
In case of any issues you can examine service logs for errors. For example to see ThingsBoard node logs execute the following command:
1) Get the list of the running tb-node pods:
1
oc get pods -l app=tb-node
2) Fetch logs of the tb-node pod:
1
oc logs -f [tb-node-pod-name]
Where:
tb-node-pod-name
- tb-node pod name obtained from the list of the running tb-node pods.
Or use oc get pods
to see the state of all the pods.
Or use oc get services
to see the state of all the services.
Or use oc get deployments
to see the state of all the deployments.
See oc Cheat Sheet command reference for details.
Execute the following command to delete all ThingsBoard microservices:
1
./k8s-delete-resources.sh
Execute the following command to delete all third-party microservices:
1
./k8s-delete-thirdparty.sh
Execute the following command to delete all resources (including database):
1
./k8s-delete-all.sh
Upgrading
In case when database upgrade is needed, execute the following commands:
1
2
3
./k8s-delete-resources.sh
./k8s-upgrade-tb.sh --fromVersion=[FROM_VERSION]
./k8s-deploy-resources.sh
Where:
FROM_VERSION
- from which version upgrade should be started. See Upgrade Instructions for validfromVersion
values. Note, that you have to upgrade versions one by one (for example 3.6.1 -> 3.6.2 -> 3.6.3 etc).
Next steps
-
Getting started guides - These guides provide quick overview of main ThingsBoard features. Designed to be completed in 15-30 minutes.
-
Connect your device - Learn how to connect devices based on your connectivity technology or solution.
-
Data visualization - These guides contain instructions on how to configure complex ThingsBoard dashboards.
-
Data processing & actions - Learn how to use ThingsBoard Rule Engine.
-
IoT Data analytics - Learn how to use rule engine to perform basic analytics tasks.
-
Hardware samples - Learn how to connect various hardware platforms to ThingsBoard.
-
Advanced features - Learn about advanced ThingsBoard features.
-
Contribution and Development - Learn about contribution and development in ThingsBoard.