Reply
Highlighted
New Contributor
Posts: 3
Registered: ‎07-20-2018

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

[ Edited ]

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

Posts: 923
Topics: 1
Kudos: 214
Solutions: 116
Registered: ‎04-22-2014

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

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

 

 

New Contributor
Posts: 3
Registered: ‎07-20-2018

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

[ Edited ]

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.

Announcements