With the operators installed, deploy a Druid cluster and its dependencies. Afterward you can verify that it works by ingesting example data and subsequently query it.
Three things need to be installed to have a Druid cluster:
-
A ZooKeeper instance for internal use by Druid
-
An HDFS instance to be used as a backend for deep storage
-
A PostgreSQL database to store the metadata of Druid
-
The Druid cluster itself
Create them in this order, each one is created by applying a manifest file. The operators you just installed then create the resources according to the manifests.
Create a file named zookeeper.yaml with the following content:
link:example$getting_started/zookeeper.yaml[role=include]Then create the resources by applying the manifest file:
link:example$getting_started/getting_started.sh[role=include]Create hdfs.yaml with the following contents:
link:example$getting_started/hdfs.yaml[role=include]And apply it:
link:example$getting_started/getting_started.sh[role=include]
Install a PostgreSQL database using helm.
If you already have a PostgreSQL instance, you can skip this step and use your own below.
link:example$getting_started/getting_started.sh[role=include]Create a file named druid.yaml with the following contents:
link:example$getting_started/druid.yaml[role=include]And apply it:
link:example$getting_started/getting_started.sh[role=include]
This creates the actual Druid Stacklet.
|
Warning
|
This Druid instance uses Derby (dbType: derby) as a metadata store, which is an interal SQL database.
It is not persisted and not suitable for production use!
Consult the Druid documentation{external-link-icon} for a list of supported databases and setup instructions for production instances.
|
Submit an ingestion job and then query the ingested data — either through the web interface or the API.
First, make sure that all the Pods in the StatefulSets are ready:
kubectl get statefulsetThe output should show all pods ready:
NAME READY AGE simple-druid-broker-default 1/1 5m simple-druid-coordinator-default 1/1 5m simple-druid-historical-default 1/1 5m simple-druid-middlemanager-default 1/1 5m simple-druid-router-default 1/1 5m simple-hdfs-datanode-default 1/1 6m simple-hdfs-journalnode-default 1/1 6m simple-hdfs-namenode-default 2/2 6m simple-zk-server-default 3/3 7m
Next, ingest some example data using the web interface.
You can either use stackablectl stacklet list to find out the address the Druid router is reachable at and use that address, or you can create a port-forward for the Druid Router:
kubectl port-forward svc/simple-druid-router 9088 > /dev/null 2>&1 &If you prefer to use the command line instead, follow the instructions in the collapsed section below.
Alternative: Using the command line
If you prefer to not use the web interface and instead interact with the API, create a file ingestion_spec.json with the following contents:
link:example$getting_started/ingestion_spec.json[role=include]Submit the file with the following curl command:
link:example$getting_started/getting_started.sh[role=include]Continue with the next section.
To open the web interface navigate your browser to https://localhost:9088/ to find the dashboard:
Now load the example data:
Click through all pages of the load process. You can also follow the Druid Quickstart Guide{external-link-icon}.
Once you finished the ingestion dialog you should see the ingestion overview with the job, which eventually shows SUCCESS:
Query from the user interface by navigating to the "Query" interface in the menu and query the wikipedia table:
Alternative: Using the command line
To query from the commandline, create a file called query.json with the query:
link:example$getting_started/query.json[role=include]and execute it:
link:example$getting_started/getting_started.sh[role=include]The result should be similar to:
link:example$getting_started/expected_query_result.json[role=include]Great! You’ve set up your first Druid cluster, ingested some data and queried it in the web interface.
Have a look at the usage-guide/index.adoc page to find out more about the features of the operator, such as S3-backed deep storage (as opposed to the HDFS backend used in this guide) or OPA-based authorization.



