查看topic列表报超时
报错如下:
            
            
              bash
              
              
            
          
          Error while executing topic command : Timed out waiting for a node assignment. Call: listTopics
[2024-02-28 14:36:57,024] ERROR org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment. Call: listTopics
 (kafka.admin.TopicCommand$)
        解决方法:修改server.properties文件中的listeners
            
            
              bash
              
              
            
          
          listeners=PLAINTEXT://ip:9092
        停止kafka运行:
            
            
              bash
              
              
            
          
          bin/kafka-server-stop.sh 
        重新启动kafka:
            
            
              bash
              
              
            
          
          bin/kafka-server-start.sh -daemon config/server.properties
        再次查看topic列表,发现如下报错:
            
            
              bash
              
              
            
          
          bin/kafka-topics.sh --bootstrap-server 192.168.15.187:9092 --list
#报错内容
[2024-02-28 14:57:22,420] WARN [AdminClient clientId=adminclient-1] Connection to node -1 (/192.168.15.187:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
        解决方法:修改server.properties文件中的advertised.listeners即可
            
            
              bash
              
              
            
          
          advertised.listeners=PLAINTEXT://ip:9092