Skip to main content
In this guide we’ll learn how to ingest data into Apache Pinot from an Apache Kafka cluster configured with SASL authentication.

Prerequisites

To follow the code examples in this guide, you must install Docker locally and download recipes.
  1. If you haven’t already, download recipes.
  2. In terminal, go to the recipe by running the following command:

Launch Pinot and Kafka Clusters

You can spin up Pinot and Kafka clusters by running the following command:
This command will run a single instance of the Pinot Controller, Pinot Server, Pinot Broker, Kafka, and Zookeeper. You can find the docker-compose.yml file on GitHub. The Kafka cluster is launched with the following JAAS (Java Authentication and Authorization Service) for SASL configuration
We have two users:
  • admin with the password admin-secret
  • alice with the password alice-secret

Pinot Schema and Table

Let’s create a Pinot Schema and Table. The schema is defined below:
config/schema.json And the table config below:
config/table.json The part of this configuration that we’re interested in is highlighted. The credentials that we want to use are specified in the sasl.jaas.config property.
If our Kafka cluster has SSL enabled, we would need to specify security_protocol as SASL_SSL instead of SASL_PLAINTEXT. For an example of using SSL and SASL, see Connecting to Kafka with SSL and SASL authentication
Create the table and schema by running the following command:

Ingesting Data

Next, we’re going to ingest some data into Kafka:
We need to pass in a configuration file with SASL credentials when producing events as well. The contents of the configuration file are shown below:
/etc/kafka/kafka_client.conf

Querying

Now let’s navigate to localhost:9000/#/query and copy/paste the following query:
You will see the following output: Query Results