Support Questions

Find answers, ask questions, and share your expertise

Configure Kafka port per hostname in Cloudera

avatar
New Contributor

Hello,

We need advise about advanced Kafka configuration in Cloudera

 

We are using cloudera env installed on 6 servers per following distribution:

Namenode1-2

Datanode1-3

Application node

 

kafka service is installed on data nodes 1-3 and we would like to know:

How can we configure Kafka port per hostname and not per service?
we would like to have following outcome for example:
datanode1 - remain with kafka default port 9092
datanode2 - will be configured with new port #
datanode3 - will be configured with new port #

 

Thanks

Noam

 

1 REPLY 1

avatar
Super Guru

That's an odd thing to do 🙂 If you need to use another port for some reason, it would be better to change the ports on all hosts consistently, using the "TCP Port" or the "TLS/SSL Port" properties in Cloudera Manager, whether are you connecting without TLS or with it, respectively.

 

It is possible to configure ports on a host-by-host basis, but it makes it harder to maintain and client configuration becomes a little more cumbersome. To change the port for a particular host, go to Kafka > Instances > Click on the broker your want the change the port for > Configuration > Continue Editing Role Instance.

 

Then enter the following in the "Kafka Broker Advanced Configuration Snippet (Safety Valve) for kafka.properties" property:

port=9096
listeners=PLAINTEXT://:9096

 

The PLAINTEXT value will depend on your cluster config:

  • PLAINTEXT: No Kerberos, No TLS
  • SSL: No Kerberos, Using TLS
  • SASL_PLAINTEXT: Using Kerberos, No TLS
  • SASL_SSL: Using Kerberos, Using TLS

After that restart the Broker instance that was reconfigured.

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.