Due to the need to install a Hadoop cluster, 10 machines need to be installed, initially intended to use SCP replication, and later found unacceptable (the actual scene may be several times the number of machine clusters, that is, 10 units do not want to do). Later found on the internet, discovered the Clustershell and pssh these two tools. These two tools can be used with one or the other.
Environment Description: centos6.5 Machine 10 units
Requirements: Identify a host A that can be executed synchronously on a different node by executing commands on a.
Premise: First configure a to each machine password SSH login.
Pssh Reference URL: http://www.linuxidc.com/Linux/2011-12/49635p2.htm
Implementation, take PSSH as an example (requires Python environment, also requires Setuptools):
1. Installation
# tar ZXVF pssh-2.3.1.tar.gz
# python./pssh-2.3.1/setup.py Install
# CD./pssh-2.3.1/bin/
2. Set up a TXT file, this side with Flume.txt as the name, the inside put each node IP, each line a
#./pssh-p-H ~/flume.txt uptime//test to see the start time of each node machine
Use:
3. Batch copy files from remote machine to local
./pslurp-r-H/host/test.txt-l/usr/local/software/home/hadoop/software software
Explanation: The-l local directory,/home/hadoop/software is the remote machine directory, software renamed directory.
Assuming that the remote machine has two A, B, then the file directory is copied: Usr/local/software/a/software and Usr/local/software/b/software
4. Bulk Copy local files to remote machine
./pscp-r-H/host/all.txt. /.. /software/usr/local/software
5. Batch execution of commands (in the case of a new directory, if the directory already exists, an error)
./pssh-h./host/all.txt-p Mkdir/usr/local/app
Linux cluster operations tools: Clustershell and Pssh