hadoop单机安装
步骤 1:安装 Java
安装 OpenJDK
bash
sudo yum install -y java-1.8.0-openjdk
验证 Java 安装
bash
java -version
输出类似以下内容表示成功:
arduino
openjdk version “1.8.0_xxx”
步骤 2:下载 Hadoop
下载 Hadoop 安装包
前往 Hadoop 官方下载页面,获取最新稳定版本: Hadoop Releases
或者使用 wget 命令直接下载:
bash
wget https://dlcdn.apache.org/hadoop/common/hadoop-3.3.5/hadoop-3.3.5.tar.gz
解压 Hadoop
bash
tar -xzf hadoop-3.3.5.tar.gz
sudo mv hadoop-3.3.5 /usr/local/hadoop
配置环境变量
编辑 ~/.bashrc 或者etc/profile文件:
bash
nano ~/.bashrc
export JAVA_HOME=/app01/tomcat/app/jdk1.8.0_191
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export HADOOP_HOME=/app01/seatuunel/hadoop-3.3.5
export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
export HADOOP_MAPRED_HOME=$HADOOP_HOME
export HADOOP_COMMON_HOME=$HADOOP_HOME
export HADOOP_HDFS_HOME=$HADOOP_HOME
export YARN_HOME=$HADOOP_HOME
export HDFS_NAMENODE_USER=hadoop
export HDFS_DATANODE_USER=hadoop
export HDFS_SECONDARYNAMENODE_USER=hadoop
export YARN_RESOURCEMANAGER_USER=hadoop
export YARN_NODEMANAGER_USER=hadoop
source /etc/profile
编辑/etc/hosts
对应的ip 127-0-0-1
source /etc/hosts
步骤 3:配置 Hadoop
修改 hadoop-env.sh
编辑 Hadoop 的环境配置文件:
vi $HADOOP_HOME/etc/hadoop/hadoop-env.sh
修改以下内容:
bash
export JAVA_HOME=/usr/lib/jvm/jre-