gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 03:22:02 26 4
gpt4 key购买 nike

我正在尝试在 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com