官术网_书友最值得收藏!

Time for action – setting up SSH

Carry out the following steps to set up SSH:

  1. Create a new OpenSSL key pair with the following commands:
    $ ssh-keygen
    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/hadoop/.ssh/id_rsa): 
    Created directory '/home/hadoop/.ssh'.
    Enter passphrase (empty for no passphrase): 
    Enter same passphrase again: 
    Your identification has been saved in /home/hadoop/.ssh/id_rsa.
    Your public key has been saved in /home/hadoop/.ssh/id_rsa.pub.
    
    
  2. Copy the new public key to the list of authorized keys by using the following command:
    $ cp .ssh/id _rsa.pub .ssh/authorized_keys 
    
  3. Connect to the local host.
    $ ssh localhost
    The authenticity of host 'localhost (127.0.0.1)' can't be established.
    RSA key fingerprint is b6:0c:bd:57:32:b6:66:7c:33:7b:62:92:61:fd:ca:2a.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
    
  4. Confirm that the password-less SSH is working.
    $ ssh localhost
    $ ssh localhost
    

What just happened?

Because Hadoop requires communication between multiple processes on one or more machines, we need to ensure that the user we are using for Hadoop can connect to each required host without needing a password. We do this by creating a Secure Shell (SSH) key pair that has an empty passphrase. We use the ssh-keygen command to start this process and accept the offered defaults.

Once we create the key pair, we need to add the new public key to the stored list of trusted keys; this means that when trying to connect to this machine, the public key will be trusted. After doing so, we use the ssh command to connect to the local machine and should expect to get a warning about trusting the host certificate as just shown. After confirming this, we should then be able to connect without further passwords or prompts.

Note

Note that when we move later to use a fully distributed cluster, we will need to ensure that the Hadoop user account has the same key set up on every host in the cluster.

Configuring and running Hadoop

So far this has all been pretty straightforward, just downloading and system administration. Now we can deal with Hadoop directly. Finally! We'll run a quick example to show Hadoop in action. There is additional configuration and set up to be performed, but this next step will help give confidence that things are installed and configured correctly so far.

主站蜘蛛池模板: 革吉县| 渝北区| 宁晋县| 新昌县| 永定县| 合肥市| 阳信县| 肇庆市| 织金县| 萨迦县| 内江市| 体育| 太谷县| 四平市| 马边| 阜康市| 楚雄市| 丰原市| 房产| 华坪县| 建水县| 奉新县| 大城县| 罗甸县| 霍林郭勒市| 莱阳市| 富源县| 丰城市| 渑池县| 平利县| 绥棱县| 辽源市| 瑞金市| 阿坝县| 方正县| 吉首市| 元谋县| 宁武县| 南昌市| 来凤县| 景泰县|