First, open the hosts
file, to see what's in there. Use the command highlighted in red:
.
Let's edit this file. You need to define a host name for a given address so that when you ssh
the name, the Pis will recognize what IP address you are referring to. So, let's modify the hosts
file (see the following screenshot). Enter the command sudo vim /etc/hosts
and update the records with the highlighted text (substituting your own IP address):
Note
Remember to comment out 127.0.1.1 Mst0
with the #
character, and then save the updated files by pressing the
Esc
key and entering :wq
.
Now let's give this new technique a whirl. Enter the command ssh Slv1
and then enter the password. The prompt should change to pi@Slv1:~ $
. This means that we are now in the slave node1. Let's edit the same file in the slave node, by entering sudo vim /etc/hosts
, and update the records with the highlighted text shown in the following screenshot, then save the updated file by entering Esc:wq
:
Go ahead...