azure - Azure VM 中的 Thingsboard 未监听指定端口

标签 azure azure-virtual-machine azure-virtual-network thingsboard

我正在尝试在 Azure 云中的 VM 实例中安装并开始运行 Thingsboard 服务器。我已经按照 Ubuntu 20.04 的教程进行操作,该服务似乎可以正常启动,但我似乎无法访问它。我什至更改了配置,以防端口已被带到端口 8081,但似乎这不是问题。

如果我尝试连接,我会收到以下错误:

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

当我打印虚拟机中的监听端口时,它输出以下内容:

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

端口1883是MQTT通信的开放端口,但没有端口8081。这些是我的thingsboard.conf内容:

#
# 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

谁能帮我找出问题所在吗?

最佳答案

您的 thingsboard.conf 文件中有一个拼写错误:

尝试改变:

export export HTTP_BIND_PORT=8081

致:

export HTTP_BIND_PORT=8081

关于azure - Azure VM 中的 Thingsboard 未监听指定端口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76948619/

相关文章:

azure - 重启后Kafka主题被删除

php - 适用于 PHP 的 Azure SDK 和适用于 Windows Server 1.1 的服务总线

azure - Windows Azure : Delete disk attached to non-existent VM

azure - 在 Windows Azure 中将 DS 与 D1_V2 VM 混合

Azure NSG - 从输入 csv 中筛选某些 IP

c# - Azure Web应用程序突然给出500个错误

Azure Web App临时文件清理责任

azure - Azure 上的虚拟机迁移

azure - 无法从同一虚拟网络中的一个 Azure 虚拟机与另一台 Azure 虚拟机的辅助 NIC 进行通信

azure - 如何增加 Azure 中的子网大小?