大数据学习笔记:Hadoop3.3.0完全分布式集群安装

这篇博客详细记录了在Linux CentOS 8系统上安装Hadoop3.3.0完全分布式集群的过程,包括Linux配置、JDK安装、Hadoop配置、环境变量设置、集群启动与测试。主要步骤涉及设置静态IP、关闭防火墙、配置SSH免密登录、安装JDK和Hadoop、修改Hadoop相关配置文件,并进行集群的格式化和启动。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

前言

此次运用的操作系统是Linux CentOS 8系统
本次安装用到的四台虚拟机如下

NameNode Secondary NameNode DataNode
Master Yes
Slave1 Yes Yes
Slave2 Yes
Slave3 Yes

Linux的相关配置

1、设置ip地址

每台虚拟机 更改ip地址

vi /etc/sysconfig/network-scripts/ifcfg-eth33

在这里插入图片描述
BOOTPROTO要设置成static,ONBOOT要设置成yes,然后在文件末尾加上虚拟机相应的ip地址,网关,子网掩码和dns

2、关闭防火墙

每台虚拟机

#关闭防火墙
systemctl stop firewalld
#禁止开机启用防火墙
systemctl disable firewalld

每台虚拟机 关闭selinux

vi /etc/selinux/config

在这里插入图片描述

3、设置ip映射

每台虚拟机 设置ip映射

vi /etc/hosts

在这里插入图片描述

4、设置免密登录

在四台机器执行以下命令,生成公钥与私钥
ssh-keygen -t rsa
执行该命令之后,按下三个回车即可
在这里插入图片描述
四台机器将拷贝公钥到第一台机器
四台机器执行命令

ssh-copy-id Master

在这里插入图片描述
将第一台机器的公钥拷贝到其他机器上
在第一台机器上面指向以下命令

scp /root/.ssh/authorized_keys Slave1:/root/.ssh

scp /root/.ssh/authorized_keys Slave2:/root/.ssh

scp /root/.ssh/authorized_keys Slave3:/root/.ssh

在这里插入图片描述

安装jdk

1、下载安装包

下载地址:https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html

2、解压

下载好之后上传到服务器,我这里上传到/root/java目录中,然后解压:

tar zxv -f /root/java/jdk-8u281-linux-x64.tar.gz

安装hadoop

1、下载安装包

下载地址:https://downloads.apache.org/hadoop/common/stable/hadoop-3.3.0.tar.gz

2、解压

下载好之后上传到服务器,我这里上传到/root/hadoop目录中,然后解压:

tar zxv -f /root/hadoop/hadoop-3.3.0.tar.gz

3、修改配置文件 (在Master上操作)

(注:hadoop3端口相比hadoop2已经更改,详情可见官网:https://hadoop.apache.org/docs/r3.3.0/

3.1、修改core-site.xml文件

vi /root/hadoop/etc/hadoop/core-site.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="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

    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 the License. See accompanying LICENSE file.
-->

<!-- Put site-specific property overrides in this file. -->

<configuration>
	<!--  指定集群的文件系统类型:分布式文件系统 -->
	<property>
		
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值