Cruise Control

Prerequisite

Deploying the Cruise Control Metrics Reporter

  • In the Kafka configuration file server-0.propertiesarrow-up-right configure the Cruise Control Metrics Reporter:

  • Add the CruiseControlMetricsReporter class to the metric.reporters configuration option. Do not remove any existing Metrics Reporters. (add at bottom of properties file)

  • repeat with server-1.properties, server-2.properties in ~/amq-streams-2022/2-amq-streams-architecture/configs/kafka

  • start cluster

    • run start zookeeper command in different terminal (1 shell script 1 terminal)

    • run start kafka broker command in different terminal, start only broker 0 and broker 1 (we will start broker 2 later in this lab)

    • check zookeeper & kafka process (3 zookeeper & 2 kafka)

      or

Prepare Test Topic

  • Create topic "demo"

    example result

  • Note: replication factor can't larger than available broker.

  • Check Topic Description

    example result, show partition of demo topic in broker 0 & broker 1

  • load data to topic "demo"

  • run start kafka broker 2 in different terminal

  • check all zookeeper & kafka process (3 zookeeper & 3 kafka)

  • recheck topic information of "demo" don't change after start broker 2

Enable Cruise Control

  • reviews cruise-control configuration in cruisecontrol.propertiesarrow-up-right, Configure the properties used by Cruise Control and then start the Cruise Control server using the kafka-cruise-control-start.sh script.

  • start cruise-contral at port 9191

  • check Auto-created topics of cruise-control

    example result, show new topic such as "__CruiseControlMetrics", "__KafkaCruiseControlPartitionMetricSamples" and "__KafkaCruiseControlModelTrainingSamples"

  • open new terminal, check cruise-control state

    example result

  • review capacity limits for Kafka broker resources in config/config/capacityJBOD.jsonarrow-up-right , To apply the same capacity limits to every broker monitored by Cruise Control, set capacity limits for broker ID -1. To set different capacity limits for individual brokers, specify each broker ID and its capacity configuration.

Test Auto Rebalance After Add Broker With Cruise-control

  • Test Generating optimization proposals with dryrun.

    example result, Review the optimization proposal contained in the response.

  • if your found error 500 after call proposals such as

    please wait and re try again because Cruise Control has not collect enough metric data to aggregate to a valid window. (around 2-3 minutes)

  • Approving an optimization proposal

  • Check progress

    example result

    call check until status change to Completed

  • Check Topic after call cruise-control/add_broker, some partition move to new broker

    example result, show partition of demo topic in broker 0,broker 1 and broker 2

Stop Server

  • stop cruise-control

  • stop kafka broker in each terminal with ctrl+c

  • stop zookeeper in each terminal with ctrl+c

Last updated