kafka警告:Connection to node -1 could not be established. Broker may not be available.

2020-04-24 15:14:15.556  WARN 30296 --- [ntainer#0-0-C-1] org.apache.kafka.clients.NetworkClient   : [Consumer clientId=consumer-1, groupId=notifyBusinessStatus] Connection to node -1 could not be established. Broker may not be available.
2020-04-24 15:14:15.567  WARN 30296 --- [ntainer#0-8-C-1] org.apache.kafka.clients.NetworkClient   : [Consumer clientId=consumer-9, groupId=notifyBusinessStatus] Connection to node -1 could not be established. Broker may not be available.
2020-04-24 15:14:15.575  WARN 30296 --- [ntainer#0-7-C-1] org.apache.kafka.clients.NetworkClient   : [Consumer clientId=consumer-8, groupId=notifyBusinessStatus] Connection to node -1 could not be established. Broker may not be available.
2020-04-24 15:14:15.620  WARN 30296 --- [ntainer#0-6-C-1] org.apache.kafka.clients.NetworkClient   : [Consumer clientId=consumer-7, groupId=notifyBusinessStatus] Connection to node -1 could not be established. Broker may not be available.
2020-04-24 15:14:15.621  WARN 30296 --- [ntainer#0-4-C-1] org.apache.kafka.clients.NetworkClient   : [Consumer clientId=consumer-5, groupId=notifyBusinessStatus] Connection to node -1 could not be established. Broker may not be available.

解决方案:

要么装kafka,要么在config中的logback中加上一段

<logger name="org.apache.kafka" level="ERROR">
        <appender-ref ref="STDOUT_FILE" />
</logger>

只输出error级别日志就行了


版权声明:本文为yy448671246原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。