## 一、系统基础操纵:
sudo hostnamectl set-hostname hadoop
bash
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl status firewalld.service
vi /etc/selinux/config
tar -zxf jdk-8u221-linux-x64.tar.gz -C /opt/module/
vi /etc/profile.d/hadoop.sh
export JAVA_HOME=/opt/module/jdk1.8.0_221
export PATH=$PATH:$JAVA_HOME/bin
source /etc/profile.d/hadoop.sh
java -version
systemctl start sshd
systemctl status sshd
ssh-keygen
cd ~/.ssh/
cat id_rsa.pub > authorized_keys
chmod 600 authorized_keys
ssh root@hadoop
exit
tar -xzf hadoop-2.7.7.tar.gz -C /opt/module/
vi /etc/profile.d/hadoop.sh
export HADOOP_HOME=/opt/module/hadoop-2.7.7
export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_PATH/sbin
source /etc/profile.d/hadoop.sh
hadoop version
hadoop-env.sh
中的JAVA_HOME
先进入
/opt/module/hadoop-2.7.7/etc/hadoop
vi hadoop-env.sh
:! echo $JAVA_HOME
/opt/module/jdk1.8.0_221
vi core-site.xml
新的
<configuration>
<property>
<name>fs.default.namename>
<value>hdfs://localhost:9000value>
property>
configuration>
原来的
<property>
<name>dfs.defaultFSname>
<value>hdfs://hadoop:9000value>
property>
<property>
<name>hadoop.tmp.dirname>
<value>/home/root/hadoopvalue>
property>
vi hdfs-site.xml
<property>
<name>dfs.replicationname>
<value>1value>
property>
<property>
<name>dfs.namenode.name.dirname>
<value>file:///home/root/hadoop/namevalue>
property>
<property>
<name>dfs.namenode.data.dirname>
<value>file:///home/root/hadoop/datavalue>
property>
cp mapred-site.xml.template mapred-site.xml
vi mapred-site.xml
<property>
<name>mapreduce.framework.namename>
<value>yarnvalue>
property>
vi yarn-site.xml
<property>
<name>yarn.resourcemanager.hostnamesname>
<value>hadoopvalue>
property>
<property>
<name>yarn.nodemanager.aux-servicesname>
<value>mapreduce_shufflevalue>
property>
vi slaves
hdfs namenode -format
在/opt/module/hadoop-2.7.7/sbin
下
bash start-all.sh
查看启动:
jps
http://192.168.0.108:50070/dfshealth.html#tab-overview
http://192.168.0.108:8088/cluster
2022-08-27 12:08 凌晨
由于jar包导错了,导致最后的运行 出现不兼容现象,运行失败,两小时时间排错。卸载重装jdk,解决问题。要注意环境的需求。
参考大佬连接:
https://www.javaroad.cn/questions/79621