Weekendlinks 2021-29

I won’t end this week without a few weekendlinks. This time: SciBabe, an ugly rock from Mars and Have I Been Powned Domain Search.


SciBabe’s Moment of Science

Yvette d’Entremont, also known as SciBabe, writes daily about either adorable creatures, strange deceases, monstrous chemicals, nuclear f%$k-ups and ways Australian flora and fauna can harm or kill you.

Daily MOS: The Ferocious Lemming

Continue reading

Posted in Weekendlinks | Tagged , , | Leave a comment

Growing up, the story of how I became a skeptic

In this blogpost I will reveal something about myself, which I never shared anywhere in my long life on the Internet. It’s rather personal and I don’t like to share a lot on that online. The more because of what the great data aggregators nowadays do with that. But to tell this story, I need to explain what happened to me and how that changed things. Also, I’m fine, really. I do 100+ km bike rides now and this week I rode 60 kms with an average speed of 33.5 km/hr, so that hopefully proves I am currently pretty healthy.


Never grow up!

Stories like this always start by saying that when I grew up I was in every aspect a normal kid. But I’m actually not sure :). Anyway at age 11 my parents noticed that I was not growing very much. This fact was underscored by the fact that my 4 year younger brother was getting taller than me: I was about 120 cm (4 feet) at the time. My mother decided this needed to be checked out by a doctor. And before I knew it, I was dragged to a local medical facility where a nurse drew some blood. I can honestly say I hated people poking needles in my arm very much. Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment

Weekendlinks 2021-28

The weather is looking good for this weekend. Time to do some cycling after a creative, but also hectic week. Talking about cycling…


The Alt Tour

You think my 160 km bike ride was crazy? How about a guy who did every kilometer in the Tour de France plus the distances between race starts and finishes (for which the riders take trains, busses and airplanes). A distance of 5500 km and double the altitude gain! That is the Alt Tour that Lachlan Morton rode.

All this with no support team or teammembers to keep him out of the wind. In fact, without hotels even. He has to gather his own food. And his nights of sleep were also less than to be desired. But nevertheless he made it in half the time of the real Tour de France.

Continue reading

Posted in Weekendlinks | Tagged , , , , , , , , | Leave a comment

Weekendlinks 2021-27

Here is the third weekendlinks edition.


Vael Ouwe bike ride

In the previous weekend I rode the Vael Ouwe bike ride. We had lots of luck with the weather. My video, made with my Sony actioncam, turned out really nice. The ride through the heather with wildflowers was beautiful and at the halfway point we rode past Radio Kootwijk, a large art deco style building that has been used for radio transmission. Near the end we climbed the Posbank twice. You can find details of the route here.

Continue reading

Posted in Weekendlinks | Tagged , , , , | Leave a comment

Weekendlink 2021-26

This is my second Weekendlink post with interesting links for you to enjoy in the weekend.


Presentation Zen on Zoom?

I’ve written many years ago on my old Oracle blog how important it is to be able to give good, clear presentations. Garr Reynolds’s Presentation Zen blog and book have been very influential on my presentation techniques. I was wondering what he was up to nowadays, apart from the 3rd edition of his Presentation Zen book. Turns out he has some good advise for your next online presentation on Zoom or WebEx.

Continue reading

Posted in Weekendlinks | Tagged , , , , , , , , | Leave a comment

Weekendlinks 2021-25

Back when I worked for Transfer Solutions we had an internal weekly newsletter that appeared every end of the week. At the end of it there was a small section by me called “weekendlinks”: 3 or 4 things I found on the Internet that were interesting, funny or thoughtprovoking for people to look at on the Friday afternoon. When I left Transfer Solutions I’ve been on the lookout for a place for my weekendlinks, but either the company where I worked didn’t have a similar newsletter, the culture was too serious or “not a good fit” otherwise.

But since this is my blog and I might just as well do as I please here, I decided to revive my weekendlinks here. It will be my Five Bullet Friday. So here goes:


An illustrated children’s book to Apache Kafka

Teaching complex matters to people is an art. Explaining modern software concepts to children is even more a challenge. But there are people who try it. There already was a Children’s Illustrated Guide to Kubernetes. Well, now there’s one for Apache Kafka too. Expect some tortured analogies though.


Maybe I should write a children’s book to data engineering one day?

Continue reading

