hadoop单机版安装时,如果datanode没有激动起来,可以按照以下步骤操作,然后重新启动。
把你hdfs文件夹中的data和name两个文件夹删掉,然后$hadoop namenode -format一下,再启动。
core-site.xml
1 <?xml version="1.0"?>
2 <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
3
4 <!-- Put site-specific property overrides in this file. -->
5
6 <configuration>
7 <property>
8 <name>fs.default.name</name>
9 <value>hdfs://172.16.48.203:9000</value>
10 </property>
11
12 <property>
13 <name>hadoop.tmp.dir</name>
14 <value>/opt/hadoop-1.0.4/tmp</value>
15 </property>
16 </configuration>
mapred-site.xml
1 <?xml version="1.0"?>
2 <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
3
4 <!-- Put site-specific property overrides in this file. -->
5
6 <configuration>
7 <property>
8 <name>mapred.job.tracker</name>
9 <value>172.16.48.203:9001</value>
10 </property>
11 </configuration>
hdfs-site.xml
1 <?xml version="1.0"?>
2 <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
3
4 <!-- Put site-specific property overrides in this file. -->
5
6 <configuration>
7 <property>
8 <name>dfs.name.dir</name>
9 <value>/opt/hadoop-1.0.4/name</value>
10 </property>
11
12 <property>
13 <name>dfs.data.dir</name>
14 <value>/opt/hadoop-1.0.4/data</value>
15 </property>
16
17 <property>
18 <name>dfs.replication</name >
19 <value>1</value>
20 </property>
21 <property>
22 <name>dfs.datanode.max.xcievers</name>
23 <value>4096</value>
24 </property>
25 </configuration >
1 172.16.48.203
master
1 localhost
/etc/hosts
1 172.16.48.203 sg203 localhost # Added by NetworkManager
2 #127.0.0.1 localhost.localdomain localhost
3 ::1 sg203 localhost6.localdomain6 localhost6