As your Kafka cluster grows, partition load can become uneven across brokers — some brokers handle significantly more traffic than others. Cruise Control addresses this by continuously monitoring broker load, detecting anomalies, and generating partition rebalancing proposals so you can restore balance without manual analysis. This topic describes how to enable and start Cruise Control on an E-MapReduce (EMR) Kafka cluster.
Prerequisites
Before you begin, ensure that you have:
An EMR Dataflow cluster running EMR V3.42.0 or later, created with the Kafka service selected. For details, see Create a Dataflow Kafka cluster.
Access to the EMR on ECS console and SSH access to the cluster.
Background
Cruise Control is pre-installed in the Kafka runtime component of an EMR Kafka cluster. It can run on any node where the Kafka runtime component is installed. Run it on a non-broker node to avoid contending with broker resources. This topic uses master-1-1 as the Cruise Control service node.
Enable and start Cruise Control
Step 1: Open the Kafka service configuration page
In the top navigation bar, select the region where your cluster resides and select a resource group.
On the EMR on ECS page, find your cluster and click Services in the Actions column.
On the Services tab, click Configure in the Kafka section.
Step 2: Enable the Cruise Control metric reporter
The metric reporter collects performance data from Kafka brokers. Cruise Control uses this data to model cluster load and generate rebalancing proposals.
On the Configure tab, click the server.properties tab.
Set
kafka.cruisecontrol.metric.reporter.enabletotrue.Click Save.
In the dialog box, enter a reason in the Execution Reason field, then click Save.
Step 3: Review and update broker capacity settings
Click the cruisecontrol_capacity.json tab to view the capacity parameters for your Kafka brokers. If the preset values do not match your brokers' actual hardware, update them before continuing.
Step 4: Set the Cruise Control UI access host
Click the cruisecontrol.properties tab.
Set
cruise.control.ui.access.hostto the public IP address of the master-1-1 node. To find this IP address, go to the Nodes page in the EMR console.Click Save.
In the dialog box, enter a reason in the Execution Reason field, then click Save.
Step 5: Restart the Kafka broker
On the EMR on ECS page, choose More > Restart.
In the dialog box, enter a reason in the Execution Reason field and click OK.
In the Confirm dialog box, click OK.
Step 6: Start Cruise Control
Log on to the cluster over SSH, then run the following commands to start Cruise Control:
cd $KAFKA_ROOT/cruise-control-current/
./emr-cruise-control-start.shStep 7: Verify the startup
Run the following command to list the log files and confirm Cruise Control started successfully:
ll $LOG_DIR_ROOT/cruise-controlA successful startup produces output similar to the following:
-rw-r--r-- 1 kafka hadoop 109095 Jul 20 15:07 kafkacruisecontrol.log
-rw-r--r-- 1 kafka hadoop 0 Jul 20 15:07 kafkacruisecontrol-operation.log
-rw-r--r-- 1 kafka hadoop 87452 Jul 20 15:07 kafka-cruise-control.out
-rw-r--r-- 1 kafka hadoop 0 Jul 20 15:07 kafkacruisecontrol-request.logStep 8: Access Cruise Control
Access Cruise Control through its web UI or REST API:
Web UI: Open
http://<Public IP address of the master-1-1 node>:9090/in a browser.ImportantBefore accessing the UI, add port 9090 to the cluster's security group. For details, see Add a security group rule.
REST API: See the Cruise Control REST API reference.