AWS AMI

You can deploy QuestDB using an Amazon Machine Image (AMI) on your EC2 instances. To facilitate the process, we maintain a repository with a Packer template that you can follow to create your own AMIs.

Prerequisites

In order to use this template, you will need:

Build the AMI

  1. Clone the repository:
  1. git clone https://github.com/questdb/questdb-packer-ami.git
  1. Navigate to src and run packer:
  1. cd questdb-packer-ami/src
  2. packer build template.json

Usage

Configuration

The AMI built using the template is generic. You might want to change the database configuration file:

  1. src/config/server.conf

For all the properties and values that you can set, please check the configuration page.

Logs and AWS CloudWatch

The AMI uses logrotate to automatically trim and archive logs generated by QuestDB. The AWS CloudWatch agent is also preinstalled and already configured. If you want the logs to be available on your CloudWatch dashboard, you need to:

  1. Make sure you run your EC2 with an instance profile that has the CloudWatchAgentServerPolicy IAM policy
  2. Create the necessary CloudWatch resources: /questdb-<instance-id> (with leading slash) log group and questdb-<instance-id> log stream (example of instance id: i-0c1386329d00506a2)

Kubernetes

You can deploy QuestDB in a Kubernetes cluster using a StatefulSet and a persistent volume. We distribute QuestDB via Helm on ArtifactHub.

Prerequisites

Get the chart

Using the Helm client, add our chart repository:

  1. helm repo add questdb https://helm.questdb.io/

Then, update the index:

  1. helm repo update

Run QuestDB

Make sure you have a local cluster running:

  1. minikube start

Then install the chart:

  1. helm install my-questdb questdb/questdb

Finally, use the Kubernetes CLI to get the pod name:

  1. kubectl get pods

Result:

NAMEREADYSTATUSRESTARTSAGE
my-questdb-01/1Running19m59s

Querying QuestDB locally

In order to run queries against your local instance of QuestDB, you can use port forwarding:

  1. kubectl port-forward my-questdb-0 9000

You can use the following ports: