Setup TimescaleDB with Docker Compose: A Step-by-Step Guide

This tutorial will guide you through setting up and using TimescaleDB using Docker Compose.

Prerequisites

  • Docker installed on your system
  • Docker Compose installed on your system

Getting Started

  1. Start the TimescaleDB Container

    Navigate to the directory containing the docker-compose.yml file and run:

    docker-compose up -d
    

    This will start TimescaleDB in detached mode. The database will be accessible on port 5432.

  2. Connection Details

    • Host: localhost
    • Port: 5432
    • Database: timescale
    • Username: timescale
    • Password: timescale
  3. Verify the Installation

    You can connect to the database using psql or any PostgreSQL client:

    docker exec -it timescale-timescaledb-1 psql -U timescale -d timescale
    

    Once connected, you can verify TimescaleDB is properly installed:

    SELECT default_version, installed_extensions FROM pg_available_extensions WHERE name = 'timescaledb';
    
Continue reading “Setup TimescaleDB with Docker Compose: A Step-by-Step Guide”

Building a Container Image w/ jib-maven Build Plugin

First I’ve setup a project, similar to the Hello World GraphQL API I setup here. I’ll setup another project that specifically uses Maven, to use the jib-maven plugin.

Setting Up the Project

I’ve used the standard Spring Initializr in Intellij.

  • Project: Maven Project
  • Language: Java
  • Spring Boot: Choose the latest stable version
  • Project Metadata: Fill in as per your requirement
  • Packaging: Jar
  • Java Version: Choose your Java version (e.g., 11)
  • Dependencies: Add ‘Spring Web’, ‘Spring Boot DevTools’, and ‘Spring for GraphQL’
Continue reading “Building a Container Image w/ jib-maven Build Plugin”

A Really Quick Introduction to Minikube

There’s likely a million introductions to Minikube, but I wanted one of my own. Thus, here you go!  Minikube is basically Kubernetes light that runs on your own machine. Albeit, it does this similarly to how Docker used to do it, via a virtual machine. Thus, you can do some things with it but if you want to get serious you’ll still need to spool up a proper cluster somewhere as it will start to bog down your machine with any heavy workloads.

1: Minikube – Installing

Linux Direct:

 curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \
   && sudo install minikube-linux-amd64 /usr/local/bin/minikube

Linux Debian:

 curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \
   && sudo install minikube-linux-amd64 /usr/local/bin/minikube

Linux Red Hat:

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-1.4.0.rpm \
 && sudo rpm -ivh minikube-1.4.0.rpm

2: Starting Minikube

minikube start will start a minikube instance, pulling images, resources, kubelets, kubeadm, dashboard, and all those resources.

00-starting

3: Stopping Minikube

minikube stop brings the minikube service to a stop, allowing for restart later.

09-stopping-minikube

4. Deleting Minikube

minikube delete will delete the minikube. This will delete any of the content or related collateral that was running in the minikube.

01-delete

5. Restarting after Delete

minikube start this is the way to restart a minikube instance after you’ve stopped the instance. It’s also the way start a minikube, as shown above.

03-restarting-after-delete

6. Starting a Named Minikube

If you want a named minikube instance, use the -p switch, with a command like minikube start -p adrons-minikube.

04-minikube-with-name

7. Starting & Using the Dashboard

To check out the dashboard, that pretty Google dashboard for Kubernetes, run minikube dashboard to bring that up.

05-starting-dashboard

06-minikube-dashboard.png

8. Status!

To get a quick update on the current state of the minikube instance just run minikube status.

07-other-minikube-commands

9. Starting Minikube sans a Virtual Machine

This is, albeit I may be mistaken, this is a Linux only feature. Run minikube start --vm-driver=none and it’ll kick off a minikube right there on your local machine.

09-minikube-no-vm-started.png

References:

Bunches of Databases in Bunches of Weeks – PostgreSQL Day 1

May the database deluge begin, it’s time for “Bunches of Databases in Bunches of Weeks”. We’ll get into looking at databases similar to how they’re approached in “7 Databases in 7 Weeks“. In this session I got into a hard look at PostgreSQL or as some refer to it just Postgres. This is the first of a few sessions on PostgreSQL in which I get the database installed locally on Ubuntu. Which is transferable to any other operating system really, PostgreSQL is awesome like that. Then after installing and getting pgAdmin 4, the user interface for PostgreSQL working against that, I go the Docker route. Again, pointing pgAdmin 4 at that and creating a database and an initial table.

Below the video here I’ve added the timeline and other details, links, and other pertinent information about this series.

0:00 – The intro image splice and metal intro with tunes..
3:34 – Start of the video database content.
4:34 – Beginning the local installation of Postgres/PostgreSQL on the local machine.
20:30 – Getting pgAdmin 4 installed on local machine.
24:20 – Taking a look at pgAdmin 4, a stroll through setting up a table, getting some basic SQL from and executing with pgAdmin 4.
1:00:05 – Installing Docker and getting PostgreSQL setup as a container!
1:00:36 – Added the link to the stellar post at Digital Ocean’s Blog.
1:00:55 – My declaration that if Digital Ocean just provided documentation I’d happily pay for it, their blog entries, tutorials, and docs are hands down some of the best on the web!
1:01:10 – Installing Postgesql on Ubuntu 18.04.
1:06:44 – Signing in to Docker hub and finding the official Postgresql Docker Image.
1:09:28 – Starting the container with Docker.
1:10:24 – Connecting to the Docker Postgresql Container with pgadmin4.
1:13:00 – Creating a database and working with SQL, tables, and other resources with pgAdmin4 against the Docker container.
1:16:03 – The hacker escape outtro. Happy thrashing code!

For each of these sessions for the “Bunches of Databases in Bunches of Weeks” series I’ll follow this following sequence. I’ll go through each database in this list of my top 7 databases for day 1 (see below), then will go through each database and work through the day 2, and so on. Accumulating additional days similarly to the “7 Databases in 7 Weeks

Day 1” of the Database, I’ll work toward building a development installation of the particular database. For example, in this session I setup PostgreSQL by installing it to the local machine and also pulled a Docker image to run PostgreSQL.

Day 2” of the respective database, I’ll get into working against the database with CQL, SQL, or whatever that one would use to work specifically with the database directly. At this point I’ll also get more deeply into the types, inserting, and storing data in the respective database.

Day 3” of the respective database, I’ll get into connecting an application with C#, Node.js, and Go. Implementing a simple connection, prospectively a test of the connection, and do a simple insert, update, and delete of some sort against the respective database built on the previous day 2 of the same database.

Day 4” and onward I’ll determine the path and layout of the topic later, so subscribe on YouTube and Twitch, and tune in. The events are scheduled, with the option to be notified when a particular episode is coming on that you’d like to watch here on Twitch.

Next Events for “Bunches of Databases in Bunches of Days