Linux Clustershell installation and configuration tutorial

Source: Internet
Author: User

Installation and configuration of Clustershell

Clustershell installation is easy, if the use of apt or yum package management, the basic is a command of things, I will not say, here to say how to install from the source code, you need to execute the following command in the source code directory:

shell> python setup.py Install

For ease of use, you will also need to copy the configuration files to the specified directory:

Shell> Mkdir/etc/clustershell
shell> CP conf/*/etc/clustershell

Then configure the node we want to manage, assuming we have a DB group configured with Db_[1-3] three nodes:

Shell> cat/etc/clustershell/groups
Db:db_1 db_2 Db_3

To be ready, follow the example at the beginning of the article: query all database servers for current load conditions:
shell> clush-g db "Uptime"
Note: The prerequisite is that you need to set the password-free login on the operating server, if not clear, please see the following content.

Article: How to configure the server password-free login?

If you do not generate the SSH key in advance, you need to be Mr.:


Shell> Ssh-keygen

Optional operation: For convenience, we can give the server that needs to log in a better readability alias, if you do a similar operation, then the following @ can be replaced by the corresponding:

Shell> Cat ~/.ssh/config
Host db_1
Hostname
User
Port

Host db_2
Hostname
User
Port

Host Db_3
Hostname
User
Port

The generated public key is then added to the specified location of the server where the login is required:

Shell> Cat ~/.ssh/id_rsa.pub | SSH @ "cat->> ~/.ssh/authorized_keys"

If you're like me, you can't remember how to spell Authorized_keys correctly, you can go on to learn the usage of Ssh-copy-id, which makes it easier to do things:

shell> ssh-copy-id-i ~/.ssh/id_rsa.pub "@"

Note: Each configured a password-free login server, it is best to manually actually operate, because the first connection will require manual confirmation of whether to save information to the ~/.ssh/known_hosts file.

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.