Installing Kafka in Cloudera Base on premises
Learn how to install Apache Kafka on an existing Cloudera Base on premises cluster. You can deploy Kafka in either KRaft or ZooKeeper mode.
Installing Kafka on an existing Cloudera Manager cluster involves adding the Kafka service to your cluster and configuring its roles. The Kafka service is added and configured using the Add Service wizard in Cloudera Manager.
KRaft versus ZooKeeper
You can deploy Kafka in either KRaft or ZooKeeper mode. However, Cloudera recommends that you deploy clusters in KRaft mode. This is because ZooKeeper-based clusters are deprecated. Additionally, support for ZooKeeper-based Kafka clusters will be removed in a future release.
KRaft offers enhanced reliability, scalability, and throughput over ZooKeeper. Metadata operations are more efficient as they are directly integrated.
Kafka Service Roles
The Kafka service in Cloudera Manager consists of multiple role types. During installation, you provision the roles that match your deployment requirements:
- Kafka Broker: The core data plane role responsible for handling client requests, storing data, and replicating partitions. A Kafka service requires at least one broker, though a minimum of three brokers is recommended for production deployments to ensure high availability and fault tolerance.
- KRaft Controller: The metadata management role used when deploying Kafka in KRaft mode. KRaft controllers form a Raft quorum that manages cluster metadata without requiring ZooKeeper. This role is only used when Kafka is configured to use KRaft as the metadata store.
- Kafka Connect: An optional role that provides a framework for connecting Kafka with external systems. Kafka Connect allows you to stream data between Kafka and other data systems using pre-built or custom connectors. For detailed information on provisioning, see Setting up Kafka Connect.
- MirrorMaker: An optional role used for mirroring data between Kafka clusters. MirrorMaker replicates topics from a source cluster to a destination cluster. For information on provisioning see Setting up MirrorMaker.
Installing Kafka in KRaft mode
Learn how to add a Kafka service using KRaft to an existing Cloudera Manager cluster.
The following steps walk you through how you can add Kafka in KRaft mode to an already existing Cloudera Base on premises cluster. The steps are aimed to provide you with the basic process of installation and do not go into detail or provide recommendations on configuring service properties or security setup.
- You must deploy a minimum of three Kafka Broker instances for production deployments to ensure high availability and fault tolerance.
- KRaft requires an odd number of controllers to function. You must always deploy an odd number of KRaft Controller service roles. Service setup fails if you try to deploy an even number of roles.
- KRaft can function with a single KRaft Controller role instance, but you must deploy a minimum of three for production use. Deploying a Kafka service with a single KRaft Controller is only recommended for development and testing purposes.
- Cloudera recommends that you deploy the KRaft Controller service roles on dedicated hosts. If deployment on dedicated hosts is not feasible, or if you are deploying a lightweight cluster where high availability is not a requirement, you can colocate the controllers on the same hosts as the brokers. In general, if your deployment can tolerate the simultaneous failure of two colocated nodes, then deploying the controllers and brokers on the same hosts is a viable option.
- The general hardware and deployment recommendations that exist for ZooKeeper also hold true for KRaft Controllers. For more information, see Performance considerations.
The Kafka service is added to your cluster in KRaft mode. The Kafka service uses KRaft for metadata management
Installing Kafka in ZooKeeper mode
Learn how to add a Kafka service that uses ZooKeeper for metadata management.
The following steps walk you through how you can add Kafka in ZooKeeper mode to an already existing Cloudera Base on premises cluster. The steps are aimed to provide you with the basic process of installation and do not go into detail or provide recommendations on configuring service properties or security setup.
- You must have a ZooKeeper service installed and running on your cluster. ZooKeeper is a required dependency for ZooKeeper-based Kafka deployments.
- You must deploy a minimum of three Kafka Broker instances for production deployments to ensure high availability and fault tolerance.
- ZooKeeper-based Kafka cluster can be migrated to KRaft. For more information, see Migrating Kafka from ZooKeeper to KRaft.
The Kafka service is added to your cluster in ZooKeeper mode. Kafka uses ZooKeeper for metadata management.