Posted in Weekendlinks | Tagged , , , , , , | Leave a comment

What I think data engineering is (revisited)

Four years now I’ve been working as a data engineer. And when I started writing about how to enter this field (because people sometimes ask me), I found out it’s beter to start writing about what data engineering actually is. Because my view on that has changed. And actually, data engineering changed as well.

Back in 2017, when I made the jump from Oracle database administration, I thought, or was hoping, that a data engineer more or less was a data administrator in Big Data. Sure, it took a bit more programming skills and DevOps and all that, but I thought my experience in operations would largely pay off.

On the other hand, weren’t data engineers supposed to support data scientists, so the data would be prepped for them and they could iterate over this data faster? I found out data engineers exist without data scientists just as well. They provide data to the whole organization, so it can be data driven. Or management at least hopes it will be.

Continue reading

Posted in Data engineering | Tagged , | Leave a comment

I built a working Hadoop-Spark-Hive cluster on Docker. Here is how.

TL;DR: I made a Docker compose that runs Hadoop, Spark and Hive in a multi-container environment. You can find the necessary files for it here:



How it started

We at DIKW are working on a Certified Data Engineering Professional course. It is a course where you learn all aspects we could think of of being a data engineer: the cool big data stuff, but also how data warehousing works and how it all can work together.

One of the topics is Hadoop. Now our course has an important practical aspect. We’re not just going to bombard you with theory. You have to try the products/methods yourself. On your own laptop. So for the Hadoop module I suggested using the Cloudera sandbox on Docker, because our practice environments work on Docker and the Cloudera sandbox has it all.

And at one moment my colleague Hugo Koopmans told me we had a problem: building the Cloudera sandbox on his laptop took way too long and required way too much memory. Could we use an simpler (and much older) Hadoop implementation instead?

My thoughts were: Simpler? Yes! Old version? No way! We’re not going to start a new course with a 5 year old Hadoop version. And off I went on a quest for lightweight Hadoop cluster on Docker. Ideally with Spark and maybe Hive. Because I like databases.


The quest for a lightweight and up to date Hadoop cluster

After searching and finding all kinds of Hadoop on Docker images, I found most of them where old. But it turned out that Big Data Europe has a Docker environment with Hadoop 3.2.1 and it’s only 9 months old. Much better. Their Spark version is also pretty much up to date.

But how to get the Spark nodes to connect to the Hadoop nodes? I could not get the docker-composed Hadoop nodes and the docker-composed Spark nodes to speak to each other.

(There was a reason for that and I just found out why. I thought I used Big Data Europe’s Spark setup, but it looks like I got a different one. One that had a spark-net network defined. And I can’t remember where I got it from. It looks like sdesliva26’s version but it’s not that one either.)

Anyhow, I learned gradually I needed to combine the docker-compose.yml files somehow.


Quick! Learn docker-compose

Now when you’ve worked with docker-compose for a while, you might think “how hard could it be?”. But I had no idea what the principles of this thing were.

Docker-compose is a way to quickly create a multi-container environment. Perfect to create clusters, like a Hadoop cluster with a namenode and datanode. And it is defined in a docker-compose.yml file. But from the docker-compose.yml file there can be references to shell scripts to run or files with environmental settings. So you need these files too.

I’ve spent countless hours combining docker-compose services and trying to get it to work and not understanding why it would not. But after removing these Spark networks it worked much better. Turns out that when you don’t define any network in docker-compose, the services are all part of the same network that Docker creates automatically.


Disecting a docker-compose.yml file.

You can skip this section if you just want to run the Docker Hadoop environment and don’t really care how. (Go ahead. I won’t be judgemental. That’s how I started myself.)

So here is a simplified example of one service I took from the Hadoop docker-compose.yml:

version: "3"

    image: bde2020/hadoop-namenode:2.0.0-hadoop3.2.1-java8
    container_name: namenode
    restart: always
      - 9870:9870
      - 9000:9000
      - hadoop_namenode:/hadoop/dfs/name
      - CLUSTER_NAME=test
      - CORE_CONF_fs_defaultFS=hdfs://namenode:8020
      - ./hadoop.env


You can see it starts with a version. That’s the version of the docker-compose file and 3 is the latest.

