环境
- macOS Catalina 10.15.6
- JDK 1.8.0_261
- homebrew
安装
- ssh locahost(免密码登陆)
ssh-keygen -t rsa -P "you-email"
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh localhost
-
安装
brew install hadoop
配置
所有的配置均在: /usr/local/Cellar/hadoop/3.3.0/libexec/etc/hadoop下
- 配置文件
配置文件的名称
作用
core-site.xml
核心配置文件,主要定义了我们文件访问的格式 hdfs://
hadoop-env.sh
主要配置我们的java路径
hdfs-site.xml
主要定义配置我们的hdfs的相关配置
mapred-site.xml
主要定义我们的mapreduce相关的一些配置
slaves
控制我们的从节点在哪里 datanode nodemanager在哪些机器上
yarm-site.xml
配置我们的resourcemanager资源调度
-
指定Java环境:hadoop-env.sh
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home
-
core-site.xml
hadoop.tmp.dir /usr/local/Cellar/hadoop/hdfs/tmp A base for other temporary directories. fs.default.name hdfs://localhost:9000 -
mapred-site.xml
mapred.job.tracker localhost:9010 -
hdfs-site.xml
dfs.replication 1
运行
-
格式化hdfs文件系统
cd /usr/local/Cellar/hadoop/3.3.0/bin
hadoop namenode -format -
运行
cd /usr/local/Cellar/hadoop/3.3.0/sbin
./start-all.sh
jps
57969 SecondaryNameNode
58161 ResourceManager
57734 NameNode
58263 NodeManager
49034 RemoteMavenServer36
57835 DataNode
61182 Jps