Hono CLI 启动问题

发布于 2025-01-17 11:12:48 字数 6526 浏览 2 评论 0原文

我最近使用 Minikube 部署了 hono。我按照说明操作,对集群进行隧道传输,以便可以通过本地主机使用它。我还成功设置了一个租户,我想用 Mosquitto 测试 MQTT 适配器。

我尝试启动 CLI 来连接到 Northbound API,如教程中所示,但出现以下错误:

23:25:23.718 [vert.x-eventloop-thread-0] INFO  o.e.h.client.impl.HonoConnectionImpl - max number of attempts [5] to re-connect to server [127.0.0.1:15672, role: unknown] have been made, giving up
23:25:23.746 [vert.x-eventloop-thread-0] ERROR org.eclipse.hono.cli.app.Receiver - Error occurred during initialization of receiver: failed to connect

我尝试使用的命令:

java -jar hono-cli-*-exec.jar --hono.client.host=127.0.0.1 --hono.client.port=15672 --hono.client.username=consumer@HONO --hono.client.password=verysecret --tenant.id=$TENANT

我尝试了 15672 和 15671 端口,但都不起作用。这是荣誉服务的日志:

NAME                                            TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                           AGE
eclipse-hono-adapter-amqp-vertx                 LoadBalancer   10.99.195.237    127.0.0.1     5672:32672/TCP,5671:32671/TCP     36h
eclipse-hono-adapter-http-vertx                 LoadBalancer   10.97.63.200     127.0.0.1     8080:30080/TCP,8443:30443/TCP     36h
eclipse-hono-adapter-mqtt-vertx                 LoadBalancer   10.100.216.206   127.0.0.1     1883:31883/TCP,8883:30883/TCP     36h
eclipse-hono-artemis                            ClusterIP      10.104.81.61     <none>        5671/TCP                          36h
eclipse-hono-dispatch-router                    ClusterIP      10.104.214.176   <none>        5673/TCP                          36h
eclipse-hono-dispatch-router-ext                LoadBalancer   10.100.97.6      127.0.0.1     15671:30671/TCP,15672:30672/TCP   36h
eclipse-hono-service-auth                       ClusterIP      10.99.59.114     <none>        5671/TCP                          36h
eclipse-hono-service-command-router             ClusterIP      10.104.190.85    <none>        5671/TCP                          36h
eclipse-hono-service-device-registry            ClusterIP      10.111.164.103   <none>        5671/TCP,8080/TCP,8443/TCP        36h
eclipse-hono-service-device-registry-ext        LoadBalancer   10.109.24.98     127.0.0.1     28080:31080/TCP,28443:31443/TCP   36h
eclipse-hono-service-device-registry-headless   ClusterIP      None             <none>        <none>                            36h

我感谢任何建议。 谢谢!

更新:

nano@dhcp-646 hono % java -jar hono-cli-*-exec.jar --hono.client.host=127.0.0.1 --spring.profiles.active=receiver,local --hono.client.port=15672 --hono.client.username=consumer@HONO --hono.client.password=verysecret --tenant.id=$TENANT


  ______     _ _                  _    _                   
 |  ____|   | (_)                | |  | |                  
 | |__   ___| |_ _ __  ___  ___  | |__| | ___  _ __   ___  
 |  __| / __| | | '_ \/ __|/ _ \ |  __  |/ _ \| '_ \ / _ \ 
 | |___| (__| | | |_) \__ \  __/ | |  | | (_) | | | | (_) |
 |______\___|_|_| .__/|___/\___| |_|  |_|\___/|_| |_|\___/ 
                | |                                        
                |_|                                        

Eclipse Hono Example Client  (v1.12.1)
using Spring Boot  (v2.5.9)

Go to https://www.eclipse.org/hono for more information.