The namenode service is based on an image prepared by Big Data Europe. Docker images are like blueprints for Docker containers. I sometimes think of the Docker image as an installation file and the container is the actual application running. I hope you get the idea. This service defintion refers to where the image can be found on Docker Hub. Docker Hub is like an app store for Docker images.

We can also see ports defined. Hadoop namenodes has some stuff running on these ports and we want to address these from outside the container. For example, when you have started the containers, you find namenode information on http://localhost:9870. Should you want a different port on your laptop, because multiple containers run on port 80 or something, an important thing to remember is that the first port is the port on the outside, the second is the one in the container.

The namenode also needs some permanent place to store data. For this there is the volume definition. But remember you have to add the list of volumes after defining the services also.

And there is a .env file apparently and it contains all kinds of environmental variables necessary for running Hadoop.


Let’s get this thing started

Now you can download Big Data Europe’s docker-hadoop repository or from my docker-hadoop-spark repository and from the directory where you placed it all it takes is this command to get the multi-container environment running:

docker-compose up -d

The -d means it runs in de background.

BTW the config file can have another name than docker-compose.yml. But then you need the -f option to point docker-compose to the correct file:

docker-compose up -f mymulticontainers.yml -d

And you can break it all down again by going to that same directory and running this:

docker-compose down

All the containers will then be stopped and removed. But: the images and volumes stay! So don’t be surprised that the csv file you uploaded to HDFS will still be there.


Combining docker-compose files

It turns out you can copy paste services from the Spark docker-compose.yml to the Hadoop docker-compose.yml, provided that I added the directories provided in the docker-spark Github repository. And I learned that I needed to remove the spark-network network (wherever it came from).

And I thought I needed to break the environment down and build it up again every time I changed docker-compose.yml. Because that’s how stuff usually works. But not with docker-compose. You can edit the docker-compose.yml file and run “docker-compose up” again. I learned that after a whole lot of building up and breaking down docker environments BTW.


How the Hadoop-Spark-Hive docker-compose was built

So in the end it was a question of adding services from one docker-compose.yml to the other and all the necessary files. But it took me a while to understand how to use it and from where. But I got that all figured out now and I’ve written the quick starts for HDFS, Spark and Hive.


Quick starts

Quick start HDFS

Find the Container ID of the namenode.

  docker ps |grep namenode

1df7a57164de        bde2020/hadoop-namenode:2.0.0-hadoop3.2.1-java8          "/entrypoint.sh /run…"   27 hours ago        Up 12 hours (healthy)>9000/tcp,>9870/tcp             namenode

Copy breweries.csv to the namenode.

  docker cp breweries.csv 1df7a57164de:breweries.csv

Go to the bash shell on the namenode with that same Container ID of the namenode.

  docker exec -it 1df7a57164de bash

Create a HDFS directory /data//openbeer/breweries.

hdfs dfs -mkdir /data
hdfs dfs -mkdir /data/openbeer
hdfs dfs -mkdir /data/openbeer/breweries

Copy breweries.csv to HDFS:

  hdfs dfs -put breweries.csv /data/openbeer/breweries/breweries.csv


Quick start Spark

Go to http://<dockerhadoop_IP_address>:8080 or http://localhost:8080/ on your Docker host (laptop). Here you find the spark:// master address:

  Spark Master at spark://452dd59615b0:7077

Go to the command line of the Spark master and start spark-shell.

  docker ps |grep spark
efef70177b0b        bde2020/spark-worker:3.0.0-hadoop3.2                     "/bin/bash /worker.sh"   27 hours ago        Up 12 hours      >8081/tcp                                     spark-worker-1
453dd19695b0        bde2020/spark-master:3.0.0-hadoop3.2                     "/bin/bash /master.sh"   27 hours ago        Up 12 hours      >7077/tcp, 6066/tcp,>8080/tcp   spark-master

  docker exec -it 453dd19695b0 bash
  spark/bin/spark-shell --master spark://452dd59615b0:7077

Load breweries.csv from HDFS.

  val df = spark.read.csv("hdfs://namenode:8020/data/openbeer/breweries/breweries.csv")
