Running crate database on balena

On this message I would like to share that with Marija from Crate we built a Crate Database instance running on balena.

CrateDB is an open-source database that makes storage and analysis of massive amounts of data simple and efficient. It can handle various data types, from time-series, geospatial, structured, and semi-structured data. Combining SQL and NoSQL features, CrateDB offers a high degree of scalability and availability, SQL compatible interface, and easy integration. Furthermore, CrateDB supports dynamic schemas, queryable objects, and real-time full-text search over millions of documents in just a few seconds. These capabilities make CrateDB a perfect choice for many data-intensive analytics applications.

DISCLAIMER: This is a test to demonstrate that CrateDB can run on balena. We are looking for developers from the community who would like to run applications on balena + crateDB.

Getting started

Hardware

  • Raspberry Pi 4 (only tested on this device)
  • SD card
  • Power supply and Ethernet cable (if you don’t use WiFi)

Software

Deploy CrateDB on your fleet

The easiest way to deploy a CrateDB instance on a balena device is clicking on the button below :point_down::point_down::point_down:

deploy-with-balena

Follow instructions, click Add a Device and flash an SD card with that OS image dowloaded from balenaCloud. Enjoy the magic :star2:Over-The-Air​:star2:!

Find here the github repo with the source code.

On balenaCloud click Add Device and follow the steps to download an image. Flash a SD card to flash the balenaOS image to your device and see how the crateDB service gets deployed on your device’s fleet.

Run crateDB instance on the Raspberry Pi

Change the max_map_count

Once the CrateDB service is deployed on your device, you might see an error on the Logs and the service restarting. Open the HostOS ssh Terminal and type:

sysctl -w vm.max_map_count=212144

This command increments max_map_count which is the maximum number of memory map areas a process may have of your container. It’s by default 65536 as most of the applications need less than a thousand maps.

Once the instraction is submitted, the CrateDB service might start properly.

Access to the CrateDB UI

Copy your local IP address and paste it into your browser with the port 4200 and that might open the CrateDB UI.

Install crash CLI

If you need a CLI to interact with the Crate database instance you will need to install crash. To install crash open the cratedb Terminal and type:

curl -o crash https://cdn.crate.io/downloads/releases/crash_standalone_latest

chmod +x crash

./crash

Questions? Comments?

Feel free to add your comments here. And if you build a new project using CrateDB and balena let us know :slight_smile:

1 Like