Prerequisites
To follow the code examples in this guide, you must install Docker locally and download recipes.Navigate to recipe
- If you haven’t already, download recipes.
- In terminal, go to the recipe by running the following command:
Launching Pinot Cluster
Create Kubernetes cluster:9000
/etc/hosts
events
topic with 5 partitions, by running the following command:
Generating data
This recipe contains a data generator that creates events with a timestamp, count, and UUID. You can generate data by running the following command:Ingesting data into Kafka
We’re going to ingest this data into an Apache Kafka topic using the kcat command line tool. We’ll also usejq
to structure the data in the key:payload
structure that Kafka expects:
Adding Pinot Schema and Table
Now let’s create a Pinot Schema and Table. First, the schema:Checking segment assignment
As soon as this config has been applied, Pinot will start ingesting the data from Kafka. We’ll let it run for a little while and then run the following script to check segment assignment:Removing server from cluster
Next, we’re going to remove a server from the Pinot cluster:
Output (shortened for brevity)
Removing tags from server
To fix this, we need to first remove all the tags from that server, by running the following:Rebalancing segments
The next is to rebalanae the segments so that any assigned to server 3 will be moved elsewhere. The API that does this takes in a lot of parameters, so we’ve wrapped it in therebalance.py
script, which you can download from GitHub.
The contents are shown below: