Linux system how to install and configure ClusterShell tool

  

Linux system If you want to understand the load between multiple database servers, then you will use the ClusterShell tool as a Linux operation and maintenance tool, its installation and configuration is also a Learn, how do you install and configure ClusterShell on Linux?

ClusterShell installation and configuration

ClusterShell installation is very Easy, if you are using APT or YUM package management, it is a basic command of thing, I will not say, Here to talk about how to install from the source code, you need to execute the following command in the source code directory:

shell" python setup.py install

In order to facilitate the use, you also need to copy the configuration file to the specified directory. :

shell mkdir /etc/clustershell

shell cp conf/* /etc/clustershell

Then configure the nodes we want to manage, assuming we have configured a db Group, containing db_[1-3] three nodes:

shell" cat /etc/clustershell/groups

db: db_1 db_2 db_3

Ready, query all The current load situation of the database server:

shell" clush -b -g db “uptime”

Note: The premise is that you need to set password-free login on the operated server, if not clear, Please see below.

How to configure server password-free login?

If you do not generate the ssh key in advance, you need to be a member:

shell ssh-keygen

Optional operation: For convenience, we can give the server that needs to log in. A more readable alias, if you do a similar operation, then the later "USER" @ "SERVER" can be replaced with the corresponding "HOST":

shell" cat ~/. Ssh/config

Host db_1

Hostname SERVER

User USER

Port PORT

Host db_2< Br>

Hostname "SERVER"

User "USER"

Port "PORT"

Host db_3

Hostname "SERVER"

User "USER"

Port "PORT"

Then add the generated public key to the server specified location:

shell " cat ~/. Ssh/id_rsa.pub |  Ssh "USER"@"SERVER" “cat - 》》~/.ssh/authorized_keys”

If you can't remember how to correctly spell authorized_keys, you can learn the usage of ssh-copy-id. This command makes the operation simpler:

shell ssh-copy-id -i ~/.ssh/id_rsa.pub “"USER"@"SERVER"”

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

The above is the Linux installation and configuration of ClusterShell method, because the installation and configuration of ClusterShell requires a password-free login server, so this article also explained.

Copyright © Windows knowledge All Rights Reserved