一:准备工作
1、每个节点创建相同的账号:账号名为自己名字的大写,我的时KYJ,清楚对应的ip地址和节点名称。
节点安排如下:
2、每种安装软件的安装版本:
jdk 版本java version "1.8.0_271"
maven 版本Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-05T03:00:29+08:00)
hadoop 版本hadoop-2.7.6
3、对五台节点的KYJ账号进行相互免密(免密方法可看我的其他文章
二:单节点配置:
在单节点上进行横向配置:
1、解压jdk maven hadoop安装包放在/home/KYJ/soft文件之下
tar zxvf jdk-8u271-linux-x64.tar.gz
tar zxvf hadoop-2.7.6.tar.gz
tar zxvf apache-maven-3.6.1-bin.tar.gz
2、在90节点上的/home/KYJ/soft/hadoop-2.7.6/etc/hadoop目录下配置
(1)core-site.xml
在core-site.xml中加入以下内容L:
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://westgisB090:8020</value>
</property>
</configuration>
(2)hdfs-site.xml
在hdfs-site.xml中
<configuration>
<property>
<name>dfs.replication</name>
<value>3</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>/home/KYJ/soft/hdfs/NameNode</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>/home/KYJ/soft/hdfs/DataNode</value>
</property>
</configuration>
(3)hadoop-env.sh
在最后添加export JAVA_HOME=/home/KYJ/soft/jdk1.8.0_271
或者将以下代码加入到其中
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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 t