Linux tools (ii) cluster management software clustershell
1. Brief Introduction There are about servers in the lab room that need to be managed. In addition, a lightweight cluster management software is necessary to build Hadoop and Spark clusters. After some time of understanding and trying, I finally chose clustershell for the following reasons: 1. Easy installation. One command can be easily installed. 2. easy configuration. Many cluster management software must be installed on all servers, and many connection operations are required. clustershell is quite convenient. You only need to be able to log on to all servers through ssh without a password, then, you only need to install clustershell on one server. 3. Easy to use. The clustershell command is relatively simple. Only one or two commands and three or four parameters need to be recorded. Ii. installation 1. It is very simple to install clustershell. There is only one command. Generally, the servers are Red Hat series and are installed using yum.
yum install clustershell
2. configuring ssh password-less logon configuration ssh logon is relatively simple. This step is required when building a hadoop cluster. 3. Configure/etc/hosts to match the ip address and host name in the hosts file for ease of use.
4. The configuration file of the key configuration file clustershell is located in the/etc/clustershell directory. The groups is the most commonly used one. I only configured this file.
All is followed by all nodes. Hadoop is a group I have added. You can also add other groups.
3. clush is an important command used by clustershell. So far, I have only used this command. Clush [-option] is followed by the commands executed on linux. It is very simple and not complex. Note that clustershell executes commands similar to one operation. For example, you can touch a new file on all nodes, but you cannot edit a new file in vim on all nodes at the same time. Details still need to be considered. Clush has several important parameters:-B: Merge the same output results-w: Specify node-a: All nodes-g: Specify group -- copy: group files 1. view the java installation path of all nodes, and merge the output results
clush -b -a echo $JAVA_HOME
2. Check the java installation path for all nodes in the hadoop group. The output is not merged.
clush -g hadoop echo $JAVA_HOME
3. Create an empty file on all nodes
clush -g hadoop touch 1.txt
4. The cluster distribution file distributes a local groups file to the/home/hadoop directory of all nodes in the hadoop group.
clush -b -g hadoop --copy groups --dest /home/hadoop
4. The official document clustershell also has many functions, but demand-driven learning shows the functions that I can use at present. If I need them, I will learn more. Upload an official document to learn more about clustershell. You can download it. Http://download.csdn.net/detail/picassolovecoding/8073989
There are more interesting functions to communicate with each other.