Install hadoop under windows

Prerequisites: jdk8.0 or above has been installed

Download: hadoop-2.8.0.tar.gz

1. Unzip to the hard disk directory:

 

2. Configure environment variables

Configure it to the environment variable HADOOP_HOME, and add %HADOOP_HOME%\bin to the PATH;

 

3. Get dependent files: hadoop.dll & winutils.exe For hadoop-2.8.0

Drop the file to the D:\software\tool\hadoop2.8\hadoop-2.8.0\bin directory, and also drop a copy of hadoop.dll in c:/windows/System32;

 

4 Go to D:\software\tool\hadoop2.8\hadoop-2.8.0\etc\hadoop to find the following 4 files and paste them according to the following minimum configuration:

core-site.xml

<configuration>
    <property>
        <name>fs.defaultFS</name>
        <value>hdfs://localhost:9000</value>
    </property>    
</configuration>

 

hdfs-site.xml

 

<configuration>
    <property>
        <name>dfs.replication</name>
        <value>1</value>
    </property>
    <property>    
        <name>dfs.namenode.name.dir</name>    
        <value>file:/hadoop/data/dfs/namenode</value>    
    </property>    
    <property>    
        <name>dfs.datanode.data.dir</name>    
        <value>file:/hadoop/data/dfs/datanode</value>  
    </property>
</configuration>

 

mapred-site.xml

 

<configuration>
    <property>
        <name>mapreduce.framework.name</name>
        <value>yarn</value>
    </property>
</configuration>

 

yarn-site.xml

 

<configuration>
    <property>
        <name>yarn.nodemanager.aux-services</name>
        <value>mapreduce_shuffle</value>
    </property>
    <property>
        <name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name>
        <value>org.apache.hadoop.mapred.ShuffleHandler</value>
    </property>
</configuration>

 

5. Start the windows command line window, enter the D:\software\tool\hadoop2.8\hadoop-2.8.0\bin directory, execute the following two commands, first format the namenode and then start hadoop

implement:

Execute in the sbin directory:

start-all.cmd

Through the jps command, you can see that all four processes are up, and the installation and startup of hadoop has been completed here.

Then we can use the browser to go to localhost:8088 to see the mapreduce task, and go to localhost:50070->Utilites->Browse the file system to see the hdfs file. If you restart hadoop, you don't need to format the namenode, just stop-all.cmd and then start-all.cmd.

end~

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324447855&siteId=291194637