Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Service has 0 Kafka Brokers. Kafka requires at least 1 Kafka Broker

Service has 0 Kafka Brokers. Kafka requires at least 1 Kafka Broker

New Contributor

This problem is related to CM API. The error is thrown when creating service ApiCluster.create_service(). Although this problem can be avoided by manually adding the role instance through Kafka service -> Instances -> Add Role Instances -> Kafka Broker, I would like to programatically adding this (instead of manually operation).

 

However I don't see any related examples in cloudera forum, nor in cloudera github. 

 

Observing the output

 

<ApiList>(3): [<ApiRoleConfigGroup>: Kafka-GATEWAY-BASE (cluster: Cluster 1; service: Kafka), <ApiRoleConfigGroup>: Kafka-KAFKA_MIRROR_MAKER-BASE (cluster: Cluster 1; service: Kafka), <ApiRoleConfigGroup>: Kafka-KAFKA_BROKER-BASE (cluster: Cluster 1; service: Kafka)]

 

Kafka role for broker has already been there after calling ApiCluster.create_service(). So how can I associate the instance with role? Any code snippet?

 

Can it be done through ApiRoleConfigGroup.update_config()? If so what config content should be provided?

 

Thank you

2 REPLIES 2

Re: Service has 0 Kafka Brokers. Kafka requires at least 1 Kafka Broker

Super Guru

Hi @willnopt

 

The following may help with some examples of adding services:

 

https://github.com/cloudera/cm_api/blob/master/python/examples/auto-deploy/deploycloudera.py

 

 

Re: Service has 0 Kafka Brokers. Kafka requires at least 1 Kafka Broker

New Contributor

Sorry my question may be not clear enough. I've checked the github example deploycloudera.py previously. The problem is I am not sure what content to fill in when creating roles for Kafka. The examples neither include Kafka, nor any information pointing to Kafka config for associating role with broker. So I am wondering what info needed to be presented in variable e.g. KAFKA_ROLE_CONFIG. I suppose the content should be similar to XXXXXX_ROLE_CONFIG in the example, but don't know the constant key value bits. Are there any docs that may talk about this or any link that may contain relevent info? 

 

Appreciate any suggestions, thanks.