ubuntu集群hadoop配置

1.修改所有机器/etc/hosts
192.168.1.153  liuying002
..

2.在本地机器上生成密码对

[root@sg201 .ssh]# 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:
64:4e:53:ff:4b:f9:e4:34:6c:e0:45:5c:1f:20:c6:81 root@sg201


这时可以 看到在/root/.ssh下生成了私钥id_rsa和公钥id_rsa.pub这两个文件

scp id_rsa.pub root@liuying002:/root/.ssh
cat id_rsa.pub >> authorized_keys
把所有机器中的公钥内容加到authorized_keys
然后把authorized_keys复制到各个机器
scp authorized_keys root@liuying002:/root/.ssh

3.修改2台主机中的hadoop配置文件
masters   liuying002
修改2台主机中的hadoop配置文件
slaves   liuying003

4.tar -zcvf /usr/hadoop.tar.gz hadoop

5.scp hadoop.tar.gz root@liuying002:/usr/local

6.tar -zxvf hadoop.tar.gz

7.hadoop namenode -format

你可能感兴趣的:(hadoop,ubuntu)