skip to Main Content

I am trying to install and get working a thingsboard server in a VM instance in the Azure cloud. I have followed the tutorial for Ubuntu 20.04 and the service seems to start alright, but I cannot seem to reach it. I even changed the configurations i case the port was already taken to port 8081, but it seems that this is not the problem.

If I try to connect I receive the following error:

ahontanb@vm-tfg:~$ curl http://localhost:8081/
curl: (7) Failed to connect to localhost port 8081: Connection refused

When I print the listening ports in the VM, it outputs the following:

ahontanb@vm-tfg:~$ sudo netstat -a
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 localhost:postgresql    0.0.0.0:*               LISTEN
tcp        0      0 localhost:6010          0.0.0.0:*               LISTEN
tcp        0      0 localhost:domain        0.0.0.0:*               LISTEN
tcp        0      0 localhost:postgresql    localhost:35046         ESTABLISHED
tcp        0      0 localhost:postgresql    localhost:35032         ESTABLISHED
tcp        0      0 localhost:postgresql    localhost:35026         ESTABLISHED
tcp        0      0 localhost:postgresql    localhost:54638         ESTABLISHED
tcp        0      0 localhost:postgresql    localhost:55832         ESTABLISHED
tcp        0      0 localhost:postgresql    localhost:42512         ESTABLISHED
tcp        0      0 localhost:postgresql    localhost:35052         ESTABLISHED
tcp        0      0 localhost:postgresql    localhost:55424         ESTABLISHED
tcp        0      0 localhost:postgresql    localhost:40720         ESTABLISHED
tcp6       0      0 ip6-localhost:6010      [::]:*                  LISTEN
tcp6       0      0 [::]:7070               [::]:*                  LISTEN
tcp6       0      0 [::]:1883               [::]:*                  LISTEN
tcp6       0      0 127.0.0.1:35026         127.0.0.1:postgresql    ESTABLISHED
tcp6       0      0 127.0.0.1:55832         127.0.0.1:postgresql    ESTABLISHED
tcp6       0      0 127.0.0.1:35032         127.0.0.1:postgresql    ESTABLISHED
tcp6       0      0 127.0.0.1:35046         127.0.0.1:postgresql    ESTABLISHED
tcp6       0      0 127.0.0.1:35052         127.0.0.1:postgresql    ESTABLISHED
tcp6       0      0 127.0.0.1:55424         127.0.0.1:postgresql    ESTABLISHED
tcp6       0      0 127.0.0.1:40720         127.0.0.1:postgresql    ESTABLISHED
tcp6       0      0 127.0.0.1:54638         127.0.0.1:postgresql    ESTABLISHED
tcp6       0      0 127.0.0.1:42512         127.0.0.1:postgresql    ESTABLISHED
udp        0      0 localhost:323           0.0.0.0:*
udp        0      0 localhost:domain        0.0.0.0:*
udp        0      0 vm-tfg.internal.:bootpc 0.0.0.0:*
udp        0      0 localhost:52982         localhost:52982         ESTABLISHED
udp6       0      0 ip6-localhost:323       [::]:*
udp6       0      0 [::]:5683               [::]:*
raw6       0      0 [::]:ipv6-icmp          [::]:*                  7

The port 1883 is the open port for MQTT communications, but there is no port 8081. These are my thingsboard.conf contents:

#
# Copyright © 2016-2023 The Thingsboard Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

export JAVA_OPTS="$JAVA_OPTS -Dplatform=deb -Dinstall.data_dir=/usr/share/thingsboard/data"
export JAVA_OPTS="$JAVA_OPTS -Xlog:gc*,heap*,age*,safepoint=debug:file=/var/log/thingsboard/gc.log:time,uptime,level,tags:filecount=10,filesize=10M"
export JAVA_OPTS="$JAVA_OPTS -XX:+IgnoreUnrecognizedVMOptions -XX:+HeapDumpOnOutOfMemoryError"
export JAVA_OPTS="$JAVA_OPTS -XX:-UseBiasedLocking -XX:+UseTLAB -XX:+ResizeTLAB -XX:+PerfDisableSharedMem -XX:+UseCondCardMark"
export JAVA_OPTS="$JAVA_OPTS -XX:+UseG1GC -XX:MaxGCPauseMillis=500 -XX:+UseStringDeduplication -XX:+ParallelRefProcEnabled -XX:MaxTenuringThreshold=10"
export LOG_FILENAME=thingsboard.out
export LOADER_PATH=/usr/share/thingsboard/conf,/usr/share/thingsboard/extensions
export SQL_DATA_FOLDER=/usr/share/thingsboard/data/sql
# DB Configuration
export DATABASE_TS_TYPE=sql
export SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/thingsboard
export SPRING_DATASOURCE_USERNAME=postgres
export SPRING_DATASOURCE_PASSWORD=ahbgs2000
# Specify partitioning size for timestamp key-value storage. Allowed values: DAYS, MONTHS, YEARS, INDEFINITE.
export SQL_POSTGRES_TS_KV_PARTITIONING=MONTHS
# Update ThingsBoard memory usage and restrict it to 256MB in /etc/thingsboard/conf/thingsboard.conf
export JAVA_OPTS="$JAVA_OPTS -Xms256M -Xmx256M"
export TB_QUEUE_TYPE=in-memory

export export HTTP_BIND_PORT=8081

Can anyone help me find the issue?

2

Answers


  1. Chosen as BEST ANSWER

    So, it was simpler than it looked.

    Seems like this was a resource problem. Purchased a B2s and it ran smoothly and without a problem, so I guess that was it.


  2. There is a typo in your thingsboard.conf file:

    Try changing:

    export export HTTP_BIND_PORT=8081
    

    To:

    export HTTP_BIND_PORT=8081
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search