Set up hadhoop standalone mode in CentOS

Source: Internet
Author: User

Set up hadhoop standalone mode in CentOS

1. Download The hadhoop installation package ghost.

[Plain] view plaincopyprint?
  1. Gzip-dhadoop-2.7.0-src.tar.gz
  2. Tar-xvfhadoop-2.7.0-src.tar

Subsequent operations must be performed under root.

[SQL] view plaincopyprint?
  1. 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?
  1. Servicesshdrestart
  2. Ssh-keygen-tdsa-p'-f ~ /. Ssh/id_dsa

Switch to the root directory to check whether there is a. ssh file.

[Plain] view plaincopyprint?
  1. Cd ~ /
  2. 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?
  1. 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?
  1. <? Xmlversion = "1.0" encoding = "UTF-8"?>
  2. <? Xml-stylesheettype = "text/xsl" href = "configuration. xsl"?>
  3. <! -- Putsite-specificpropertyoverridesinthisfile. -->
  4. <Configuration>
  5. <Property>
  6. <Name> fs. default. name </name>
  7. <Value> hdfs :/// localhost: 9000 </value>
  8. </Property>
  9. </Configuration>

B. Configure hdfs-site.xml as follows:

[Html] view plaincopyprint?
  1. <? Xmlversion = "1.0" encoding = "UTF-8"?>
  2. <? Xml-stylesheettype = "text/xsl" href = "configuration. xsl"?>
  3. <! -- Putsite-specificpropertyoverridesinthisfile. -->
  4. <Configuration>
  5. <Property>
  6. <Name> dfs. replication </name>
  7. <Value> 1 </value>
  8. </Property>
  9. </Configuration>
  10. ~
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?
  1. Cpmapred-site.xml.templatemapred-site.xml
The configuration is as follows:

[Html] view plaincopyprint?
  1. <? Xml-stylesheettype = "text/xsl" href = "configuration. xsl"?>
  2. <! -- Putsite-specificpropertyoverridesinthisfile. -->
  3. <Configuration>
  4. <Property>
  5. <Name> mapred. job. tracker </name>
  6. <Value> localhost: 9001 </value>
  7. </Property>
  8. </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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.