Using shell scripts to filter inaccessible nodes in Hadoop

Source: Internet
Author: User

Recently used a cluster HP1, because the maintenance of the cluster of people do not give force, the node always over a period of time dropped one or two. When Hadoop was restarted today, HDFs was in protected mode.

decided to filter out all the inaccessible nodes in the slaves node, so I wrote a small script, which is recorded here, and it is convenient to use it directly.

PS: Written in C shell

The code is as follows:

#!/bin/cshif ($ #argv < 1) thenecho "Usage: $ host_file" exit 1endifset NODES = ' cat $ ' foreach NODE ($NODES) ping-q -C 1 $NODE >/dev/nullif ($ = = 0) Thenecho $NODEendifend

Incidentally, a script with an SSH check is included:

#!/bin/cshset nodes = ' Cat slaves ' foreach I ($nodes) echo $issh $i exitend


Using shell scripts to filter inaccessible nodes in Hadoop

Related Article

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.