12:26:58.881 [main] INFO  org.eclipse.hono.cli.Application - Starting Application v1.12.1 using Java 17.0.2 on dhcp-646.q.wlan.net.bme.hu with PID 22476 (/Users/nano/Documents/hono/hono-cli-1.12.1-exec.jar started by nano in /Users/nano/Documents/hono)
12:26:58.882 [main] INFO  org.eclipse.hono.cli.Application - The following profiles are active: receiver,local
12:26:59.122 [main] INFO  org.eclipse.hono.cli.Application - running command line client in role(s): receiver,local
12:26:59.273 [main] INFO  o.e.h.a.c.a.ProtonBasedApplicationClient - connecting to Hono endpoint
12:26:59.320 [main] INFO  org.eclipse.hono.cli.Application - Started Application in 0.744 seconds (JVM running for 1.079)
12:26:59.338 [vert.x-eventloop-thread-0] WARN  i.n.r.d.DnsServerAddressStreamProviders - Can not find io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider in the classpath, fallback to system defaults. This may result in incorrect DNS resolutions on MacOS.
12:27:10.457 [vert.x-eventloop-thread-0] INFO  o.e.h.client.impl.HonoConnectionImpl - max number of attempts [5] to re-connect to server [127.0.0.1:15672, role: unknown] have been made, giving up
12:27:10.465 [vert.x-eventloop-thread-0] ERROR org.eclipse.hono.cli.app.Receiver - Error occurred during initialization of receiver: failed to connect

更新:Minikube 服务列表 -n hono

命名空间名称目标端口URL
honoeclipse-hono-adapter-amqp-vertxamqp/5672
amqps/5671
honoeclipse-hono-adapter-http-vertxhttp/8080
https/8443
honoeclipse-荣誉适配器 mqtt-vertxmqtt/1883
secure-mqtt/8883
honoeclipse-hono-artemis否 节点端口
honoeclipse-hono-dispatch-router否 节点端口
honoeclipse-hono-dispatch-router-extamqps/15671
amqp/15672
honoeclipse-hono-service-auth否节点端口
honoeclipse-hono-service-command-router没有节点端口
honoeclipse-hono-service-device-registry无节点端口
honoeclipse-hono-service-device-registry-exthttp/28080
https/28443
honoeclipse-hono-service-device-registry-headless无节点端口
----------------------------------------------------- - -- - -- - - - - - - - - - -

更新: 库伯内特服务:

NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   8d

I recently deployed hono using Minikube. I followed the instructions, tunneled the cluster so it is available through localhost. I also successfully set up a tenant and I would like to test the MQTT Adapter with Mosquitto.

I tried to start the CLI to connect to the Northbound API as shown in the tutorial and I got the following error:

23:25:23.718 [vert.x-eventloop-thread-0] INFO  o.e.h.client.impl.HonoConnectionImpl - max number of attempts [5] to re-connect to server [127.0.0.1:15672, role: unknown] have been made, giving up
23:25:23.746 [vert.x-eventloop-thread-0] ERROR org.eclipse.hono.cli.app.Receiver - Error occurred during initialization of receiver: failed to connect

The command I tried to use:

java -jar hono-cli-*-exec.jar --hono.client.host=127.0.0.1 --hono.client.port=15672 --hono.client.username=consumer@HONO --hono.client.password=verysecret --tenant.id=$TENANT

I tried both 15672 and 15671 ports but none of them worked. Here is a log of the hono service:

NAME                                            TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                           AGE
eclipse-hono-adapter-amqp-vertx                 LoadBalancer   10.99.195.237    127.0.0.1     5672:32672/TCP,5671:32671/TCP     36h
eclipse-hono-adapter-http-vertx                 LoadBalancer   10.97.63.200     127.0.0.1     8080:30080/TCP,8443:30443/TCP     36h
eclipse-hono-adapter-mqtt-vertx                 LoadBalancer   10.100.216.206   127.0.0.1     1883:31883/TCP,8883:30883/TCP     36h
eclipse-hono-artemis                            ClusterIP      10.104.81.61     <none>        5671/TCP                          36h
eclipse-hono-dispatch-router                    ClusterIP      10.104.214.176   <none>        5673/TCP                          36h
eclipse-hono-dispatch-router-ext                LoadBalancer   10.100.97.6      127.0.0.1     15671:30671/TCP,15672:30672/TCP   36h
eclipse-hono-service-auth                       ClusterIP      10.99.59.114     <none>        5671/TCP                          36h
eclipse-hono-service-command-router             ClusterIP      10.104.190.85    <none>        5671/TCP                          36h
eclipse-hono-service-device-registry            ClusterIP      10.111.164.103   <none>        5671/TCP,8080/TCP,8443/TCP        36h
eclipse-hono-service-device-registry-ext        LoadBalancer   10.109.24.98     127.0.0.1     28080:31080/TCP,28443:31443/TCP   36h
eclipse-hono-service-device-registry-headless   ClusterIP      None             <none>        <none>                            36h

