hertzbeat icon indicating copy to clipboard operation
hertzbeat copied to clipboard

[Question] <title>I am unable to deploy the collector.

Open QiangQiangshiyanshi opened this issue 1 year ago • 5 comments

Question

I am unable to deploy the collector.😭

background:The version I am using is v1.6.0. The current issue is that I want to use the Collector Cluster feature, but the collector cannot be deployed.

The docker collector command used docker run -d -e IDENTITY=12345 -e MODE=public -e MANAGER_HOST=<domain> -e MANAGER_PORT=1158 --name hertzbeat-collector apache/hertzbeat-collector:v1.6.0

I have tried Laster. Still not working.

The configuration is as follows. application.yaml

Image

In hertzbeat-server curl 1158

Image

hertzbeat-server port is listed

Image

Use ingress domain to map 1157

Now looking hertzbeat-collector logs

error log description

2025-05-13 13:47:18.806 [common-worker-0] ERROR org.apache.hertzbeat.remoting.netty.NettyRemotingClient Line:107 - client connect to
 server error: Connection refused: obs-hertzbeat-cluster/192.168.6.108:1158. try after 10s.

Cluster service type is ClusterIP

ok log description

2025-05-13 21:56:38.840 [heartbeat-worker-0] INFO  org.apache.hertzbeat.collector.dispatch.entrance.CollectServer Line:165 - collect
or send cluster server heartbeat, time: 1747144598840.
2025-05-13 21:56:38.840 [netty-client-worker-1] INFO  org.apache.hertzbeat.collector.dispatch.entrance.processor.HeartbeatProcessor
Line:32  - collector receive manager server response heartbeat, time: 1747144598840.

QiangQiangshiyanshi avatar May 13 '25 14:05 QiangQiangshiyanshi

look my ingress config

spec:
  ingressClassName: nginx
  rules:
    - host: {domain}
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: obs-hertzbeat-http
                port:
                  number: 1157

1158 service name is obs-hertzbeat-cluster and service name exposed port 1158

QiangQiangshiyanshi avatar May 13 '25 14:05 QiangQiangshiyanshi

Hi, collector and server in docker?

xiaomizhou2 avatar May 14 '25 09:05 xiaomizhou2

Hi, collector and server in docker?

No~ The hertzbeat server is provided by the k8s cluster. The collertoc cluster (proxy) is provided by the edge in Docker.

QiangQiangshiyanshi avatar May 14 '25 11:05 QiangQiangshiyanshi

this config need edit nginx-ingress-controller(deployment) , tcp-services(ConfigMap) and nginx-ingress-lb(SVC) , over this config , we can L7 use to 1158 L4

QiangQiangshiyanshi avatar May 14 '25 13:05 QiangQiangshiyanshi

Closing since the reporter shared the fix: expose port 1158 as a TCP (L4) service through the NGINX ingress controller (tcp-services ConfigMap plus the controller's Deployment and Service). Thanks for sharing it.

orangeCatDeveloper avatar Sep 27 '26 23:09 orangeCatDeveloper