标签:

1、 每个结点分别产生公私密钥
ssh-keygen -t dsa -P ‘‘ -f ~/.ssh/id_dsa

[root@master .ssh]# cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
yum -y install openssh-clients
当master就可以顺利安全地访问这两个slave结点了。操作过程如下:
[root@node1 ~]# scp root@master:~/.ssh/id_dsa.pub ./master_dsa.pubThe authenticity of host ‘master (30.96.76.220)‘ can‘t be established.RSA key fingerprint is ae:8c:7f:00:df:40:b8:ec:20:4b:53:78:98:46:8a:c5.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added ‘master,30.96.76.220‘ (RSA) to the list of known hosts.root@master‘s password:id_dsa.pub 100% 601 0.6KB/s 00:00[root@node1 .ssh]# cat master_dsa.pub >> authorized_keys
[root@master .ssh]# ssh node1The authenticity of host ‘node1 (30.96.76.221)‘ can‘t be established.RSA key fingerprint is ae:8c:7f:00:df:40:b8:ec:20:4b:53:78:98:46:8a:c5.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added ‘node1,30.96.76.221‘ (RSA) to the list of known hosts.root@node1‘s password:Last login: Fri Sep 9 17:42:15 2016 from localhost[root@node1 ~]# ll总用量 24-rw-------. 1 root root 1144 9月 9 18:11 anaconda-ks.cfg-rw-r--r--. 1 root root 13231 9月 9 18:10 install.log-rw-r--r--. 1 root root 3482 9月 9 18:09 install.log.syslog[root@node1 ~]# pwd/root[root@node1 ~]# exitlogoutConnection to node1 closed.[root@master .ssh]#[root@master .ssh]# scp root@master:~/.ssh/id_dsa.pub ./master_dsa.pubThe authenticity of host ‘master (30.96.76.220)‘ can‘t be established.RSA key fingerprint is ae:8c:7f:00:df:40:b8:ec:20:4b:53:78:98:46:8a:c5.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added ‘master,30.96.76.220‘ (RSA) to the list of known hosts.id_dsa.pub 100% 601 0.6KB/s 00:00 [root@master .ssh]# ssh masterLast login: Fri Sep 9 17:42:39 2016 from localhost[root@master ~]# hostnamemaster[root@master ~]# exitlogoutConnection to master closed.<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="configuration.xsl"?><!-- Put site-specific property overrides in this file. --><configuration><property><name>fs.default.name</name><value>hdfs://master:9000</value><final>true></final></property><property> <name>hadoop.tmp.dir</name> <value>/urs/hadoop/tmp</value> <description>A base for other temporary directories</description></property></configuration><?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="configuration.xsl"?><!-- Put site-specific property overrides in this file. --><configuration> <property> <name>dfs.name.dir</name> <value>/usr/hadoop-1.2.1/name</value> <final>true</final> </property> <property> <name>dfs.data.dir</name> <value>/usr/hadoop-1.2.1/data</value> <final>true</final> </property> <property> <name>dfs.replication</name> <value>2</value> <final>true</final> </property></configuration><?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="configuration.xsl"?><!-- Put site-specific property overrides in this file. --><configuration> <property> <name>mapred.job.tracker</name> <value>30.96.76.220:9001</value> </property></configuration>[root@master ~]# hadoop namenode -format16/09/10 17:03:49 INFO namenode.NameNode: STARTUP_MSG:/************************************************************STARTUP_MSG: Starting NameNodeSTARTUP_MSG: host = master/30.96.76.220STARTUP_MSG: args = [-format]STARTUP_MSG: version = 1.2.1STARTUP_MSG: build = https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1.2 -r 1503152; compiled by ‘mattf‘ on Mon Jul 22 15:23:09 PDT 2013STARTUP_MSG: java = 1.7.0_76************************************************************/16/09/10 17:03:49 INFO util.GSet: Computing capacity for map BlocksMap16/09/10 17:03:49 INFO util.GSet: VM type = 64-bit16/09/10 17:03:49 INFO util.GSet: 2.0% max memory = 101364531216/09/10 17:03:49 INFO util.GSet: capacity = 2^21 = 2097152 entries16/09/10 17:03:49 INFO util.GSet: recommended=2097152, actual=209715216/09/10 17:03:50 INFO namenode.FSNamesystem: fsOwner=root16/09/10 17:03:50 INFO namenode.FSNamesystem: supergroup=supergroup16/09/10 17:03:50 INFO namenode.FSNamesystem: isPermissionEnabled=true16/09/10 17:03:50 INFO namenode.FSNamesystem: dfs.block.invalidate.limit=10016/09/10 17:03:50 INFO namenode.FSNamesystem: isAccessTokenEnabled=false accessKeyUpdateInterval=0 min(s), accessTokenLifetime=0 min(s)16/09/10 17:03:50 INFO namenode.FSEditLog: dfs.namenode.edits.toleration.length = 016/09/10 17:03:50 INFO namenode.NameNode: Caching file names occuring more than 10 times 16/09/10 17:03:50 INFO common.Storage: Image file /usr/hadoop-1.2.1/name/current/fsimage of size 110 bytes saved in 0 seconds.16/09/10 17:03:51 INFO namenode.FSEditLog: closing edit log: position=4, editlog=/usr/hadoop-1.2.1/name/current/edits16/09/10 17:03:51 INFO namenode.FSEditLog: close success: truncate to 4, editlog=/usr/hadoop-1.2.1/name/current/edits16/09/10 17:03:51 INFO common.Storage: Storage directory /usr/hadoop-1.2.1/name has been successfully formatted.16/09/10 17:03:51 INFO namenode.NameNode: SHUTDOWN_MSG:/************************************************************SHUTDOWN_MSG: Shutting down NameNode at master/30.96.76.220************************************************************/


标签:
原文地址:http://www.cnblogs.com/shaoyu19900421/p/5860063.html


