Set up hadhoop standalone mode in CentOS
1. Download The hadhoop installation package ghost.
[Plain] view plaincopyprint?
- Gzip-dhadoop-2.7.0-src.tar.gz
- Tar-xvfhadoop-2.7.0-src.tar
Subsequent operations must be performed under root.
[SQL] view plaincopyprint?
- Suroot
2. Install ssh
First, check whether ssh is installed.
Rpm-qa | grep ssh
If not, use
Yum install ssh
It is best to enable the ssh service again
[Plain] view plaincopyprint?
- Servicesshdrestart
- Ssh-keygen-tdsa-p'-f ~ /. Ssh/id_dsa
Switch to the root directory to check whether there is a. ssh file.
[Plain] view plaincopyprint?
- Cd ~ /
- Ls-
Enter the. ssh directory
Cat id_dsa.pub> authorized_keys
Then test and confirm whether you can log on to localhost over ssh without entering the password. That is to say, the following command will not prompt you to enter the password.
[Plain] view plaincopyprint?
- Sshlocalhost
Now ssh configuration is complete.
3. Install jdk and set JAVA_HOM
In addition to configuring/etc/profile, you also need to export JAVA_HOME in the httpfs-env.sh
4. Configure hadhoop
Go to hadoop-2.7.0/etc/hadoop
A. Configure core-site.xml as follows:
[Html] view plaincopyprint?
- <? Xmlversion = "1.0" encoding = "UTF-8"?>
- <? Xml-stylesheettype = "text/xsl" href = "configuration. xsl"?>
- <! -- Putsite-specificpropertyoverridesinthisfile. -->
- <Configuration>
- <Property>
- <Name> fs. default. name </name>
- <Value> hdfs :/// localhost: 9000 </value>
- </Property>
- </Configuration>
B. Configure hdfs-site.xml as follows:
[Html] view plaincopyprint?
- <? Xmlversion = "1.0" encoding = "UTF-8"?>
- <? Xml-stylesheettype = "text/xsl" href = "configuration. xsl"?>
- <! -- Putsite-specificpropertyoverridesinthisfile. -->
- <Configuration>
- <Property>
- <Name> dfs. replication </name>
- <Value> 1 </value>
- </Property>
- </Configuration>
- ~
C. Configure mapred-site.xml
There is only a mapred-site.xml.template under the Directory and there is no mapred-site.xml, So copy one.
[Plain] view plaincopyprint?
- Cpmapred-site.xml.templatemapred-site.xml
The configuration is as follows:
[Html] view plaincopyprint?
- <? Xml-stylesheettype = "text/xsl" href = "configuration. xsl"?>
- <! -- Putsite-specificpropertyoverridesinthisfile. -->
- <Configuration>
- <Property>
- <Name> mapred. job. tracker </name>
- <Value> localhost: 9001 </value>
- </Property>
- </Configuration>
Now, hadoop configuration is complete.
4. Start hadoop
Go to the hadoop sbin directory and execute hadoop namenode-format
Then execute start-all.sh
5. Use jps to view related information
Note: JobTracker is removed in the new hadoop architecture, refer to http://hadoop.apache.org/docs/current/hadoop-yarn/hadoop-yarn-site/YARN.html
Bin/hadoopnamenode
-
Format