Note: This blog post is related to the legacy Containership Platform and the content is no longer relevant.
We pick up where we left off with our “on ContainerShip” series. We’ve already seen how easy running Cassandra and Crate on ContainerShip can be, now let’s take a look at running Aersopike. Aerospike is a flash-optimized in-memory NOSQL database built to handle real-time big data.
In this two part guide we will:
- Setup an Aerospike cluster consisting of two hosts on Digital Ocean
- Add some data to a custom namespace
- Scale up our ContainerShip cluster from two follower hosts to four
- Ensure the new hosts have joined the Aerospike cluster
- Snapshot the cluster
- Restore the snapshot to an entirely new Digital Ocean cluster
Part 1: Initial Setup Guide
The steps below will guide you through setting up a scalable Aerospike cluster on ContainerShip. Each follower host in the cluster will run an instance of Aerospike, and join the existing cluster.
First we spin up a new ContainerShip cluster on Digital Ocean in a few clicks using ContainerShip Cloud, as seen to the left.
After a few moments, our cluster will be operational, demonstrated by the green status message.
Once the cluster has reached the operational state, it is time to visit the Navigator web-ui; here, we will create the Aerospike application with the parameters outlined to the left.
Be sure to set the container volume to /opt/aerospike/data! When a host and container volume are specified on application creation, ContainerShip Cloud knows to automatically manage the underlying volume. This means when creating a backup, Cloud will not only back up the application definition, it will also back up all data that has been written to a container’s volume for this application. This is crucial for diaster recovery or in the case of this demonstration, portability between clusters.
Once the ‘aerospike’ application has been created, set theconstraints.per_host=1 tag to run one instance of Aerospike on each follower host in your cluster.
Adding the constraints.per_host=1 Tag to the ‘aerospike’ Application
Once set, the application should automatically scale itself to the number of follower hosts in the cluster (in this case 2).
aerospike application scaling to 2 hosts
At this point we should have a fully functional Aerospike cluster! First thing we will do is grab the IP address of one of the follower hosts so we can conncet to it and add some data.
Now that we’re connected using aql we can insert a record into Aerospike.
Inserting data into the database
Now let’s query the database to ensure the record exists!
Quering the database for the new record
Awesome; we have some data! Now let’s use the asmonitor tool to get some general information about the cluster, and ensure everything is clustered correctly.
asmonitor output which demonstrates aerospike hosts are successfully clustered
As you can tell by the output, we have 2 hosts in our cluster. This is great; everything is working as expected. Now we will demonstrate how simple it is to scale our Aerospike database horizontally.
Head back over to the Cloud interface, navigate to the clusters page, choose the cluster we just launched, then click ‘edit’ in the modal to increase the number of followers to 4.
Once operational, we can see the hosts have automatically started Aerospike and have joined the existing cluster!
service-discovery and aerospike applications automatically scaling when new follower hosts are added
asmonitor output showing all 4 follower hosts are clustered
As you can see, it is incredibly easy to setup and scale an Aerospike cluster on ContainerShip! Now let’s move on to part 2 which covers backing up and restoring our cluster using ContainerShip Cloud!
Part 2: Backing Up and Restoring our Cluster
The video below demonstrates the simplicity of backing up an Aerospike cluster, and restoring it to an entirely new ContainerShip cluster running on Digital Ocean.
Migrating Aerospike with ContainerShip Cloud
And that’s it! We just migrated the entire cluster we set up in the first part of this guide to a brand new ContainerShip cluster in less than two minutes! ContainerShip Cloud backups are not just good for one-time migrations, they are also great for point-in-time snapshots and disaster recovery!
If you don’t already have an account, sign up for ContainerShip Cloud today to start running Aerospike or any other workload! If you’re interested in the tech behind our Aerospike Docker image, head over to the official repo! For more information about setting up and running your ContainerShip cluster, consult the official docs!
We hope you enjoyed this article and check back in the near future for the continuation of our “on ContainerShip” series!