In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to achieve multi-log query in Polysh, 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.
A brief introduction to Polysh
Polysh is an interactive command that can process a batch of servers in batches on one server and run interactive commands. Polysh can log in to multiple remote hosts at the same time without logging in one by one through relay, and execute the same instructions, which facilitates the troubleshooting and location of problems, and greatly reduces our workload.
Polysh is a tool to aggregate several remote shells into one. It is used to launch an interactive remote shell on many machines at once. It is written in Python and requires Python ≥ 2.4.
Note: official explanation: Polysh is a tool made up of several remote scripts, which is used to run an interactive remote script on many servers, written by Python, with a minimum requirement of Python 2.4.
II. Polysh installation
Log in to the staging machine through relay and execute the following command to install polysh. The installation directory is the user directory: / opt/hl/.
1. Installation of installed python
Wget wget http://guichaz.free.fr/polysh/files/polysh-0.4.tar.gztar-zxvf polysh-0.4.tar.gzvim prod-polysh.sh
The script reads as follows:
# 10.252.176.33 ippython 10.252.176.35 is the machine you want to link to, ippython / opt/hl/polysh-0.4/polysh.py {10.252.176.33 Magi 10.252.176.35}
Open to executable permissions for other users
Chmod 777 prod-polysh.sh
two。 Installation of python is not installed
Wget wget http://guichaz.free.fr/polysh/files/polysh-0.4.tar.gztar-zxvf polysh-0.4.tar.gzcd polysh-0.4 su python setup.py installvim prod-polysh.sh
The script reads as follows:
# 10.252.176.33 ippython 10.252.176.35 is the machine you want to link to, ippython / opt/hl/polysh-0.4/polysh.py {10.252.176.33 Magi 10.252.176.35}
Open to executable permissions for other users
Chmod 777 prod-polysh.sh
3. Configure Xagent for Xshell (mac can skip this step)
Open File-Properties, select the SSH option, and select Xagent (SSH Agent) with password processing. Then restart Xshell.
IV. Use of polysh
4.1. Method one
Polysh 10.252.176.33 10.252.176.35
4.2. Method 2
. / prod-polysh.sh
The following prompt appears
[- hl-] $. / prod-polysh.shready (8)
Ready (8) indicates that eight machines are connected and can execute query commands. Either exit or Crtl+z can exit.
4.3. Execute a command
Ready (8) > cd / opt/hlready (8) > pwd
The display is as follows:
10.252.176.33: / opt/hl10.252.176.35: / opt/hl
5. Source code
You can get the source code of polysh through git
Git clone git://repo.or.cz/polysh.git
VI. Other
Instructions that begin with a colon are not sent to the remote host, and polysh executes instructions that begin with a colon, such as:
Ready (2) >: help: add Add one or many remote shells. : chdir Change the current directory of polysh (not the remote shells). : disable Disable sending commands to remote shells. : enable Enable sending commands to remote shells. : export_vars Export some environment variables on enabled remote shells. : help List control commands or show their documentations. : hide_password Do not echo the next typed line. : list List remote shells and their states. : purge Delete disabled remote shells. : quit Quit polysh. : reconnect Try to reconnect to disconnected remote shells. : rename Rename all enabled remote shells with the argument. : replicate Copy a path from one remote shell to all others: reset_prompt Change the prompt to be recognized by polysh. : send_ctrl Send a control character to remote shells. : set_debug Enable or disable debugging output for remote shells. : set_log Duplicate every console I/O into the given local file. : show_read_buffer Print the data read by remote shells. : upload Upload the specified local path to enabled remote shells. On how to achieve multi-log query in Polysh to share here, I hope that 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.