I appreciate any advise.
Thanks!

Update:

nano@dhcp-646 hono % java -jar hono-cli-*-exec.jar --hono.client.host=127.0.0.1 --spring.profiles.active=receiver,local --hono.client.port=15672 --hono.client.username=consumer@HONO --hono.client.password=verysecret --tenant.id=$TENANT


  ______     _ _                  _    _                   
 |  ____|   | (_)                | |  | |                  
 | |__   ___| |_ _ __  ___  ___  | |__| | ___  _ __   ___  
 |  __| / __| | | '_ \/ __|/ _ \ |  __  |/ _ \| '_ \ / _ \ 
 | |___| (__| | | |_) \__ \  __/ | |  | | (_) | | | | (_) |
 |______\___|_|_| .__/|___/\___| |_|  |_|\___/|_| |_|\___/ 
                | |                                        
                |_|                                        

Eclipse Hono Example Client  (v1.12.1)
using Spring Boot  (v2.5.9)

Go to https://www.eclipse.org/hono for more information.


12:26:58.881 [main] INFO  org.eclipse.hono.cli.Application - Starting Application v1.12.1 using Java 17.0.2 on dhcp-646.q.wlan.net.bme.hu with PID 22476 (/Users/nano/Documents/hono/hono-cli-1.12.1-exec.jar started by nano in /Users/nano/Documents/hono)
12:26:58.882 [main] INFO  org.eclipse.hono.cli.Application - The following profiles are active: receiver,local
12:26:59.122 [main] INFO  org.eclipse.hono.cli.Application - running command line client in role(s): receiver,local
12:26:59.273 [main] INFO  o.e.h.a.c.a.ProtonBasedApplicationClient - connecting to Hono endpoint
12:26:59.320 [main] INFO  org.eclipse.hono.cli.Application - Started Application in 0.744 seconds (JVM running for 1.079)
12:26:59.338 [vert.x-eventloop-thread-0] WARN  i.n.r.d.DnsServerAddressStreamProviders - Can not find io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider in the classpath, fallback to system defaults. This may result in incorrect DNS resolutions on MacOS.
12:27:10.457 [vert.x-eventloop-thread-0] INFO  o.e.h.client.impl.HonoConnectionImpl - max number of attempts [5] to re-connect to server [127.0.0.1:15672, role: unknown] have been made, giving up
12:27:10.465 [vert.x-eventloop-thread-0] ERROR org.eclipse.hono.cli.app.Receiver - Error occurred during initialization of receiver: failed to connect

Update: Minikube service list -n hono

NAMESPACENAMETARGET PORTURL
honoeclipse-hono-adapter-amqp-vertxamqp/5672
amqps/5671
honoeclipse-hono-adapter-http-vertxhttp/8080
https/8443
honoeclipse-hono-adapter-mqtt-vertxmqtt/1883
secure-mqtt/8883
honoeclipse-hono-artemisNo node port
honoeclipse-hono-dispatch-routerNo node port
honoeclipse-hono-dispatch-router-extamqps/15671
amqp/15672
honoeclipse-hono-service-authNo node port
honoeclipse-hono-service-command-routerNo node port
honoeclipse-hono-service-device-registryNo node port
honoeclipse-hono-service-device-registry-exthttp/28080
https/28443
honoeclipse-hono-service-device-registry-headlessNo node port
---------------------------------------------------------------------------------

Update:
Kubernetes services:

NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   8d

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文