安装
yum install -y epel-release
防火墙
systemctl stop firewalld
systemctl disable firewalld.service
root权限
vim /etc/sudoers
yy p
创建文件夹
mkdir /opt/module
mkdir /opt/software
chown hhh:hhh /opt/module/
chown hhh:hhh /opt/software/
cd /opt/
ll
卸载虚拟机自带的 JDK
rpm -qa | grep -i java | xargs -n1 rpm -e --nodeps
导入JDK和HADOOP安装包
检查
ls /opt/software/
安装jdk和hadoop
cd /opt/software/
tar -zxvf jdk-8u212-linux-x64.tar.gz -C /opt/module/
tar -zxvf hadoop-3.1.3.tar.gz -C /opt/module/
检查
ls /opt/module/
配置环境变量
sudo vim /etc/profile.d/my_env.sh
#JAVA_HOME
export JAVA_HOME=/opt/module/jdk1.8.0_212
export PATH=$PATH:$JAVA_HOME/bin
#HADOOP_HOME
export HADOOP_HOME=/opt/module/hadoop-3.1.3
export PATH=$PATH:$HADOOP_HOME/bin
export PATH=$PATH:$HADOOP_HOME/sbin
文件生效
source /etc/profile
检查
hadoop version
java -version
参考文章
参考视频