基于mac的伪分布安装

hadoop版本 3.3.4

1.修改配置文件

  1. ssh localhost
  1. export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home
  1. <configuration>
  2. <property>
  3. <name>fs.defaultFS</name>
  4. <value>hdfs://bigdata101:8020</value>
  5. </property>
  6. <!--修改文件路径 -->
  7. <property>
  8. <name>hadoop.tmp.dir</name>
  9. <value>/opt/soft/hadoop/data</value>
  10. </property>
  11. <property>
  12. <!--web 页面 操作用户 -->
  13. <name>hadoop.http.staticuser.user</name>
  14. <value>root</value>
  15. </property>
  16. <!--历史服务 -->
  17. <property>
  18. <name>mapreduce.jobhistory.address</name>
  19. <value>localhost:10020</value>
  20. </property>
  21. <property>
  22. <name>mapreduce.jobhistory.webapp.address</name>
  23. <value>localhost:19888</value>
  24. </property>
  25. </configuration>
  1. <configuration>
  2. <property>
  3. <!--设置副本 -->
  4. <name>dfs.replication</name>
  5. <value>1</value>
  6. </property>
  7. </configuration>
  1. <configuration>
  2. <property>
  3. <name>yarn.nodemanager.aux-services</name>
  4. <value>mapreduce_shuffle</value>
  5. </property>
  6. <property>
  7. <name>yarn.nodemanager.env-whitelist</name>
  8. <value>JAVA_HOME,HADOOP_COMMON_HOME,HADOOP_HDFS_HOME,HADOOP_CONF_DIR,CLASSPATH_PREPEND_DISTCACHE,HADOOP_YARN_HOME,HADOOP_HOME,PATH,LANG,TZ,HADOOP_MAPRED_HOME</value>
  9. </property>
  10. </configuration>
  1. <configuration>
  2. <property>
  3. <name>mapreduce.framework.name</name>
  4. <value>yarn</value>
  5. </property>
  6. <property>
  7. <name>mapreduce.application.classpath</name>
  8. <value>$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/*:$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/lib/*</value>
  9. </property>
  10. </configuration>

2.namenode初始化

  1. bin/hdfs namenode -format

3.启动集群

  1. sbin/start-all.sh

4.启动历史服务器

  1. bin/mapred --daemon start historyserver

5.hadoop UI

http://localhost:9870/

6.yarn UI

http://localhost:8088/

7.history UI

http://localhost:19888/