hadoop@master:~/.ssh$ ssh slave2 Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.19.0-42-generic x86_64) * Documentation: https://help.ubuntu.com/ 27 packages can be updated. 23 updates are security updates. $ ls -l total 239424 drwxr-xr-x 2 hadoop hadoop 4096 Dec 27 04:19 Desktop drwxr-xr-x 2 hadoop hadoop 4096 Dec 27 04:19 Documents drwxr-xr-x 2 hadoop hadoop 4096 Dec 27 04:19 Downloads -rw-r--r-- 1 hadoop hadoop 8980 Dec 27 03:27 examples.desktop -rw-rw-r-- 1 hadoop hadoop 63851630 Dec 30 05:25 hadoop-1.2.1.tar.gz -rw-rw-r-- 1 hadoop hadoop 181260798 Dec 27 06:49 jdk-8u65-linux-x64.tar.gz drwxr-xr-x 2 hadoop hadoop 4096 Dec 27 04:19 Music drwxr-xr-x 2 hadoop hadoop 4096 Dec 27 04:19 Pictures drwxr-xr-x 2 hadoop hadoop 4096 Dec 27 04:19 Public drwxr-xr-x 2 hadoop hadoop 4096 Dec 27 04:19 Templates drwxr-xr-x 2 hadoop hadoop 4096 Dec 27 04:19 Videos $ exit Connection to slave2 closed. hadoop@master:~/.ssh$
格式化hdfs的namenode
hadoop@master:/opt/hadoop-1.2.1/bin$ ./hadoop namenode -format16/01/09 23:33:18 INFO namenode.NameNode: STARTUP_MSG: /************************************************************ STARTUP_MSG: Starting NameNode STARTUP_MSG: host = master/127.0.1.1 STARTUP_MSG: args = [-format] STARTUP_MSG: version = 1.2.1 STARTUP_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 2013 STARTUP_MSG: java = 1.8.0_65 ************************************************************/ Re-format filesystem in /hadoop/hdfs/name ? (Y or N) Y 16/01/09 23:34:09 INFO util.GSet: Computing capacity for map BlocksMap 16/01/09 23:34:09 INFO util.GSet: VM type = 64-bit 16/01/09 23:34:09 INFO util.GSet: 2.0% max memory = 1013645312 16/01/09 23:34:09 INFO util.GSet: capacity = 2^21 = 2097152 entries 16/01/09 23:34:09 INFO util.GSet: recommended=https://www.linuxidc.com/Linux/2016-09/2097152, actual=https://www.linuxidc.com/Linux/2016-09/2097152 16/01/09 23:34:10 INFO namenode.FSNamesystem: fsOwner=https://www.linuxidc.com/Linux/2016-09/hadoop 16/01/09 23:34:10 INFO namenode.FSNamesystem: supergroup=https://www.linuxidc.com/Linux/2016-09/supergroup 16/01/09 23:34:10 INFO namenode.FSNamesystem: isPermissionEnabled=https://www.linuxidc.com/Linux/2016-09/true 16/01/09 23:34:10 INFO namenode.FSNamesystem: dfs.block.invalidate.limit=https://www.linuxidc.com/Linux/2016-09/100 16/01/09 23:34:10 INFO namenode.FSNamesystem: isAccessTokenEnabled=https://www.linuxidc.com/Linux/2016-09/false accessKeyUpdateInterval=https://www.linuxidc.com/Linux/2016-09/0 min(s), accessTokenLifetime=https://www.linuxidc.com/Linux/2016-09/0 min(s) 16/01/09 23:34:10 INFO namenode.FSEditLog: dfs.namenode.edits.toleration.length = 0 16/01/09 23:34:10 INFO namenode.NameNode: Caching file names occuring more than 10 times 16/01/09 23:34:11 INFO common.Storage: Image file /hadoop/hdfs/name/current/fsimage of size 112 bytes saved in 0 seconds. 16/01/09 23:34:11 INFO namenode.FSEditLog: closing edit log: position=https://www.linuxidc.com/Linux/2016-09/4, editlog=/hadoop/hdfs/name/current/edits 16/01/09 23:34:11 INFO namenode.FSEditLog: close success: truncate to 4, editlog=/hadoop/hdfs/name/current/edits 16/01/09 23:34:11 INFO common.Storage: Storage directory /hadoop/hdfs/name has been successfully formatted. 16/01/09 23:34:11 INFO namenode.NameNode: SHUTDOWN_MSG: /************************************************************ SHUTDOWN_MSG: Shutting down NameNode at master/127.0.1.1 ************************************************************/ hadoop@master:/opt/hadoop-1.2.1/bin$
在master上启动hadoop的所有服务