Docker下安装thingsboard

Docker 下安装 thingsboard

镜像地址:https://hub.docker.com/r/thingsboard/tb-cassandra/

# Pull镜像:
docker pull thingsboard/tb-cassandra

# 运行镜像
docker run -it -p 9090:9090 -p 1883:1883 -p 5683:5683/udp -v ~/.mytb-data:/data -v ~/.mytb-logs:/var/log/thingsboard --name mytb --restart always thingsboard/tb-cassandra


#参数说明:
# docker run - run this container
# -it - attach a terminal session with current ThingsBoard process output
# -p 9090:9090 - connect local port 9090 to exposed internal HTTP port 9090
# -p 1883:1883 - connect local port 1883 to exposed internal MQTT port 1883
# -p 5683:5683 - connect local port 5683 to exposed internal COAP port 5683
# -v ~/.mytb-data:/data - mounts the host's dir ~/.mytb-data to ThingsBoard DataBase data directory
# -v ~/.mytb-logs:/var/log/thingsboard - mounts the host's dir ~/.mytb-logs to ThingsBoard logs directory
# --name mytb - friendly local name of this machine
# --restart always - automatically start ThingsBoard in case of system reboot and restart in case of failure.
# thingsboard/tb-cassandra - docker image
# After executing this command you can open http://{yor-host-ip}:9090 in you browser.
# You should see ThingsBoard login page. Use the following default credentials:

默认登陆信息

  • Systen Administrator: sysadmin@thingsboard.org / sysadmin
  • Tenant Administrator: tenant@thingsboard.org / tenant
  • Customer User: customer@thingsboard.org / customer

启停服务

To reattach to the terminal (to see ThingsBoard logs) run:
$ docker attach mytb
To stop the container:
$ docker stop mytb
To start the container:
$ docker start mytb

异常

在ubuntu 18.04中安装报错

creating directory /data/db ... initdb: could not create directory "/data/db": Permissio

解决方法:

rm -rf ~/.mytb-data  ~/.mytb-log
mkdir -p ~/.mytb-data && sudo chown -R 799:799 ~/.mytb-data
mkdir -p ~/.mytb-logs && sudo chown -R 799:799 ~/.mytb-logs
分享