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
- Clone the repository:
git clone https://github.com/questdb/questdb-packer-ami.git
- Navigate to
src
and runpacker
:
cd questdb-packer-ami/src
packer build template.json
Usage
Configuration
The AMI built using the template is generic. You might want to change the database configuration file:
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:
- Make sure you run your EC2 with an instance profile that has the
CloudWatchAgentServerPolicy
IAM policy - Create the necessary CloudWatch resources:
/questdb-<instance-id>
(with leading slash) log group andquestdb-<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:
helm repo add questdb https://helm.questdb.io/
Then, update the index:
helm repo update
Run QuestDB
Make sure you have a local cluster running:
minikube start
Then install the chart:
helm install my-questdb questdb/questdb
Finally, use the Kubernetes CLI to get the pod name:
kubectl get pods
Result:
NAME | READY | STATUS | RESTARTS | AGE |
---|---|---|---|---|
my-questdb-0 | 1/1 | Running | 1 | 9m59s |
Querying QuestDB locally
In order to run queries against your local instance of QuestDB, you can use port forwarding:
kubectl port-forward my-questdb-0 9000
You can use the following ports:
- 9000: REST API and Web Console
- 8812: Postgres
- 9009: InfluxDB line protocol