Docker - QuestDB Container Setup


QuestDB is a high-performance, open-source SQL database. QuestDB’s stack is engineered from scratch, zero-GC Java and dependency-free. It includes endpoints for PostgreSQL wire protocol, high-throughput schema-agnostic InfluxDB Line Protocol, and a REST API for queries, bulk imports, and exports. QuestDB is an alternative to InfluxDB. You can read here about the differences between InfluxDB, TimescaleDB and QuestDB.

Personally, I really like the simple design of QuestDB. Maybe it’s time to get back to basics, because I couldn’t get used to the flux syntax and found the UI of InfluxDB nice but not pleasant to work with. QuestDB could be the perfect complement for time-series data next to the relational data I have in MariaDB.

The first thing I wanted to do with QuestDB is to save sensor data from my smartmeter using n8n. Since n8n has a QuestDB integration, I thought that would be a good test case for both QuestDB and n8n.

Installation

Here I describe the installation of the Docker QuestDB container. I run this Docker container on a Ubuntu VM that runs via [[ Proxmox VE ]]. I perform the following on the CLI.

Docker pull command:

docker pull questdb/questdb

Within my home folder I have created a Docker folder where I create a subfolder for each container:

cd ~
mkdir -p docker/questdb
cd docker/questdb

Also create folders where the data can be stored:

mkdir data

Now create a shell script with Nano:

sudo nano questdb_run.sh

With this shell script we are going to create the container. Copy the following into questdb_run.sh:

docker run -d \
 --name=questdb \
 --hostname=questdb \
 -p 9000:9000 \
 -p 8812:8812 \
 -p 9009:9009 \
 -v $PWD/data:/var/lib/questdb \
 -e TZ="Europe/Amsterdam" \
 -e QDB_TELEMETRY_ENABLED=false \
 --restart unless-stopped \
 questdb/questdb

If necessary, adjust the following:

-p 9000:9000
This is the web console and REST port. Choose a port that is still available. Check this with netstat

-p 8812:8812
This is the PostgreSQL port. Choose a port that is still available. Check this with netstat

-p 9009:9009
This is the InfluxDB Line Protocol port. Choose a port that is still available. Check this with netstat

-v $PWD/data:/data
Choose the location for the data. In this example it is the data map we created

-e TZ=Europe/Amsterdam
Pick the right timezone. This is the system timezone which controls what some scripts and commands return like $ date

-e QDB_TELEMETRY_ENABLED=false
QuestDB sends anonymous telemetry data with information about usage. Choose to enable or disable this

Exit Nano with CTRL-X and save the changes.

Start the container:

sudo sh questdb_run.sh

Check if the container is running properly.

Using QuestDB

The QuestDB Web Console can now be accessed via the following URL:

http://<IP DOCKER HOST>:9000/

See also my notes about updating containers with Portainer or via the CLI. With Synology’s Docker Application, updating a container is also very easy.


Read other notes

Comments

    No comments found for this note.

    Join the discussion for this note on this ticket. Comments appear on this page instantly.

    Tags


    Notes mentioning this note

    • Docker - QuestDB Container Setup
      QuestDB is a high-performance, open-source SQL database. QuestDB’s stack is engineered from scratch, zero-GC Java and dependency-free. It includes endpoints...

    Notes Graph