Installing a cluster for Big Data

Predict a profit

 Step 1: Configure network connectivity by FQDN

1- Define the number of machines in our cluster

This step consists of creating a local network of several machines.

Give an FQDN and a fixed IP address for each machine, for example:

  • Serv1.com : 192.168.56.101
  • Serv2.com : 192.168.56.102
  • Serv3.com : 192.168.56.103
To do this, follow the process below:

2- Open the Ubuntu terminal on the main machine and access as an administrator with the command: sudo -i

3- Check the FQDN of each machine using the command hostname –f. This displays the default FQDN of your machine. To change, use the command: hostnamectl set-hostname serv1.com

You do the same for the other machines with the names: serv2.com; serv3.com; ...

4- Now each machine has an FQDN and a fixed IP address. You just have to check the communication by FQDN. To do this, open the /etc/hosts file using the command nano /etc/hosts

Edit this file adding the other machines. For example, in our case of three machines, we must add the following lines:

192.168.56.101    Serv1.com

192.168.56.102    Serv2.com

192.168.56.103    Serv3.com

After: Ctrl + o to save and Ctrl + x to exit

Remember to do the same on all machines in our cluster.

To verify connectivity, type pingFQDN of the remote machine

Step 2: Configuring remote access via SSH without password

For secure access, we will use the openssh tool which will allow secure access based on authentication keys. This is very important because the main machine has to access the other machines and install the necessary services. Also, the other machines must access the main machine to have services and parameters. So, follow the next procedure:

1- Install OpenSSH with the command: apt-get install openssh-server

2- Give a password for the root user with the command: passwd
    Then type the password 1234 for example.

3- Change the PermitRootLogin parameter to 'yes' in the file /etc/ssh/sshd_config 
    Ctrl + o to save and Ctrl + x to exit


4- Restart the SSH service with the command: service ssh restart

5- Perform the above procedure in all machines

6- Now, remotely access from the serv1.com machine to the serv2.com machine by the command: ssh serv2.com
    You notice that the remote machine asks you to enter the password to authenticate. Everything is fine, you just need to change the ssh access mode to an authentication key instead of a password.

7- To authenticate with a key, you must first generate an authentication key in all machines by the command: ssh-keygen

8- Well, every machine now has an authentication key. You just have to send it to all remote machines using the command: ssh-copy-id ‘FQDN Remote machine
    Example: type the command ssh-copy-id serv2.com on the terminal of the serv1.com machine will copy the key of the serv1.com machine to the serv2.com machine
    Remember to do the same for each couple of machines in a bidirectional fashion. And be aware that you must copy the key to the same local machine as well.

Now, You can connect to any remote machine from any local machine without prompting for a password.

Conclusion: 

    This is only a preliminary step to prepare the infrastructure of a cluster for Big Data. If the previous goals have not been achieved, you cannot proceed to the next phase.

Comments

You are welcome to share your ideas with us in comments!

Contact Me

Send