Managing multiple Linux servers using ClusterSSH (1)

Source: Internet
Author: User

Editor's note: 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 configure it through the global configuration file/etc/clustersof ClusterSSH or the .css hrc file under the user's home directory. I like the user-level configuration method so that different users in the same system can configure it according to their preferences, clusterSSH defines a "cluster" machine group. You can use an interface to control all the machines in the group. In the "ters" section at the top of the configuration file, you can list your clusters in detail and describe each cluster in separate sections.

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 cluster2cluster1 = test1 test2cluster2 = test3 test4

You can also create an intermediate cluster (including clusters of other clusters). If you want to create a cluster named "all" that contains all the machines, there are two ways to achieve this: first, you can create a cluster that contains all machines, such:

clusters = cluster1 cluster2 allcluster1 = test1 test2cluster2 = test3 test4all = test1 test2 test3 test4

However, my favorite method is to use an intermediate cluster that contains other clusters:

clusters = cluster1 cluster2 allcluster1 = test1 test2cluster2 = test3 test4all = cluster1 cluster2

Figure 1: ClusterSSH in startup

When the hrc file becomes very large, this can help you save a lot of time.


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.