Use ClusterSSH to manage multiple Linux servers

Source: Internet
Author: User
Article Title: Use ClusterSSH to manage multiple Linux servers. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Cluster SSH is a tool that can be used to manage multiple remote computers simultaneously through the SSH protocol. It is ideal for quickly configuring all computer nodes in a cluster that run the same service and have the same configuration. There are a large number of open-source management tools available for such management, such as dsh and SUSE Manager. The following describes how to use ClusterSSH to manage multiple Linux servers.
If you are a Linux system administrator, you will certainly deal with many machines every day, because you need to regularly monitor and maintain these machines, such as a batch of Web servers, if you want to run the same command on multiple machines at the same time, you may log on to the server over SSH, and then press the command one by one. If you use ClusterSSH, you can save a lot of similar work time.
ClusterSSH is a new tool formed by packaging XTerm and SSH with Tk/Perl. In itself, it can run on any POSIX-compatible operating system, solaris and Mac OS X run it. It requires the Perl library Tk (perl-tk On Debian or Ubuntu) and X11 :: protocol (libx11-protocol-perl On Debian or Ubuntu), in addition, xterm and OpenSSH are essential.
Install
Installing ClusterSSH On Debian or Ubuntu is quite simple. You only need to enter sudo apt-get install clusterssh to install it. You don't have to worry about dependency packages, everything will be installed for you. It also provides an rpm package suitable for Fedora, which can be installed on FreeBSD through the port system and MacPort version for Mac OS X, therefore, you can install ClusterSSH on your Apple Computer. Of course, if you are a geek, you can also download the source code and compile it yourself.
Configuration
You can use the global configuration file/etc/clusters of ClusterSSH or under the user's home directory. Csshrc file to configure it. I like user-level configuration, so that different users in the same system can configure it according to their preferences. ClusterSSH defines a "cluster" Machine Group, you can use a single interface to control all the machines in this group. In the "ters" section at the top of the configuration file, you can list your clusters in detail, separate sections are used to describe each cluster.
For example, suppose I have two clusters, each of which is composed of two machines. Cluster1 is composed of two machines: Test1 and Test2, "Cluster2" is composed of "Test3" and "Test4" machines ,~. The content of the csshrc (or/etc/clusters) configuration file should look like:
Clusters = cluster1 cluster2
Cluster1 = test1 test2
Cluster2 = test3 test4 you can also create an intermediate cluster (including the clusters of other clusters). If you want to create a cluster named "all" that contains all the machines, there are two implementation methods, first, you can create a cluster that contains all machines, such:
Clusters = cluster1 cluster2 all
Cluster1 = test1 test2
Cluster2 = test3 test4
All = test1 test2 test3 test4 but my favorite method is to use an intermediate cluster that contains other clusters:
Clusters = cluster1 cluster2 all
Cluster1 = test1 test2
Cluster2 = test3 test4
All = cluster1 cluster2


Figure 1: ClusterSSH in startup
By calling "all" clusters that contain cluster1 and cluster2, any changes to these clusters can be automatically captured, so you do not have to update the "all" definition. The csshrc file becomes very large, which can help you save a lot of time.

[1] [2] Next page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.