In the previous blog, we installed Ubuntu and made our first virtual machine. This first machine is going to act as our blueprint by which we will clone all our other virtual machines. So, lets get started!
Now that we have a virtual machine, we are going to run some commands. So, open a terminal, and pin it to your launcher.
When you open the terminal for the first time, you will see at the top that it says:
Basically, “sudo” is what you must type first in order to run a command as the superuser or administrator.
Making Sure Things Are Up To Date
Before we start doing any thing, we’ll want to make sure everything is up to date. To do this, run:
Press ENTER, and then type your password.
This may take a few minutes to finish. When it asks if you want to continue, type Y for yes.
Once it is finished, there are two more things we want to do before cloning this virtual machine.
Installing the SSH Server
The software we will be using needs to have SSH access to all of the nodes in our cluster, as well as have SSH access to itself. So, a future step will be to connect all our nodes via SSH. We’ll be doing this in the next blog. For now, however, we will need to set up an SSH server before we clone this virtual machine.
To do this, run this command:
Now press ENTER, type in your password, and type Y to continue when it asks you.
There you go. The SSH server is installed, and our virtual machine is ready to be cloned.
Setting The Network
Shut down the virtual machine.
The first thing we need to do is set up our virtual machine to be on a specific type of network. To do this, find your virtual machine in the left side menu of VirtualBox.
Right click it, and then click Settings.
Now, in the Settings window that comes up, go to Network.
This is where the network settings for this virtual machine are set.
The NAT for Adapter 1 is not going to work for our purposes, so we’ll have to add another adapter.
Click Adapter 2.
Now put a check by Enable Network Adapter.
Essentially, we are trying to make it so that, once we have multiple nodes, they will each be able to communicate with one another on the same network.
To do this, we will need to click the drop-down for “Attached to” and select Host-only Adapter.
Now we can select which network we want to use. We will do vboxnet0 for our network (it should be set to this by default).
Now we are ready to clone our virtual machine.
Cloning Our Virtual Machines
We are going to make three clones.
Right click your virtual machine in the left side menu, and then click Clone.
In the widow that comes up, give the virtual machine a new name. Since this first clone will be the one we have ClusterControl on, we will name it ClusterControl.
Make sure you select Reinitialize the MAC address of all network cards. This will ensure the networking operates correctly.
Then click Continue.
Now, in the next page that shows up, make sure you select Full clone, and then click Clone.
Give it a few seconds to process, and then we will have our first clone!
Now we will make the last two clones. These will be our two master nodes, and we’ll be following this same process to make them.
First, in the left side menu, right click one of the virtual machines we made and then click Clone.
Now, in the window that appears, rename this clone Master 1. Select Reinitialize the MAC address of all network cards, and then click continue.
The rest of the process is exactly the same as what we did for the first clone. So, just follow those directions again.
Once you are finished cloning the Master 1 node, repeat the process one last time for the second master node.
Remember to name this last clone Master 2, and don’t forget to select Reinitialize the MAC address of all network cards when you rename it.
Alright, we have all our virtual machines ready to go!
Just a couple things before we go.
First, the production needs the same user and password on all virtual machines. Because we were cloning, this already happened by default. So, make sure you don’t go back and change around the passwords for any of the machines.
Second, its a good idea to keep the original starter virtual machine you made just in case you ever want to go back and make another clone.
All of our virtual machines are now set up. The next thing we need to do is set up passwordless SSH so that all the nodes can communicate with one another through it. I will guide you through this process in the next article!