VMware12使用三台虚拟机Ubuntu 16.04系统搭建Hadoop(5)

配置如下:

#set java environment export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_76 export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:/home/hadoop/hadoop-2.7.1/bin:/home/hadoop/hadoop-2.7.1/sbin:/home/hadoop/hbase-1.2.4/bin:$PATH

(3)配置三台主机的Hadoop文件,内容如下。
conf/Hadoop-env.sh:
/home/master/hadoop-2.7.1/etc/hadoop
首先如何找到这个文件呢,使用Ubuntu的搜索工具如图所示:

这里写图片描述


配置如下:

# The java implementation to use. export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_76 export HADOOP_HOME=/home/master/hadoop-2.7.1 export PATH=$PATH:/home/master/hadoop-2.7.1/bin

conf/core-site.xml
/home/master/hadoop-2.7.1/etc/hadoop

<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="https://www.linuxidc.com/configuration.xsl"?> <!-- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. See accompanying LICENSE file. --> <!-- Put site-specific property overrides in this file. --> <configuration> <property> <name>fs.default.name</name> <value>hdfs://master:9000</value> </property> <property> <name>hadoop.tmp.dir</name> <value>/tmp</value> </property> </configuration>

conf/hdfs-site.xml
/home/master/hadoop-2.7.1/etc/hadoop

<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="https://www.linuxidc.com/configuration.xsl"?> <!-- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. See accompanying LICENSE file. --> <!-- Put site-specific property overrides in this file. --> <configuration> <property> <name>dfs.replication</name> <value>2</value> </property> </configuration>

conf/mapred-site.xml
/home/master/hadoop-2.7.1/etc/hadoop
搜索发现没有这个文件需要复制mapred-site.xml.template这个文件的内容到mapred-site.xml

cp mapred-site.xml.template mapred-site.xml

配置如下:

<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="https://www.linuxidc.com/configuration.xsl"?> <!-- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. See accompanying LICENSE file. --> <!-- Put site-specific property overrides in this file. --> <configuration> <property> <name>mapred.job.tracker</name> <value>master:9001</value> </property> </configuration>

conf/masters
/home/master/hadoop-2.7.1/etc/hadoop
没有手动添加一个master文件
配置如下:

master

conf/slaves:

slave1 slave2

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/2e2d9454e6a15ca40dd3262ddd1a67a7.html