Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use scripts to automatically configure ssh password-less login for hadoop clusters

2025-03-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to use scripts to automatically configure hadoop cluster ssh password-less login", the content is easy to understand, clear, hope to help you solve your doubts, the following let Xiaobian lead you to study and learn "how to use scripts to automatically configure hadoop cluster ssh password-less login" this article.

Many articles on the Internet are directly configured in root, because I use a separate hadoop user, so I perform operations under that user.

#! / bin/bashexport SLAVES= "slave1 slave2" export USER='hadoop'ssh-keygen-t rsa-P'- f ~ / .ssh/id_rsa # generates this key pair. Generally, cat ~ / .ssh/id_rsa.pub > > ~ / .ssh/authorized_keys # appends the public key to the authorized key under the login user's .ssh directory, and it is now possible to ssh the local machine. You can use ssh localhost to test chmod 60000. ssh/authorized_keys # modify the file "authorized_keys" permission. If you set the security settings unsafely, you will not be able to use the RSA function. # during verification, you will be prompted to enter your password There is often a problem here echo $SLAVES | tr "\ n" | while read LINE do ssh-copy-id-I ~ / .ssh/id_rsa.pub $USER@$LINE # distribute the public key to other nodes in the cluster, and $SLAVES is the node hostname list echo "Copying keygen to $LINE" done

After execution, the password-less login setting was successful. You can already log in to other nodes without a password from the primary node.

Note 1: only the master node is configured to log in to other nodes without a password. If you want to configure the ssh from other nodes to the master node, you can modify it and execute it on the corresponding node.

Note 2: the users who configure ssh on each node must be the same, otherwise there will be problems.

The above is all the contents of the article "how to use scripts to automatically configure ssh password-less login for hadoop clusters". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report