Browse the Repo

file-type-icon.circleci
file-type-iconexamples
file-type-iconconfluent-oss-ami
file-type-iconkafka-ami
file-type-iconkafka-zookeeper-confluent-oss-ami
file-type-iconkafka-zookeeper-confluent-oss-colocated-cl...
file-type-iconuser-data
file-type-iconREADME.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvars.tf
file-type-iconkafka-zookeeper-confluent-oss-standalone-c...
file-type-iconkafka-zookeeper-standalone-clusters
file-type-iconzookeeper-ami
file-type-iconmodules
file-type-icontest
file-type-icon.gitignore
file-type-icon.pre-commit-config.yaml
file-type-iconCODEOWNERS
file-type-iconLICENSE.txt
file-type-iconREADME.md

Browse the Repo

file-type-icon.circleci
file-type-iconexamples
file-type-iconconfluent-oss-ami
file-type-iconkafka-ami
file-type-iconkafka-zookeeper-confluent-oss-ami
file-type-iconkafka-zookeeper-confluent-oss-colocated-cl...
file-type-iconuser-data
file-type-iconREADME.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvars.tf
file-type-iconkafka-zookeeper-confluent-oss-standalone-c...
file-type-iconkafka-zookeeper-standalone-clusters
file-type-iconzookeeper-ami
file-type-iconmodules
file-type-icontest
file-type-icon.gitignore
file-type-icon.pre-commit-config.yaml
file-type-iconCODEOWNERS
file-type-iconLICENSE.txt
file-type-iconREADME.md
Apache Kafka and Confluent Tools

Apache Kafka and Confluent Tools

Deploy a cluster of Kafka brokers. Optionally deploy Confluent tools such as Schema Registry, REST Proxy, and Kafka Connect.

Code Preview

Preview the Code

mobile file icon

README.md

down

Kafka, REST Proxy, Schema Registry, ZooKeeper, Exhibitor Colocated Cluster Example

This folder shows an example of how to use the zookeeper-cluster module from package-zookeeper to deploy a cluster of servers that is running Kafka brokers, REST Proxy, Schema Registry, ZooKeeper, and Exhibitor.

This deployment configuration is a great way to get started with Kafka and ZooKeeper, as there are fewer servers to manage and pay for. However, there are a few downsides:

  1. Performance issues: as load increases, the Kafka, ZooKeeper, and other processes running on the same server will begin to compete with each other for CPU and memory. We have reduced disk contention in this example by configuring two EBS Volumes: one for ZooKeeper's transaction log and one for Kafka's log.

  2. Scalability issues: You typically don't want to run more than 7 or 9 nodes (see ZooKeeper Cluster Size), but it's not uncommon to have far more Kafka brokers than that.

Once you start hitting the two issues above, you'll need to run these services in separate clusters, as shown in the kafka-zookeeper-confluent-oss-standalone-clusters example.

How do you run this example?

To run this example, you need to do the following:

  1. Build the AMI
  2. Apply the Terraform code
  3. Connect to Kafka

Build the AMI

See the kafka-zookeeper-confluent-oss-ami docs.

Apply the Terraform code

To apply the Terraform templates:

  1. Install Terraform
  2. Open vars.tf, set the environment variables specified at the top of the file, and fill in any other variables that don't have a default. This includes setting the ami_id variable to the ID of the AMI you just built.
  3. Run terraform init.
  4. Run terraform plan.
  5. If the plan looks good, run terraform apply.

Connect to Kafka

Check out the Connecting to Kafka brokers documentation for instructions.

Select the Services You Want

The point of this example is to run everything in a single EC2 Instance for maximum convenience in a development setting. But if you want to exclude a service, simply remove its installation from the user-data.sh script and remove the appropriate Security Group rules from the example's main.tf.

Questions? Ask away.

We're here to talk about our services, answer any questions, give advice, or just to chat.

Ready to hand off the Gruntwork?