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

  • 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.

主站蜘蛛池模板: 通渭县| 南雄市| 大宁县| 九江县| 云阳县| 繁峙县| 兖州市| 和田市| 彭泽县| 宁化县| 延川县| 昆明市| 菏泽市| 横山县| 潍坊市| 成武县| 青铜峡市| 清河县| 台江县| 大方县| 沙坪坝区| 岐山县| 云安县| 阳信县| 固镇县| 永寿县| 永丰县| 满洲里市| 诸暨市| 扬中市| 鄂州市| 安仁县| 咸丰县| 福贡县| 伊川县| 精河县| 色达县| 保德县| 元江| 长葛市| 东安县|