Hadoop+Spark Windows系统环境搭建

Hadoop 环境变量配置:
HADOOP_HOME:D:\ProgramData\BigData\Hadoop\hadoop-2.7.4
Path:%HADOOP_HOME%\bin


Spark 环境变量配置:
SPARK_HOME:D:\ProgramData\BigData\Spark\spark-2.2.0
Path:%SPARK_HOME%\bin


修改hadoop配置文件:
[1].编辑D:\ProgramData\BigData\Hadoop\hadoop-2.7.4\etc\hadoop,下的core-site.xml文件:
   
     
            hadoop.tmp.dir
            /D:/ProgramData/BigData/Hadoop/hadoop-2.7.4/workplace/tmp
       

       
            dfs.name.dir
            /D:/ProgramData/BigData/Hadoop/hadoop-2.7.4/workplace/name
       

       
            fs.default.name
            hdfs://localhost:8084/Hadoop
       

   



[2].编辑“D:\ProgramData\BigData\Hadoop\hadoop-2.7.4\etc\hadoop”目录下的mapred-site.xml(没有就将mapred-site.xml.template重命名为mapred-site.xml)文件
   
       
           mapreduce.framework.name
           yarn
       

       
           mapred.job.tracker
           hdfs://localhost:8085/Hadoop
       

   



[3].编辑“D:\ProgramData\BigData\Hadoop\hadoop-2.7.4\etc\hadoop”目录下的hdfs-site.xml文件:
   
   
       
            dfs.replication
            1
       

       
            dfs.data.dir
            /D:/ProgramData/BigData/Hadoop/hadoop-2.7.4/workplace/data
       

   



[4].编辑“D:\ProgramData\BigData\Hadoop\hadoop-2.7.4\etc\hadoop”目录下的yarn-site.xml文件:
 
       
           yarn.nodemanager.aux-services
           mapreduce_shuffle
       

       
           yarn.nodemanager.aux-services.mapreduce.shuffle.class
           org.apache.hadoop.mapred.ShuffleHandler
       

   



[5].编辑“D:\ProgramData\BigData\Hadoop\hadoop-2.7.4\etc\hadoop”目录下的hadoop-env.cmd文件,将JAVA_HOME用 @rem注释掉,编辑为JAVA_HOME的路径:
set JAVA_HOME=D:/ProgramLanguage/Java/jdk/jdk1.8.0_144


[6].下载到的hadooponwindows-master.zip,解压,将bin目录(包含以下.dll和.exe文件)文件替换原来hadoop目录下的bin目录


[7].


hadoop fs -mkdir hdfs://localhost:8087/user
hadoop fs -mkdir hdfs://localhost:8087/user/wcinput


hadoop fs -put D:\ProgramData\BigData\Hadoop\hadoop-2.7.4\workplace\data\file1.txt hdfs://localhost:8087/user/wcinput
hadoop fs -put D:\ProgramData\BigData\Hadoop\hadoop-2.7.4\workplace\data\file2.txt hdfs://localhost:8087/user/wcinput


hadoop fs -ls hdfs://localhost:8087/user/wcinput

你可能感兴趣的:(大数据,windows,hadoop,spark)