操作目标文件 vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
修改结果 BOOTPROTO=static
IPADDR=192.168.31.190
NETMASK=255.255.255.0
GATEWAY=192.168.31.1
DNS1=221.228.255.1
允许联网 ONBOOT=yes
重启网络 service network start
配置 vi /etc/hosts 文件
给hadoop用户赋予 sudo 执行权限
切换到root用户修改文件 vi /etc/sudoers
添加 hadoop ALL=(root) NOPASSWD:ALL
进入hadoop用户下~/.ssh文件夹运行 ssh-keygen –t rsa
生成公钥 cat id_rsa.pub>>authorized_keys
检查父子文件权限 ssh不允许home和~/.ssh文件group写入权限
chmod g-w /home/hadoop
chmod 700 /home/hadoop/.ssh
chmod 600 /home/hadoop/.ssh/authorized_keys
分发公钥到子节点上
ssh-copy-id hadoop@slave1
vi /etc/profile
export JAVA_HOME=/home/hadoop/local/jdk
export JRE_HOME=/home/hadoop/local/jdk/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
vi /etc/profile
export HADOOP_HOME=/home/hadoop/local/hadoop
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$PATH
将java环境添加到hadoop-env.sh中
添加slaves
配置core-site.xml
配置hdfs-site.xml
配置mapred-site.xml
配置yarn-site.xml
复制到其他节点后
Hdfs namenode -format
关闭防火墙 systemctl stop firewalld
/home/hadoop/local/hadoop/bin/hdfs dfsadmin -report
/home/hadoop/local/hadoop/bin/hdfs fsck / -files -blocks