物联网IOT平台之ThingsBoard学习笔记(一)——CentOS安装部署ThingsBoard

CentOS部署ThingsBoard

  • ThingsBoard是什么?
  • 安装流程
    • ThingsBoard安装
    • PostgreSQL Installation
  • 参考文档
  • 加入我们

ThingsBoard是什么?

开源的物联网平台;
物联网解决方案的设备管理、数据收集和可视化;

安装流程

安装流程可分为两部分:第一安装thingsboard,第二安装thingsboard所需要的数据库——PostgreSQL。

ThingsBoard安装

# 查看linux版本
cat /etc/redhat-release

# Install wget
sudo yum install -y nano wget

# Add latest EPEL release for CentOS 7
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm


# 步骤1. 安装Java 8(OpenJDK)
sudo yum install java-1.8.0-openjdk

# 配置哪个版本是默认版本:
sudo update-alternatives --config java

java -version

# 步骤2. 安装服务
# 下载安装包。
wget https://github.com/thingsboard/thingsboard/releases/download/v3.1.1/thingsboard-3.1.1.rpm

# 安装服务
sudo rpm -Uvh thingsboard-3.1.1.rpm

PostgreSQL Installation

# Update your system
sudo yum update

# Install the repository RPM (for CentOS 7):
sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
# Install packages
sudo yum -y install epel-release yum-utils
sudo yum-config-manager --enable pgdg12
sudo yum install postgresql12-server postgresql12
# Initialize your PostgreSQL DB
sudo /usr/pgsql-12/bin/postgresql-12-setup initdb
sudo systemctl start postgresql-12
# Optional: Configure PostgreSQL to start on boot
sudo systemctl enable --now postgresql-12


sudo su - postgres
psql
password
q


sudo nano /var/lib/pgsql/12/data/pg_hba.conf


# IPv4 local connections:
host    all             all             127.0.0.1/32            ident
# Replace ident with md5:
host    all             all             127.0.0.1/32            md5

sudo systemctl restart postgresql-12.service

psql -U postgres -d postgres -h 127.0.0.1 -W

CREATE DATABASE thingsboard;
q

sudo nano /etc/thingsboard/conf/thingsboard.conf

# DB Configuration 
export DATABASE_TS_TYPE=sql
export SPRING_JPA_DATABASE_PLATFORM=org.hibernate.dialect.PostgreSQLDialect
export SPRING_DRIVER_CLASS_NAME=org.postgresql.Driver
export SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/thingsboard
export SPRING_DATASOURCE_USERNAME=postgres
export SPRING_DATASOURCE_PASSWORD=PUT_YOUR_POSTGRESQL_PASSWORD_HERE
# Specify partitioning size for timestamp key-value storage. Allowed values: DAYS, MONTHS, YEARS, INDEFINITE.
export SQL_POSTGRES_TS_KV_PARTITIONING=MONTHS


sudo nano /etc/thingsboard/conf/thingsboard.conf

# Update ThingsBoard memory usage and restrict it to 256MB in /etc/thingsboard/conf/thingsboard.conf
export JAVA_OPTS="$JAVA_OPTS -Xms256M -Xmx256M"

# --loadDemo option will load demo data: users, devices, assets, rules, widgets.
sudo /usr/share/thingsboard/bin/install/install.sh --loadDemo

sudo firewall-cmd --zone=public --add-port=8080/tcp --permanent
sudo firewall-cmd --reload

sudo service thingsboard start

http://localhost:8080/

参考文档

官方文档
中文文档
他人博客

加入我们

物联网IOT平台之ThingsBoard学习笔记(一)——CentOS安装部署ThingsBoard
点击链接加入群聊【IT技术交流群1】:https://jq.qq.com/?_wv=1027&k=q4XbOSvn

本文章来源于互联网,如有侵权,请联系删除!原文地址:物联网IOT平台之ThingsBoard学习笔记(一)——CentOS安装部署ThingsBoard

相关推荐: 物联网平台搭建的全过程介绍(一)——物联网简介

目录 一、物联网的概念 二、物联网平台 三、物联网平台的几个相关概念 1、IoT 2、互联网和物联网的关系 (1)互联网是物联网的基础,物联网是互联网的延伸 (2)互联网和物联网相互促进,共同造福人类 3、互联网和物联网的区别 (1)两者的着重点不一样 (2)…