Hadoop Learning Note: Unable to start namenode and password-free start Hadoop

Source: Internet
Author: User
Tags chmod ssh centos
Preface

Install the hadoop-2.2.0 64-bit version under Linux CentOS, solve two problems: first, resolve namenode cannot start, view log file logs/ Hadoop-root-namenode-itcast.out (your name is not the same as mine, see the Namenode log file on the line), which throws the following exception:
Java.net.BindException:Problem binding to [xxx.xxx.xxx.xxx:9000] Java.net.BindException: Unable to specify the requested address;
The second is SSH password-free login, prompting no permissions:
Permission denied (publickey.gssapi-with-mic) 1, unable to start Namenode

After starting Hadoop, using the JPS command to find that there is no namenode, this is actually etc/core-site.xml file modification is incorrect:

<configuration>
            <!--Specify the communication address of the HDFs boss (Namenode)--
            <property>
                    <name> fs.defaultfs</name>
                    <value>hdfs://0.0.0.0:9000</value>
            </property>
            <!-- Specify the storage path where the Hadoop runtime generates files-
            <property>
                    <name>hadoop.tmp.dir</name>
                    <value>/ cloud/hadoop-2.2.0/tmp</value>
            </property>
        </configuration>

This is the main line:

<value>hdfs://0.0.0.0:9000</value>

This will enable Namenode 2, ssh password-free login

Hadoop has to enter password several times each time, how to use password-free, the steps are as follows:
1, cd ~, go to my home directory
2, CD. ssh/
3, ssh-keygen-t RSA (four return)
After executing this command, two files Id_rsa (private key), id_rsa.pub (public key) will be generated
4. CP Id_rsa.pub Authorized_keys

This is OK, but when testing SSH locahost permission denied (publickey.gssapi-with-mic)

The following modifications need to be made:

Vim  /etc/ssh/sshd_config

Compare the following, if and your non-conformance, change to the following, if you have the line there in front of the #, the # number will be removed (the order may be different from the following)

Permitrootlogin Yes
passwordauthentication Yes
hostkey/etc/ssh/ssh_host_rsa_key
rsaauthentication Yes
pubkeyauthentication Yes
Authorizedkeysfile    . Ssh/authorized_keys

Then restart the sshd service, the CentOS 7 command is as follows:

Systemctl Restart Sshd.service

Next you need to modify the permissions, or you will still be prompted permission denied (Publickey.gssapi-with-mic)

# chmod ~
# chmod ~/.ssh
# chmod 644 ~/.ssh/authorized_keys  //Public key file All rights
# chmod ~/.ssh/id_rsa        all permissions for the//private key file

This is OK, you can start Hadoop normally with password-free.

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.