In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to log in to ZooKeeper in Java development. The content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
We have been able to transfer data to multiple servers at the same time through cluster distribution scripts, but you will find that when you transfer data, you will still enter the password of the other server, which is also very troublesome, don't worry, what we are going to talk about next is how to solve this situation, this technology is SSH secret-free login.
Principle of secret-free login
As shown in the figure:
1. On hadoop100, generate the public key and private key:
(1) under the ~ directory, using the ls-a command, you will find that there is actually a hidden directory under this directory: .ssh
(2) enter the directory and execute the following command:
[root@hadoop100] # ssh-keygen-t rsa
Enter three times and check the directory again to find that a public key file and a private key have been generated:
(3) copy the public key to the target server where you want to log in without secret, and execute the following command
[root@hadoop100 .ssh] $ssh-copy-id hadoop101 [root@hadoop100 .ssh] $ssh-copy-id hadoop102
(4) in the .ssh directory of the target server, you will find that the authorized_keys file is generated.
(5) Test, under hadoop100, execute the following command, and you will find that you do not need to enter a password
[root@hadoop100 .ssh] # ssh hadoop101
(6) at this point, when you execute the command to connect to yourself under hadoop100, you will find that you still need to enter a password, so you also need to add a public key to your server:
Add a public key:
(7) perform yesterday's directory synchronization and you will find that the password is no longer entered:
2. Perform the above operations on hadoop101 and configure unencrypted login to hadoop100,hadoop102.
(1)
(2)
(3)
(4)
On how to carry out Java development ZooKeeper SSH secret-free login to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.