apache / hertzbeat

Apache HertzBeat(incubating) is a real-time monitoring system with agentless, performance cluster, prometheus-compatible, custom monitoring and status page building capabilities.
https://hertzbeat.apache.org/
Apache License 2.0
5.39k stars 941 forks source link

[BUG] Exception in deploying collector cluster #1708

Closed chenxu8989 closed 4 months ago

chenxu8989 commented 4 months ago

Is there an existing issue for this?

Current Behavior

  1. 安装包部署模式 hertzbeat-linux_amd64_1.5.0.tar.gz
  2. 操作系统: Red Hat Enterprise Linux Server release 7.9 Beta (Maipo)

Expected Behavior

No response

Steps To Reproduce

application.yml

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
server:
  port: 1159
  shutdown: graceful
  tomcat:
    threads:
      min-spare: 1
spring:
  application:
    name: ${HOSTNAME:@hertzbeat-collector@}${PID}
  profiles:
    active: cluster
  lifecycle:
    timeout-per-shutdown-phase: 10s
  jackson:
    default-property-inclusion: ALWAYS
  # need to disable spring boot mongodb auto config, or default mongodb connection tried and failed...
  autoconfigure:
    exclude: org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration, org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration

---
spring:
  config:
    activate:
      on-profile: cluster

collector:
  dispatch:
    entrance:
      netty:
        enabled: true
        # Config the collector unique identity name.
        identity: rhel2
        # Config the running mode(public or private), public cluster or private cloud-edge.
        mode: public
        manager-host: rhel2
        manager-port: 1157

push:
  uri: "rhel2:1157"

common:
  queue:
    # memory or kafka
    type: memory
    # properties when queue type is kafka
    kafka:
      servers: ${KAFKA_SERVERS:127.0.0.1:9092}
      metrics-data-topic: ${KAFKA_TOPIC:async-metrics-data}

Environment

HertzBeat version(s): 1.5.0

Debug logs

  _   _           _       ____             _
 | | | | ___ _ __| |_ ___| __ )  ___  __ _| |_
 | |_| |/ _ \ '__| __|_  /  _ \ / _ \/ _` | __|        Profile: cluster
 |  _  |  __/ |  | |_ / /| |_) |  __/ (_| | |_         Name: rhel24338 Port: 1159 Pid: 4338
 |_| |_|\___|_|   \__/___|____/ \___|\__,_|\__|        https://hertzbeat.com/

2024-04-02 17:26:12 [background-preinit] INFO  org.hibernate.validator.internal.util.Version - HV000001: Hibernate Validator 6.2.5.Final
2024-04-02 17:26:12 [main] INFO  org.dromara.hertzbeat.collector.Collector - Starting Collector using Java 11.0.21 on rhel2 with PID 4338 (/opt/hertzbeat-collector/hertzbeat-collector.jar started by root in /opt/hertzbeat-collector)
2024-04-02 17:26:12 [main] INFO  org.dromara.hertzbeat.collector.Collector - The following 1 profile is active: "cluster"
2024-04-02 17:26:13 [main] INFO  org.springframework.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 1159 (http)
2024-04-02 17:26:13 [main] INFO  org.apache.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-1159"]
2024-04-02 17:26:13 [main] INFO  org.apache.catalina.core.StandardService - Starting service [Tomcat]
2024-04-02 17:26:13 [main] INFO  org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.65]
2024-04-02 17:26:14 [main] INFO  org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
2024-04-02 17:26:14 [main] INFO  org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 1890 ms
2024-04-02 17:26:15 [main] INFO  org.apache.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-1159"]
2024-04-02 17:26:15 [main] INFO  org.springframework.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port(s): 1159 (http) with context path ''
2024-04-02 17:26:15 [main] INFO  org.dromara.hertzbeat.collector.Collector - Started Collector in 4.135 seconds (JVM running for 4.777)
2024-04-02 17:26:15 [main] INFO  org.dromara.hertzbeat.collector.collect.database.JdbcSpiLoader - start load jdbc drivers
2024-04-02 17:26:15 [main] INFO  cc.blynk.clickhouse.ClickHouseDriver - Driver registered
2024-04-02 17:26:15 [main] INFO  org.dromara.hertzbeat.collector.collect.database.JdbcSpiLoader - end load jdbc drivers
2024-04-02 17:26:16 [netty-client-worker-0] WARN  io.netty.channel.DefaultChannelPipeline - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
io.netty.handler.codec.compression.DecompressionException: Input is not in the GZIP format
    at io.netty.handler.codec.compression.JdkZlibDecoder.readGZIPHeader(JdkZlibDecoder.java:324)
    at io.netty.handler.codec.compression.JdkZlibDecoder.decode(JdkZlibDecoder.java:213)
    at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:519)
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:458)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:280)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at java.base/java.lang.Thread.run(Thread.java:829)
2024-04-02 17:26:16 [netty-client-worker-0] WARN  io.netty.channel.DefaultChannelPipeline - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
io.netty.handler.codec.compression.DecompressionException: Input is not in the GZIP format
    at io.netty.handler.codec.compression.JdkZlibDecoder.readGZIPHeader(JdkZlibDecoder.java:324)
    at io.netty.handler.codec.compression.JdkZlibDecoder.decode(JdkZlibDecoder.java:213)
    at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:519)
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:458)
    at io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:416)
    at io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:383)
    at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:366)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:241)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1405)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248)
    at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:901)
    at io.netty.channel.AbstractChannel$AbstractUnsafe$7.run(AbstractChannel.java:813)
    at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:566)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at java.base/java.lang.Thread.run(Thread.java:829)

