windows系统搭建spark+hadoop环境

hadoop版本hadoop-2.7.7,spark版本spark-2.2.0-bin-hadoop2.7,搭建步骤如下:

1.配置hadoop的环境变量 F:igdatatoolhadoop-2.7.7in
修改F:igdatatoolhadoop-2.7.7etchadoop目录下的core-site.xml、hdfs-site.xml、mapred-site.xml、yarn-site.xml、hadoop-env.cmd配置文件。

core-site.xml配置:

fs.defaultFS hdfs://localhost:9001 hadoop.tmp.dir /F:/bigdatatool/hadoop-2.7.7/data/hdfs

hdfs-site.xml配置:

dfs.replication 1 dfs.namenode.name.dir /F:/bigdatatool/hadoop-2.7.7/data/namenode dfs.datanode.data.dir /F:/bigdatatool/hadoop-2.7.7/data/datanode

mapred-site.xml配置:

mapreduce.framework.name yarn

yarn-site.xml配置:

yarn.nodemanager.aux-services mapreduce\_shuffle yarn.nodemanager.aux-services.mapreduce.shuffle.class org.apache.hadoop.mapred.ShuffleHandler yarn.scheduler.minimum-allocation-mb 1024 yarn.nodemanager.resource.memory-mb 4096 yarn.nodemanager.resource.cpu-vcores 2 yarn.resourcemanager.webapp.address localhost:8018

修改hadoop-env.cmd文件的java路径:

set JAVA_HOME=C:PROGRA~1Javajdk1.8.0_131

2.配置spark的环境变量 F:igdatatoolspark-2.2.0-bin-hadoop2.7in
3.进入hadoop的sbin目录下 F:igdatatoolhadoop-2.7.7sbin 执行 hdfs namenode -format命令
4.进入hadoop的sbin目录下 F:igdatatoolhadoop-2.7.7sbin 执行 start-all.cmd命令 启动hadoop
5.在浏览器访问hadoop web地址 http://localhost:8042/
6.在浏览器访问 http://localhost:50070/

你可能感兴趣的:(java,java,后端)