配置Hadoop 1.2.1

来源:互联网 发布:数据库备份语句 编辑:程序博客网 时间:2024/06/01 10:01

以Hadoop1.2.1为例(目前只会这个)
整个过程主要是修改hadoop解压后conf目录下的文件:

1.修改hadoop-env.sh中的

#原来这一行被注释掉了,需要设置成自己电脑的java—homeexport JAVA_HOME=/home/yufeng/java/jdk1.8.0_91

2.配置core-site.xml

<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="configuration.xsl"?><configuration>    <property>            <name>hadoop.tmp.dir</name>            <!-- 建议使用home+主机下的路径,其他路径需要root权限,会带来不必要的麻烦 -->            <value>/home/yufeng/hadoop</value>    </property>    <property>        <name>dfs.name.dir</name>        <value>/home/yufeng/hadoop/name</value>    </property>    <property>        <name>fs.default.name</name>        <value>hdfs://localhost:9000</value>    </property></configuration>

3.配置hdfs-site.xml

<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="configuration.xsl"?><configuration>    <property>            <name>dfs.data.dir</name>            <value>/home/yufeng/hadoop/data</value>    </property></configuration>

4.配置mapred-site.xml

<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="configuration.xsl"?><configuration>    <property>            <name>mapred.job.tracker</name>            <value>localhost:9001</value>    </property></configuration>

5.添加环境变量

export HADOOP_HOME="/home/yufeng/hadoop/hadoop-1.2.1"export PATH=$HADOOP_HOME/bin:$PATH
0 0
原创粉丝点击