Replication Monitoring using Kafka UI
Overview
Kafka UI is a web-based interface for managing and monitoring Apache Kafka clusters. This topic provides setup instructions, basic commands, and guides for common operations.
Install Path
Installation Directory:
/opt/kafka-uiExecutable JAR File:
/opt/kafka-ui/kafka-ui.jarSystemd Service Name:
kafka-ui
Basic Commands
Start Kafka UI:
sudo systemctl start kafka-uiStop Kafka UI:
sudo systemctl stop kafka-uiRestart Kafka UI:
sudo systemctl restart kafka-uiCheck Kafka UI Status:
sudo systemctl status kafka-uiEnable Kafka UI to Start on Boot:
sudo systemctl enable kafka-uiDisable Kafka UI from Starting on Boot:
sudo systemctl disable kafka-ui
Getting Started with Kafka UI
Open your browser and go to: http://{IP Address}/kafkaui
-
Login is required using nginx authentication.
Default values:
Username: admin
Password: hubble
You should see the dashboard listing all configured Kafka clusters.
How to Configure or Set up a New Cluster
-
Add the Cluster Details: Create a new cluster in the Dashboard section by specifying:
Cluster Name
Environment
-
Cluster ID or Endpoint
-
Add Kafka Broker Details: Under the Bootstrap Server section, provide the Kafka broker URL(s) (for example, broker1:9092,broker2:9092).
-
Add Schema Registry Details: In the Schema Registry section, enter the Schema Registry URL (example, http://localhost:8081) and any authentication credentials, if required.
-
Add Kafka Connect Details: In the Kafka Connect section, provide the Kafka Connect REST URL (for example, http://localhost:8083) along with any authentication details if required.
How to View the Replication Stats in Kafka UI
Open Kafka UI in your browser.
Navigate to the Topics section.
Select the topic related to your replication task.
-
View key metrics such as:
Message count
Partition offsets
Consumer lag
Throughput
Optionally, go to the Consumers or Consumer Groups section to monitor which consumers are reading the replicated data and their current offsets.
This allows you to track the health and progress of your replication jobs in real time.
How to View the Kafka Connect Stats?
-
From the Kafka Connect section:
Select the connector.
Go to the Tasks tab.
Check for failing tasks.
-
Errors will also appear in:
The Status of connectors or tasks (for example, FAILED)
-
Logs from the Kafka Connect server (see logs section)
-
Open the connector you want to inspect.
Replication stats such as task status, partitions, and offsets will be visible in the connector overview.
How to View the Failed Topic/Table Stats
Note: In this setup, if message processing fails, the messages are automatically routed to the DLQ (Dead Letter Queue) topic.
-
You can find the original topic name and error details in the headers section of each message in the DLQ. This helps trace back the source and diagnose the issue.
-
Errors typically surface in Dead Letter Topics (DLTs), which you can inspect like normal topics.
Tip: To troubleshoot failures, check the messages in the DLQ (Dead Letter Queue) topic. In the Headers section of each message, you can usually find the exception message or error details that caused the failure.
How to Clean up the Records in Brokers?
Important: Use with caution. Cleanup is typically managed by Kafka retention policies, and manual deletion may lead to data loss if not handled carefully.
Open Kafka UI in your browser.
Go to the “Topics” section and select the topic you want to clean.
Click on the Actions or Settings menu next to the topic name.
Choose Clear Messages to remove all records from the topic.
When to Clean:
Manual cleanup is recommended in scenarios such as:
Re-replicating tables without primary key columns in insert mode, where duplicate records may be generated.
Resetting a topic before a fresh load to ensure no stale or inconsistent data remains.
Clearing error topics after the issues have been resolved and logged.
Refer to Insert Mode Replication With Kafka (Oracle EBS) for details.
How to Clean up the Records in Brokers
Important: Use with caution. Cleanup is typically managed by Kafka retention policies.
-
To manually delete a topic:
Go to the Topics tab.
Select the topic you want to delete.
Click the Delete button (if enabled in Kafka broker and UI config).
-
Alternatively, using Kafka CLI:
kafka-topics.sh --bootstrap-server localhost:9092 --delete --topic your-topic-name
How to Update a Property in a Connector (for example, batch.size)
Go to the Connect Clusters section.
-
Open the connector you want to modify.
-
Click the Edit Configuration (pencil icon).
-
Update the desired property, for example:
{"batch.size": "5000",
"connection.password": "******"
}
Note: Ensure you update the
connection.passwordfield when making any property changes, as the characters “******” will be treated as a new password if not modified. Save for the changes to apply.
How to View the Error Logs of Kafka UI
-
Although Kafka UI does not directly expose backend logs, you can view them using
journalctlwith the following command:sudo journalctl -u kafka-ui -f
This command displays real-time logs from the Kafka UI systemd service.
-
For debugging Kafka Connect-related errors, check the logs of your Kafka Connect instance.
These logs are typically found in
/logs/connect.logor via Docker container logs if Kafka Connect is running in a container.