[root@CentOS ~]# ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Created directory '/root/.ssh'. 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: c3:b7:c4:e3:5e:6f:db:69:48:23:1e:f7:81:9b:d1:8e root@CentOS The key's randomart image is: +--[ RSA 2048]----+ | | | | | | | . . | | S = o | | = = * o | | + * X .| | . o E.=.| | . .+o.| +-----------------+ [root@CentOS ~]# ssh-copy-id CentOS The authenticity of host 'centos (192.168.169.139)' can't be established. RSA key fingerprint is f0:63:ed:d6:21:3b:b5:47:ad:e2:7f:98:bd:8f:54:94. Are you sure you want to continue connecting (yes/no)? `yes` Warning: Permanently added 'centos,192.168.169.139' (RSA) to the list of known hosts. root@centos's password:`****` Now try logging into the machine, with "ssh 'CentOS'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
[root@CentOS ~]# hdfs namenode -format ... 19/01/02 20:19:37 INFO common.Storage: Storage directory /usr/hadoop-2.6.0/hadoop-root/dfs/name has been successfully formatted. ... 再次启动需要删除/usr/hadoop-2.6.0/hadoop-root/
格式化成功后,用户可以看到以下目录结构
1 2 3 4 5 6 7 8 9 10
1.安装插件 yum install -y tree [root@CentOS ~]# tree /usr/hadoop-2.6.0/hadoop-root/ /usr/hadoop-2.6.0/hadoop-root/ └── dfs └── name └── current ├── fsimage_0000000000000000000 ├── fsimage_0000000000000000000.md5 ├── seen_txid └── VERSION
[root@CentOS ~]# start-dfs.sh Starting namenodes on [CentOS] CentOS: namenode running as process 1846. Stop it first. CentOS: starting datanode, logging to /usr/hadoop-2.6.0/logs/hadoop-root-datanode-CentOS.out Starting secondary namenodes [0.0.0.0] The authenticity of host '0.0.0.0 (0.0.0.0)' can't be established. RSA key fingerprint is f0:63:ed:d6:21:3b:b5:47:ad:e2:7f:98:bd:8f:54:94. Are you sure you want to continue connecting (yes/no)? yes 0.0.0.0: Warning: Permanently added '0.0.0.0' (RSA) to the list of known hosts. 0.0.0.0: starting secondarynamenode, logging to /usr/hadoop-2.6.0/logs/hadoop-root-secondarynamenode-CentOS.out [root@CentOS ~]# jps 2370 Jps 2133 DataNode 1846 NameNode 2267 SecondaryNameNode [root@CentOS ~]# stop-dfs.sh Stopping namenodes on [CentOS] CentOS: stopping namenode CentOS: stopping datanode Stopping secondary namenodes [0.0.0.0] 0.0.0.0: stopping secondarynamenode