DEV Community

Cover image for Getting Started with Aerospike Enterprise Edition On Docker Desktop
Mark Prince for Aerospike

Posted on • Updated on

Getting Started with Aerospike Enterprise Edition On Docker Desktop

What’s the fastest way to start using Aerospike Database Enterprise Edition? The title gives it away: spin up a Docker container! Let’s get you from zero to running your own Aerospike Enterprise Edition instance in <10 minutes.

Get a Free Enterprise Edition License

Click the Try Now button in the upper-right corner of aerospike.com, enter your contact information and select the Enterprise Edition option.

Download the Evaluation License File

Check your email and click to download the evaluation license file. The downloaded file is named evaluation-features.conf. This is your license to run a fully loaded single node of Aerospike Enterprise Edition (EE).
Welcome to the Aerospike Family

Create a Volume to Share with the Docker Container

Open your Terminal or Windows Linux Subsystem prompt. Use mkdir (or sudo mkdir, if necessary) to create a new directory. I created the directory named EE_eval_file in my home directory. Use cp or sudo cp to copy the evaluation-features.conf into the new directory.

Note: A best practice is to create /opt/aerospike/etc, because this mirrors the standard location for the evaluation-features.conf file on an Aerospike server. To create that directory, use the command sudo mkdir -p /opt/aerospike/etc.

Install Docker Desktop & Share the Evaluation Features Directory

Download and install Docker Desktop.

In Docker Desktop, go to Preferences → Resources → File Sharing. Click + and browse to the directory you created in the previous step to hold your evaluation-features.conf file. (Hold Command + Shift when you click to show hidden directories.) To apply the change, click Apply & Restart. Now your EE container will be able to access your evaluation license.

Docker Preferences Showing New Share

At this point, you can close Docker Desktop. You will do the rest from the command line.

Pull and Spin Up an Enterprise Edition Container

Pull the EE image from the Docker Hub registry using the following command:

docker pull aerospike/aerospike-server-enterprise
Enter fullscreen mode Exit fullscreen mode

Aerospike maintains a set of images and Docker does the grunt work of downloading and verifying the EE image.
Screencap of Docker Pull EE

Now, you’re ready to spin up your EE container:

docker run -tid --name aerospike -p 3000:3000 -p 3001:3001 -p 3002:3002 -v <DIRECTORY>:/aerospike/etc/ -e "FEATURE_KEY_FILE=/aerospike/etc/evaluation-features.conf" -e "NAMESPACE=aerospike-demo" aerospike/aerospike-server-enterprise
Enter fullscreen mode Exit fullscreen mode

Replace the text <DIRECTORY> with the absolute path to the directory containing your evaluation-features.conf file. If using Windows Linux Subsystem, make sure to use your Windows backslashes and drive designations.

Docker Run flags used:
-t : Tty, allocates a pseudo-tty
-i : Interactive mode, keeps STDIN open even if not attached
-d : Detached mode, start the container in the background; exits when the root process used to run the container exits
--name : Name, Gives the container the name aerospike
-p : Ports, maps container Ports 3000, 3001, and 3002 to the host
-v : Volume, maps a local directory for use in the container
-e : Environment, sets environment variables in the container

Here’s the repo and README.md for the EE dockerfile so you can tailor EE to better suit your evaluation.

Because of the -d option, docker returns the container ID.

Screencap of Docker Run EE

At this point, your EE container should be running. Verify with the command:

docker ps
Enter fullscreen mode Exit fullscreen mode

Screencap of Docker PS

Okay, I have EE running, now what?

It’s play time! :) Let’s add a record and read it using the aerospike-tools Docker Container. First, grab the image:

docker pull aerospike/aerospike-tools
Enter fullscreen mode Exit fullscreen mode

Screencap of Docker Pull Tools

Next, spin up a new container running AQL, the Aerospike command-line data browser:

docker run -it aerospike/aerospike-tools aql -h  $(docker inspect -f '{{.NetworkSettings.IPAddress }}' aerospike)
Enter fullscreen mode Exit fullscreen mode

Since AQL is running in a different container from the instance of EE, the above command uses docker inspect to find the IP address of your EE container, and passes it to AQL using the -h option.

At this point, you can type interactive commands into AQL in your Terminal or WLS prompt. Insert a record into Aerospike EE using the following data model:
Namespace – aerospike-demo (set in the first docker run command)
Set name – foo
Bin name – bar
Primary key – 123
String data – ‘w00t!’

insert into aerospike-demo.foo (PK, bar) values (123, 'w00t!')
Enter fullscreen mode Exit fullscreen mode

...and view all data in the namespace:

select * from aerospike-demo.foo
Enter fullscreen mode Exit fullscreen mode

Screencap of Insert and Select

Next Steps...

Now that Aerospike Enterprise Edition is running, you can download and install an Aerospike client, and then REALLY put your Aerospike EE to work.

Do you want to learn more about using Aerospike Database? Check out our Developer Hub. There’s a wealth of resources available there to jump-start your Aerospike education! I’m excited for you. If you have any questions, feel free to post on the Forums.

Enjoy efficient management of data at scale!

Thanks to Yaoqi for the match.

Top comments (0)