Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Thursday, December 17, 2015

Hadoop Cluster:Passwordless SSH setup on CentOs In 3 Steps

Step 1:

[root@pravi ~]# yum install openssh-clients -y 

[root@pravi ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
e7:55:ae:cd:e0:b3:91:4a:36:53:a7:d7:62:d2:9a:d8 root@master.techvantage.com
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
|                 |
|              .  |
|             o   |
|        S . + o  |
|         o + X . |
|          * O B .|
|         o * X . |
|          o E    |
+-----------------+


~/.ssh/id_rsa [private key]
~/.ssh/id_rsa.pub [public key]

Step 2:

[root@master ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub <slave-ip>
Now try logging into the machine, with "ssh 'slave'", and check in:

  .ssh/authorized_keys


to make sure we haven't added extra keys that you weren't expecting.

Step 3

[root@master ~]# ssh <slave-hostname>



Error:Server and "device eth0 does not seem to be present, delaying initialization" Error

Solutions:

#less /etc/udev/rules.d/70-persistent-net.rules

#rm -f /etc/udev/rules.d/70-persistent-net.rules

Reboot your machine as after reboot a new file will be created with the details of your new NIC card

#init 6
#less /etc/udev/rules.d/70-persistent-net.rules
As you can see the difference in MAC id and NIC card name
It is time for you to copy the new MAC id and NIC card name to your ifcfg-eth0 file

# vi /etc/sysconfig/network-scripts/ifcfg-eth0

Change MAC Address

Error connect: Network is unreachable - Static Ip Setup Linux

 ping www.google.com
 connect: Network is unreachable

Solutions:
Edit /etc/sysconfig/network-scripts/ifcfg-etho

# cp -r ifcfg-etho ifcfg-etho.bkp

Add Gateway

# vim ifcfg-etho

DEVICE=eth1 //device name
HWADDR=00:0C:29:5b:cf:72
TYPE=Ethernet
UUID=
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
NETMASK=255.255.255.0
IPADDR=<ip-address>
USERCTL=yes
GATEWAY=<Server - ip>