Hadoop版本为1.2.1
  Linux使用Fedora19并使用hadoop账号安装
  第一步:配置ssh本地登录证书(虽然为伪分布模式,Hadoop依然会使用SSH进行通信)

 

[hadoop@promote ~]$ which ssh
/usr/bin/ssh
[hadoop@promote ~]$ which ssh-keygen
/usr/bin/ssh-keygen
[hadoop@promote ~]$ which sshd
/usr/sbin/sshd
[hadoop@promote ~]$ ssh-keygen -t rsa

  然后一路回车

 

Generating public/private rsa key pair.
Enter file in which to save the key (/home/hadoop/.ssh/id_rsa):
Created directory '/home/hadoop/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Passphrases do not match.  Try again.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/hadoop/.ssh/id_rsa.
Your public key has been saved in /home/hadoop/.ssh/id_rsa.pub.
The key fingerprint is:
2f:a9:60:c7:dc:38:8f:c7:bb:70:de:d4:39:c3:39:87 hadoop@promote.cache-dns.local
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
|                 |
|                 |
|                 |
|        S        |
|     o o o o +   |
|    o B.= o E .  |
|   . o Oo+   =   |
|      o.=o.      |
+-----------------+

  终将在/home/hadoop/.ssh/路径下生成私钥id_rsa和公钥id_rsa.pub
  [hadoop@promote .ssh]$ cd /home/hadoop/.ssh/
  [hadoop@promote .ssh]$ ls
  id_rsa  id_rsa.pub
  修改sshd服务配置文件:
  [hadoop@promote .ssh]$ su root
  密码:
  [root@promote .ssh]# vi /etc/ssh/sshd_config
  启用RSA加密算法验证(去掉前面的#号)

 

RSAAuthentication yes
PubkeyAuthentication yes
# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile      .ssh/authorized_keys