This guide will walk you through the installation Single store on your Apple Silicon machine for development purposes. SingleStore is working on establishing official support for development workloads only, which means that this solution involving UTM/QEMU is not officially tested or supported by SingleStore.
SingleStore is a modern database solution designed for rapid aggregation within your data-intensive applications. It is much faster to retrieve and aggregate data than traditional MySQL-based solutions. This has personally been a crucial part of my gaming-focused analytics platform, so let me explain who I am and why I wrote this guide.
I’m Charlie Joseph and I run a Minecraft Server Analysis platform called Analysis. I built Analyze because I ran and managed various gaming communities, and I felt frustrated with the complexity and memory of other solutions, so I built my own. Analytics is fundamental to understanding the growth of your game servers, and creating Analytics meant I knew I would be dealing with large volumes of data from launch. SingleStore has been a fantastic solution for quickly aggregating data, which led me to want to host it locally so I could experiment with it more.
For this guide we will create a Debian based virtual machine that will host our SingleStore database, for this you will need to download the Debian-ISO next to UTM to run our virtual machine with Apple Silicon.
Once you have downloaded these files, drag the UTM application in your Mac’s applications folder, then open the application.
With the UTM application open, press the key + symbol present at the top of the application to create a new machine. So..
- Select the
"Emulate"option followed by
- Then select
"Browse"and choose the Debian ISO we downloaded earlier and click
- Now under
"Architecture"ensure that x86_64 is selected and Standard PC (Q35+ICH9, 2009) (alias of pc-q35-7.0) (q35) is selected under
"Memory"it’s recommended by SingleStore to have at least 4GB of RAM selected, so I’d go with at least 4096. You can optionally specify how many CPU cores you want to allocate, but I left that as the default. Then press
- For the disk space of our machines, it is recommended to allocate approximately 100GB however you can go slightly lower. Then press
- Once you’re on the
"Shared Directory"tap Continue again.
- Finally, you will be taken to
"Summary"page where you can specify a name for the virtual machine I went with Single store for this guide. Then tick the Open virtual machine options checkbox and press
Now that our virtual machine is created and the settings page is open, we will configure networking so that our machine has access to the Internet. So..
- Select the
- Under the
"Network Mode"drop-down list select the Emulated VLAN option.
- Then press
Starting our machine
With our machine created and our network configured, it’s finally time to start booting it up so we can install our virtual machine. So..
- Press the start button next to your virtual machine.
- Once started, select the
"Graphical Install” option.
Once the menu has loaded you will be greeted by a Debian 11 banner at the top. Once you see this…
- Select your language using the AT THE TOP and DOWN keys then press WALK IN to choose this option. I chose “English”.
- Then select your location and press WALK INI’m British so I opted for “United Kingdom”.
- Now select your keyboard layout and press WALK IN. I chose “British English”.
- You will have to wait about 5 minutes for the installation media to load until you see
"Configure the network".
- Then choose the hostname you want to appear on your local network and press WALK IN. I chose “harleyquinn”.
- Once you see the
"Domain Name"option, just press WALK IN.
- Next, you will be asked to create a password for the root user, as this is for development purposes, then press WALK IN. I chose “password”.
- You will now be asked to create a new user next to root:
- For the
"Full Name"choose what you would like to be called.
- For the
"Username"choose the username you want.
- For the
"Password"choose the password to use, I went with the same as above.
- Finally press the WALK IN key.
- For the
- Now wait to see the
"Partitions Disks"page. choose the Guided – use entire disk option and press WALK IN.
- Select the QEMU ATA HARD DISK option and press WALK IN.
- Select the All files in a partition and press Enter.
- Select the Finish partitioning and write changes to disk option and press WALK IN.
- Select the Yes option under
"Write the changes to disk?"and press WALK IN.
- Now wait for the installation to complete, which takes about 10 minutes.
Configuring the package manager
Once the installation is complete, you will see the
"Configure the package manager" screen, once you are here..
- Select Nope for the
"Scan extra installation media"and press WALK IN.
- Select the location of your mirror using the AT THE TOP and DOWN keys then press WALK IN to choose this option. I chose “United Kingdom”.
"Debian archive mirror"to assure deb.debian.org is selected and press WALK IN.
"HTTP proxy information” leave this field empty and press WALK IN.
- After a few minutes you will see the
"Configuring popularity-contest"page, select Nope and press WALK IN.
- Then uncheck both Debian Desktop Environment, GNOME and standard system utilitiesand tick SSH server and press WALK IN.
- Now wait for the
Once the installation is complete, we can now eject the media like this.
- Select the CD icon in the top right and hover over CDs/DVDs.
- Then press the Eject button.
- Finally select Continue of the installer.
Configuring local port forwarding
To make configuration easier while allowing us to access our SingleStore instance locally from our Mac, we will configure the ports from our machine. To do this..
- Click the power icon on the top left to turn off the machine.
- Right-click on the virtual machine and select Edit.
- Go to the
- Next to
"Port Forward"select the new tab.
"Host Port"so we can SSH in locally and click save.
- Now do the same for the port
8080for the SingleStores viewer. If you want to use a different port for any of these ports, be sure to only change the
- Click now
Single store configuration
Once our machine is installed and configured, we can finally start installing SingleStore. Press the start button next to the machine option. So..
- Click the start button to launch the machine.
- Once started, enter
rootfor the username.
- Enter the password you created earlier.
Configuring SSH for our Mac terminal
Now that we’re logged in, we need to configure SSH to be able to paste from our Mac to our machine. To do this, you will need to type the following commands in the terminal:
- To run
- To add
PermitRootLogin yesto the file, then press CTRL + X then press Yes to save the file.
- Finally, type
systemctl restart sshto restart our SSH server.
Now that we’ve enabled SSH, open your Mac’s terminal (you can use CMD + SPACE then typing
"Terminal" to do this). So..
- To run
ssh -p 2222 [email protected](or change
2222for the other SSH port we configured earlier).
- Enter your password that you set up earlier and press WALK IN.
Now that we’re connected, let’s get started:
- To run
apt -y install apt-transport-https gnupgto install our base packages.
wget -O - 'https://release.memsql.com/release-aug2018.gpg' 2>/dev/null | apt-key add - && apt-key listto add the SingleStore repository.
echo "deb [arch=amd64] https://release.memsql.com/production/debian memsql main" | tee /etc/apt/sources.list.d/memsql.listto add the package.
- To finish
apt update && apt -y install singlestoredb-toolbox singlestore-client singlestoredb-studioto install SingleStore.
Creation of our cluster
With SingleStore added, we can finally create our new cluster. To do this, go to your SingleStore Portal and log in. Next..
- Click on
"Org:"on the left.
- Select the
- In your terminal, run
LICENSE_KEY=followed by the license key found under
"Free License"on the SingleStore portal.
- Now let’s set up a database password using
LOCAL_PASSWORD=followed by the chosen password.
- Run now
sdb-deploy cluster-in-a-box --license $LICENSE_KEY --version 7.8 --password $LOCAL_PASSWORD --bind-address 0.0.0.0to install our cluster.
- In the prompts, type
yagain for both options.
Configure our cluster
Now that our cluster has been created, we need to make sure that it starts on boot alongside our cluster starting now. What can be done like this…
- To run
systemctl enable singlestoredb-studio.service
- To run
systemctl start singlestoredb-studio.service
Login to SingleStore Studio
With our cluster configured and started, go to your browser and navigate to
http://localhost:8080 (or another port if previously configured). Once here, we’ll have to…
"Add Existing Cluster".
- For login credentials.
- Use the password you specified for
- Select Development for the
- For the final details…
- Choose a custom name for it.
- Optionally specify a memorable description.
- Finally, click
You can now connect to your cluster for the online portal and connect locally to your database using the port 3306.
This was a long blog post, if this helped you be sure to tweet me @heychazza.