| _c0|                 _c1|          _c2|  _c3|_c4|
|null|                name|         city|state| id|
|   0|  NorthGate Brewing |  Minneapolis|   MN|  0|
|   1|Against the Grain...|   Louisville|   KY|  1|
|   2|Jack's Abby Craft...|   Framingham|   MA|  2|
|   3|Mike Hess Brewing...|    San Diego|   CA|  3|
|   4|Fort Point Beer C...|San Francisco|   CA|  4|
|   5|COAST Brewing Com...|   Charleston|   SC|  5|
|   6|Great Divide Brew...|       Denver|   CO|  6|
|   7|    Tapistry Brewing|     Bridgman|   MI|  7|
|   8|    Big Lake Brewing|      Holland|   MI|  8|
|   9|The Mitten Brewin...| Grand Rapids|   MI|  9|
|  10|      Brewery Vivant| Grand Rapids|   MI| 10|
|  11|    Petoskey Brewing|     Petoskey|   MI| 11|
|  12|  Blackrocks Brewery|    Marquette|   MI| 12|
|  13|Perrin Brewing Co...|Comstock Park|   MI| 13|
|  14|Witch's Hat Brewi...|   South Lyon|   MI| 14|
|  15|Founders Brewing ...| Grand Rapids|   MI| 15|
|  16|   Flat 12 Bierwerks| Indianapolis|   IN| 16|
|  17|Tin Man Brewing C...|   Evansville|   IN| 17|
|  18|Black Acre Brewin...| Indianapolis|   IN| 18|
only showing top 20 rows

How cool is that? Your own Spark cluster to play with.


Quick start Hive

Find the Container ID of the Hive Server.

  docker ps |grep hive-server

60f2c3b5eb32        bde2020/hive:2.3.2-postgresql-metastore                  "entrypoint.sh /bin/…"   27 hours ago        Up 12 hours             >10000/tcp, 10002/tcp                        hive-server

Go to the command line of the Hive server and start hiveserver2

  docker exec -it 60f2c3b5eb32 bash


Maybe a little check that something is listening on port 10000 now

  netstat -anp | grep 10000
tcp        0      0 *               LISTEN      446/java

Okay. Beeline is the command line interface with Hive. Let’s connect to hiveserver2 now.

  !connect jdbc:hive2:// scott tiger

Didn’t expect to encounter scott/tiger again after my Oracle days. But there you have it. Definitely not a good idea to keep that user on production.

Not a lot of databases here yet.

  show databases;
| database_name  |
| default        |
1 row selected (0.335 seconds)

Let’s change that.

  create database openbeer;
  use openbeer;

And let’s create a table.

    NUM INT,
    NAME CHAR(100),
    CITY CHAR(100),
    STATE CHAR(100),
    ID INT )
location '/data/openbeer/breweries';

And have a little select statement going.

  select name from breweries limit 10;
|                        name                        |
| name                                                                                                 |
| NorthGate Brewing                                                                                    |
| Against the Grain Brewery                                                                            |
| Jack's Abby Craft Lagers                                                                             |
| Mike Hess Brewing Company                                                                            |
| Fort Point Beer Company                                                                              |
| COAST Brewing Company                                                                                |
| Great Divide Brewing Company                                                                         |
| Tapistry Brewing                                                                                     |
| Big Lake Brewing                                                                                     |
10 rows selected (0.113 seconds)

There you go: your private Hive server to play with.



I got the lightweight Hadoop environment that I wanted. On my Windows 10 laptop with WSL2 (Windows Subsystem for Linux 2) installed, it uses only 3 GB memory. That’s not half bad. It sometimes was a frustrating journey, but I learned a lot about Docker and docker-compose and learned to love it.

I hope you have fun with this Hadoop-Spark-Hive cluster too.

Screenshot of Docker Desktop with the hadoop-spark-hive cluster


Posted in Howto, Learning Big Data, Spark | Tagged , , , , , , | 10 Comments

A humidity sensor network on a Raspberry Pi with Zigbee2MQTT

I was looking for a way to detect leakage in my appartement with some kind of IoT solution. Someone on the Dutch technology forum Tweakers.net told me Xiaomi Humidity sensors, combined with a Zigbee2MQTT might be a good fit. The sensors are quite cheap and so is the CC2531 sniffer stick to receive the data sent over the Zigbee protocol.

So that’s what I set out to do. And in these two videos you see how I got my humidity sensor network working.


We visualize the humidity sensor data with Domoticz. Domoticz is a home automation system.


So now I have streaming IoT data. I have some plans for that in the future.

Posted in Howto | Tagged , , , , , , | Leave a comment