"DAY2" a shell script that needs to be used in full Hadoop distribution mode

Source: Internet
Author: User

Cluster remote replication (distributed by Namenode)

---------------------------------------

#! /bin/bashif [$#-lt 1]; Thenecho no argsexit; Fi#get first argumentarg1=$1;cuser= ' WhoAmI ' fname= ' basename $arg 1 ' dir= ' dirname $arg 1 ' If ["$dir" = " ." ] ; Thendir= ' pwd ' fifor ((i=200;i<=500;i=i+100));d Oecho--------coping $arg 1 to $i---------, if [-D $arg 1]; Thenscp-r $arg 1 [email protected] $i: $DIRELSESCP $arg 1 [email protected] $i: $dirfiechodone

Cluster remote View list (completed by Namenode)

------------------------------------------

#! /bin/bashif [$#-lt 1]; Thenecho no argsexit; Fi#get first argumentarg1=$1;cuser= ' WhoAmI ' fname= ' basename $arg 1 ' dir= ' dirname $arg 1 ' If ["$dir" = " ." ] ; Thendir= ' pwd ' fifor ((i=200;i<=500;i=i+100));d oecho--------ls $arg 1 $i---------, if [-D $arg 1]; THENSSH s$i ls $dir/$fname | Xargselsessh s$i ls $dir | Xargsfiechodone

The cluster remotely deletes files or folders (completed by Namenode)

--------------------------------------------

#! /bin/bashif [$#-lt 1]; Thenecho no argsexit; Fi#get first argumentarg1=$1;cuser= ' WhoAmI ' fname= ' basename $arg 1 ' dir= ' dirname $arg 1 ' If ["$dir" = " ." ] ; Thendir= ' pwd ' fifor ((i=200;i<=500;i=i+100));d Oecho--------rm $arg 1 in s$i---------; if [-D $arg 1]; Thenssh s$i rm-rf $dir/$fnameecho okelsessh s$i rm $dir/$fnameecho Okfiechodone

Cluster One-click to open and complete Namenode format, create user directory (completed by Namenode)

-----------------------------------------------------------------------------------

#!/bin/bashecho  "--------------- NOW FORMAT HDFS ------------" Hdfs namenode  -formatecho  "--------------- HDFS FORMAT ALREADY -------------" echo  "----- ---------- NOW START HDFS --------------"start-dfs.shecho "--------------- hdfs  START ALREADY --------------"echo "--------------- NOW START YARN  system -------------"start-yarn.shecho "--------------- YARN SYSTEM START  already -------------"echo "--------------- NOW CREAT USER DIRECTORY ------ -------"hadoop fs -mkdir -p /user/yehom/dataecho "--------------- USER  diredctory created already -----------"echo "--------------- SHOW USER  direrectory list --------------"hadoop fs -ls -r /echo " ***************  all start and ini ******************* "echo " *************** design by yehom  @YehomLab. com * ****************"

Cluster one-click Shutdown and delete all logs and related directories (completed by Namenode)

#!/bin/bashecho "-------------------now STOP HADOOP CLUSTER--------------------" Stop-yarn.shstop-dfs.shecho "------ -------------HADOOP CLUSTER STOP already--------------------"echo"-------------------now DELETE DATA File------------------------"xrm.sh ~/hadoop-yehomecho"-------------------DATA FILE DELETED Already--------------------"echo"-------------------now DELETE LOGS---------------------"xrm.sh/soft/hadoop/ Logsecho "-------------------LOGS DELETED already----------------" echo "******************* all HADOOP TASK STOP and REFRESH ***************** "echo" ******************* DESIGN by Yehom @YehomLab. com ***************** "


This article is from the "Yehomlab" blog, make sure to keep this source http://yehom.blog.51cto.com/5159116/1793049

"DAY2" a shell script that needs to be used in full Hadoop distribution mode

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.