开源IOT平台Thingsboard配置运行( 安装 )
安装基本配置操作系统: centos7预安装yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm安装 Javayum install java-1.8.0-openjdkupdate-alternatives --config java安装 MavenThingsBoard bui
安装
基本配置
操作系统: centos7
预安装
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
安装 Java
yum install java-1.8.0-openjdk
update-alternatives --config java
安装 Maven
ThingsBoard build requires Maven 3.1.0+
安装 PostgreSQL
yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
yum -y install epel-release yum-utils
yum-config-manager --enable pgdg12
yum install postgresql12-server postgresql12
/usr/pgsql-12/bin/postgresql-12-setup initdb
systemctl start postgresql-12
systemctl enable --now postgresql-12
为postgresql主用户设置密码
su - postgres
psql
\password
\q
密码:123456
press “Ctrl+D” 返回 main user console
设置postgres用户使用MD5认证方式
编辑 pg_hba.conf
vim /var/lib/pgsql/12/data/pg_hba.conf
将
host all all 127.0.0.1/32 ident
ident修改为md5
host all all 127.0.0.1/32 md5
重启服务
systemctl restart postgresql-12.service
链接配置数据库
psql -U postgres -d postgres -h 127.0.0.1 -W
CREATE DATABASE thingsboard;
\q
配置远程链接
vim /var/lib/pgsql/12/data/postgresql.conf
listen_addresses='localhost’ 修改为 listen_addresses = ‘*’
vim /var/lib/pgsql/12/data/pg_hba.conf
host all all 127.0.0.1/32 md5
host all all 0.0.0.0/0 md5
firewall-cmd --zone=public --add-port=5432/tcp --permanent
firewall-cmd --reload
安装 Cassandra
touch /etc/yum.repos.d/datastax.repo
echo '[datastax]' | sudo tee --append /etc/yum.repos.d/datastax.repo > /dev/null
echo 'name = DataStax Repo for Apache Cassandra' | sudo tee --append /etc/yum.repos.d/datastax.repo > /dev/null
echo 'baseurl = http://rpm.datastax.com/community' | sudo tee --append /etc/yum.repos.d/datastax.repo > /dev/null
echo 'enabled = 1' | sudo tee --append /etc/yum.repos.d/datastax.repo > /dev/null
echo 'gpgcheck = 0' | sudo tee --append /etc/yum.repos.d/datastax.repo > /dev/null
yum install dsc30
yum install cassandra30-tools
service cassandra start
chkconfig cassandra on
安装 TimescaleDB
tee /etc/yum.repos.d/timescale_timescaledb.repo <<EOL
[timescale_timescaledb]
name=timescale_timescaledb
baseurl=https://packagecloud.io/timescale/timescaledb/el/7/\$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/timescale/timescaledb/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
EOL
yum update -y
yum install -y timescaledb-postgresql-12
安装 ThingsBoard
RPM安装
下载地址
wget https://github.com/thingsboard/thingsboard/releases/download/v3.1.1/thingsboard-3.1.1.rpm
安装
rpm -Uvh thingsboard-3.1.1.rpm
源码安装
下载地址
https://github.com/thingsboard/thingsboard
mvn clean install
配置 ThingsBoard
vim /etc/thingsboard/conf/thingsboard.conf
PUT_YOUR_POSTGRESQL_PASSWORD_HERE替换为postgres用户真实的密码
export DATABASE_ENTITIES_TYPE=sql
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=123456
export SPRING_DATASOURCE_MAXIMUM_POOL_SIZE=5
export SQL_POSTGRES_TS_KV_PARTITIONING=MONTHS
配置 ThingsBoard 队列服务
Apache Kafka is an open-source stream-processing software platform.
安装docker
yum install docker
service docker start
curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-dxWbxAeB-1606115131579)(img\docker.png)]
安装Kafka(容器)
下载地址
https://github.com/wurstmeister/kafka-docker.git
docker-compose up -d
Add more brokers:
docker-compose scale kafka=3
配置 ThingsBoard
vim /etc/thingsboard/conf/thingsboard.conf
export TB_QUEUE_TYPE=kafka
export TB_KAFKA_SERVERS=localhost:9092
启动ThingsBoard服务
运行安装脚本
/usr/share/thingsboard/bin/install/install.sh --loadDemo
配置防火墙
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --reload
启动ThingsBoard
service thingsboard start
浏览器访问
http://localhost:8080/
系统管理员
System Administrator:
用户名:sysadmin@thingsboard.org
密码:sysadmin
租户管理员
Tenant Administrator:
用户名:tenant@thingsboard.org
密码:tenant
客户
Customer User:
用户名:customer@thingsboard.org
密码:customer
更多推荐
所有评论(0)