First, the relevant configuration file modification
① Modify Core-site.xml:
$ su-l hadoop$ cd/usr/local/hadoop/$ sudo vi etc/hadoop/core-site.xml<configuration> <property> &L T;name>fs.defaultfs</name> <value>hdfs://localhost:9000</value> </property></confi Guration>
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/78/4F/wKiom1Z6M73CcLHYAAAS9KTopbY291.png "title=" QQ picture 20151223134000.png "alt=" Wkiom1z6m73cclhyaaas9ktopby291.png "/>
Note:
Fs.defaultfs : Describes the URI of the Namenode node in the cluster (including protocol, host name, port number), and each machine in the cluster needs to know the Namenode address. Datanode nodes are first registered on the Namenode so that their data can be used. The standalone client program interacts with Datanode through this URI to get a list of blocks of files.
② modifying Hdfs-site.xml
$ sudo vi etc/hadoop/hdfs-site.xml<configuration> <property> <NAME>DFS.REPLICATION</NAME> ; <value>1</value> </property></configuration>
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/78/4F/wKiom1Z6M22xcaEeAAAQk0NXQ5s313.png "title=" QQ picture 20151223133829.png "alt=" Wkiom1z6m22xcaeeaaaqk0nxq5s313.png "/>
Note:
dfs.replication : It determines the number of data backups for the file blocks in the system. For an actual application, it should be set to 3 (this number has no upper limit, but more backups may not work and will take up more space). Less than three backups may affect the reliability of the data (when a system failure may result in data loss)
③ modifying Yarn-site.xml
$ sudo vi etc/hadoop/yarn-site.xml<configuration> <property> <name>yarn.nodemanager.aux-servic Es</name> <value>mapreduce_shuffle</value> </property></configuration>
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/78/4E/wKioL1Z6NZrQwZcxAAAclePswaA498.png "title=" QQ picture 20151223134742.png "alt=" Wkiol1z6nzrqwzcxaaaclepswaa498.png "/>
④ modifying Mapred-site.xml
$ sudo cp etc/hadoop/mapred-site.xml.template etc/hadoop/mapred-site.xml$ sudo vi etc/hadoop/mapred-site.xml< configuration> <property> <name>mapreduce.framework.name</name> <value>yarn< ;/value> </property></configuration>
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/78/4F/wKiom1Z6NxKQ8EvpAAATM64buew605.png "title=" QQ picture 20151223135413.png "alt=" Wkiom1z6nxkq8evpaaatm64buew605.png "/>
Note:
Mapreduce.framework.name : Specifies the running framework used by the Execute MapReduce task
⑤ modifying hadoop-env.sh
$ sudo vi/usr/local/hadoop/etc/hadoop/hadoop-env.shexport java_home=/usr/lib/jvm/java-7-openjdk-amd64 # #修改JAVA_ HOME
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/78/4F/wKiom1Z6N-XTUTfsAAAX-ZuHEEs632.png "title=" QQ picture 20151223135753.png "alt=" Wkiom1z6n-xtutfsaaax-zuhees632.png "/>
Second, format HDFs file system
① format HDFs File system
$ Hadoop namenode-format/************************************************************startup_msg:starting Namenodestartup_msg:host = Ubuntu/127.0.1.1startup_msg:args = [-format]startup_msg:version = 2.7.1......STARTUP_M Sg:java = 1.7.0_91************************************************************/....../************************** Shutdown_msg:shutting down NameNode at ubuntu/127.0.1.1************************* ***********************************/
② Starting a Hadoop cluster
A. Starting the HDFs daemon
$ start-dfs.sh
B. Start the yarn framework
$ start-yarn.sh
C. Check whether the operation is successful
Enter Command JPS View process
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/78/4E/wKioL1Z6Ow6S9-faAAAUog2_Wc0054.png "title=" QQ picture 20151223141104.png "alt=" Wkiol1z6ow6s9-faaaauog2_wc0054.png "/>
Browser input:http://localhost:8088 into ResourceManager admin page
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/78/50/wKiom1Z6Oi7CqghqAAEKcNldb0Q898.png "title=" QQ picture 20151223140726.png "alt=" Wkiom1z6oi7cqghqaaekcnldb0q898.png "/>
Browser input:http://localhost:50070 into the HDFs page
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/77/CF/wKiom1ZukZOTyZp6AADtlfPSrRw289.png "title=" QQ picture 20151214165901.png "alt=" Wkiom1zukzotyzp6aadtlfpsrrw289.png "/>
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/77/CE/wKioL1ZukaiymV2nAADEjxc9Xrc337.png "title=" QQ picture 20151214170017.png "alt=" Wkiol1zukaiymv2naadejxc9xrc337.png "/>
Third, test verification
① Create a related folder (to create one step at a):
$ Hadoop dfs-mkdir/user$ Hadoop dfs-mkdir/user/hadoop$ Hadoop dfs-mkdir/user/hadoop/input
② New test file
$ VI test.txthello Hadoophello Worldhello javaubuntu System
③ putting the test file in the test directory
$ Hadoop dfs-put Test.txt/user/hadoop/input
Attached: http://hadoop.apache.org/docs/r2.7.1/hadoop-project-dist/hadoop-common/SingleCluster.html
This article is from the Notepad blog, so be sure to keep this source http://wangzhijian.blog.51cto.com/6427016/1766101
Hadoop pseudo-distributed mode deployment (connected to standalone mode)