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 do SSH secret-free login of ZooKeeper in Java development

2025-02-25 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.

Share To

Internet Technology

Wechat

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

12
Report