Anything else?

No response

tomsun28 commented 4 months ago

Input is not in the GZIP format. Are you deploy the hertzbeat server withe nginx or other gateway?

chenxu8989 commented 4 months ago

Input is not in the GZIP format. Are you deploy the hertzbeat server withe nginx or other gateway?

没有, 我的服务端是正常的

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
server:
  port: 1157
spring:
  application:
    name: ${HOSTNAME:@hertzbeat@}${PID}
  profiles:
    active: prod
  mvc:
    static-path-pattern: /**
  jackson:
    default-property-inclusion: ALWAYS
  web:
    resources:
      static-locations:
        - classpath:/dist/
        - classpath:../dist/
  # need to disable spring boot mongodb auto config, or default mongodb connection tried and failed..
  autoconfigure:
    exclude: org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration, org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration
  freemarker:
    enabled: false

management:
  health:
    mail:
      enabled: off
  endpoints:
    web:
      exposure:
        include:
          - 'metrics'
          - 'health'
    enabled-by-default: on

sureness:
  auths:
    - digest
    - basic
    - jwt
  jwt:
    secret: 'CyaFv0bwq2Eik0jdrKUtsA6bx3sDJeFV643R
             LnfKefTjsIfJLBa2YkhEqEGtcHDTNe4CU6+9
             8tVt4bisXQ13rbN0oxhUZR73M6EByXIO+SV5
             dKhaX0csgOCTlCxq20yhmUea6H6JIpSE2Rwp'

---
spring:
  config:
    activate:
      on-profile: prod

  datasource:
    driver-class-name: org.postgresql.Driver
    username: postgres
    password: 123456
    url: jdbc:postgresql://rhel2:5432/postgres?currentSchema=hertzbeat
    hikari:
      max-lifetime: 120000

  jpa:
    database: postgresql
    hibernate:
      ddl-auto: update
    properties:
      hibernate:
        dialect: org.hibernate.dialect.PostgreSQLDialect

  # Not Require, Please config if you need email notify
  # 非必填:不使用邮箱作为警告通知可以去掉spring.mail配置
  mail:
    # Attention: this is mail server address.
    # 请注意此为邮件服务器地址:qq邮箱为 smtp.qq.com qq 企业邮箱为 smtp.exmail.qq.com
    host: smtp.qq.com
    username: tancloud@qq.com
    # Attention: this is not email account password, this requires an email authorization code
    # 请注意此非邮箱账户密码 此需填写邮箱授权码
    password: your-password
    #Attention: Tencent mail smtps 465,smtp 587
    #请注意腾讯邮箱465为smtps,587为smtp
    port: 587
    properties:
      mail:
        smtp:
          socketFactoryClass: javax.net.ssl.SSLSocketFactory
          ssl:
            enable: true

common:
  queue:
    # memory or kafka
    type: memory
    # properties when queue type is kafka
    kafka:
      servers: 127.0.0.1:9092
      metrics-data-topic: async-metrics-data
      alerts-data-topic: async-alerts-data

warehouse:
  store:
    # store history metrics data, enable only one below
    # 存储历史数据方式, 下方只能enabled启用一种方式
    jpa:
      enabled: true
      # The maximum retention time for history records, after which records will be deleted
      expire-time: 1h
      # The maximum number of history records retained, if this number is exceeded, half of the data in this configuration item will be deleted
      # (please set this configuration reasonably as history records can affect performance when it is large)
      # 历史数据的最大保留条数,超过此数量时,将会删除一半于此配量的数据(由于历史数据较大时会影响性能,请合理设置此配置)
      max-history-record-num: 6000
    victoria-metrics:
      enabled: false
      url: http://localhost:8428
      username: root
      password: root
    td-engine:
      enabled: false
      driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
      url: jdbc:TAOS-RS://localhost:6041/hertzbeat
      username: root
      password: taosdata
    greptime:
      enabled: false
      endpoint: localhost:4001
    iot-db:
      enabled: false
      host: 127.0.0.1
      rpc-port: 6667
      username: root
      password: root
      # org.dromara.hertzbeat.warehouse.config.IotDbVersion: V_0_13 || V_1_0
      version: V_1_0
      query-timeout-in-ms: -1
      # 数据存储时间:默认'7776000000'(90天,单位为毫秒,-1代表永不过期)
      # data expire time, unit:ms, default '7776000000'(90 days, -1:never expire)
      expire-time: '7776000000'
    influxdb:
      enabled: false
      server-url: http://127.0.0.1:8086
      username: root
      password: root
      expire-time: '30d'
      replication: 1

    # store real-time metrics data, enable only one below
    # 存储实时数据方式, 下方只能enabled启用一种方式
    memory:
      enabled: true
      init-size: 16
    redis:
      enabled: false
      host: 127.0.0.1
      port: 6379
      password: 123456
      #redis使用数据库,默认为DB0
      db: 0

alerter:
  # custom console url
  console-url: https://console.tancloud.cn
  # 企业微信
  wework-webHook-url: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=
  # 钉钉
  dingtalk-webhook-url: https://oapi.dingtalk.com/robot/send?access_token=
  # 飞书
  flybook-webhook-url: https://open.feishu.cn/open-apis/bot/v2/hook/
  # telegram
  telegram-bot-api-url: https://api.telegram.org/bot%s/sendMessage
  # discord
  discord-notify-url: https://discord.com/api/v9/channels/%s/messages
  # server酱
  server-chan-notify-url: https://sctapi.ftqq.com/%s.send
  # gotify
  gotify-notify-url: http://127.0.0.1/message?token=%s

scheduler:
  server:
    enabled: true
    port: 1158
chenxu8989 commented 4 months ago

Input is not in the GZIP format. Are you deploy the hertzbeat server withe nginx or other gateway?

已经解决了, 在服务端生成令牌和部署命令后就会正常启动了 但这个操作方式并未在文档里提到

image

tomsun28 commented 4 months ago

已经解决了, 在服务端生成令牌和部署命令后就会正常启动了 但这个操作方式并未在文档里提到

欢迎一起更新文档,但是我对比你之前的并没有发现有啥不同,很奇怪。

hertzbeat commented 4 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


It has been solved. After generating the token and deployment command on the server, it will start normally. But this operation method is not mentioned in the document

You are welcome to update the document together, but I didn't find any difference compared to your previous one, which is very strange.

zqr10159 commented 4 months ago

Input is not in the GZIP format. Are you deploy the hertzbeat server withe nginx or other gateway?

已经解决了, 在服务端生成令牌和部署命令后就会正常启动了 但这个操作方式并未在文档里提到

image

不用生成啊,直接就可以上线,我这边直接就行