如题所述
第1个回答 推荐于2016-10-09
1)下载并解压hadoop-0.20.203.0.修给解压文件夹名字为hadoop-0.20.203
2)按上述所示将hadoop-0.20.203/bin路径加到PATH环境变量中
sudo gedit/etc/profile
3)修改配置文件,配置文件都在hadoop-0.20.203/conf目录下。
a.进到/hadoop-0.20.203/conf/hadoop-env.sh中,解注释JAVA_HOME
修改为:JAVA_HOME=/home/hadoop/jdk1.6
b.修改core-site.xml文件配置如下:
<?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://namenode:9000</value>
</property>
<property>
<name>hadoop.tmp.dir</name> <!-hadoop的临时文件位置->
<value>/home/hadoop/tmp</value>
</property>
</configuration>
c、修改hdfs-site.xml文件如下:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>dfs.replication</name><!-节点个数配置,根据你自己的节点来设定->
<value>2</value>
</property>
</configuration>
d、修改mapred-site.xml文件如下:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-s pecific property overrides in this file. -->
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>namenode:9001</value>
</property>
</configuration>
e、在masters和slave文件中分别配置主节点和各个数据节点:
masters:中写入namenode
slaves: 写入datanode1
datanode2本回答被提问者和网友采纳
2)按上述所示将hadoop-0.20.203/bin路径加到PATH环境变量中
sudo gedit/etc/profile
3)修改配置文件,配置文件都在hadoop-0.20.203/conf目录下。
a.进到/hadoop-0.20.203/conf/hadoop-env.sh中,解注释JAVA_HOME
修改为:JAVA_HOME=/home/hadoop/jdk1.6
b.修改core-site.xml文件配置如下:
<?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://namenode:9000</value>
</property>
<property>
<name>hadoop.tmp.dir</name> <!-hadoop的临时文件位置->
<value>/home/hadoop/tmp</value>
</property>
</configuration>
c、修改hdfs-site.xml文件如下:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>dfs.replication</name><!-节点个数配置,根据你自己的节点来设定->
<value>2</value>
</property>
</configuration>
d、修改mapred-site.xml文件如下:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-s pecific property overrides in this file. -->
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>namenode:9001</value>
</property>
</configuration>
e、在masters和slave文件中分别配置主节点和各个数据节点:
masters:中写入namenode
slaves: 写入datanode1
datanode2本回答被提问者和网友采纳