如何配置Hadoop环境
展开全部
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-specific 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-specific 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
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询