Help Center> MapReduce Service> Developer Guide (2.x and Earlier)> Kafka Application Development> FAQs> How Can I Address the Issue That Running the Producer.java Sample to Obtain Metadata Fails and "ERROR fetching topic metadata for topics..." Is Displayed?

How Can I Address the Issue That Running the Producer.java Sample to Obtain Metadata Fails and "ERROR fetching topic metadata for topics..." Is Displayed?

Troubleshooting Procedure

  1. Find bootstrap.servers in client.properties under the conf directory of the project, and check whether the IP address and port ID are configured correctly.
    • If the IP address is inconsistent with the service IP address of the Kafka cluster, change the IP address to the correct one.
    • If the port ID is 21007 (port with Kerberos authentication enabled), change it to 9092 (port with Kerberos authentication disabled).

      In MRS 1.6.2 and earlier versions, the default port number is 21005 for the cluster where Kerberos authentication is not enabled. For details, see the section about component port information in the MRS User Guide.

  2. Check whether network connections are correct to ensure that the current device can access the Kafka cluster normally.