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

  • Hadoop Beginner's Guide
  • Garry Turkington
  • 393字
  • 2021-07-29 16:51:34

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.

主站蜘蛛池模板: 璧山县| 新巴尔虎右旗| 满洲里市| 蒙阴县| 双流县| 曲阜市| 安达市| 商都县| 乐至县| 阳谷县| 壶关县| 南澳县| 哈巴河县| 蓬安县| 阿鲁科尔沁旗| 关岭| 东阳市| 华池县| 来凤县| 泽库县| 小金县| 绥化市| 满城县| 织金县| 青田县| 乌恰县| 新郑市| 玉龙| 遂川县| 万州区| 满洲里市| 息烽县| 独山县| 镇安县| 康保县| 固阳县| 股票| 克拉玛依市| 突泉县| 托克逊县| 广河县|