Shell launches Hadoop cluster

Source: Internet
Author: User
Tags zookeeper

Original, reproduced please specify. Thank you

Shell launches Hadoop cluster
1: Clear Boot order
1) Start zookeeper cluster (in CentOS 4-02,centos6-02,centos7-02 respectively)
app/zookeeper-3.4.5/bin/zkserver.sh Start//startup process
app/zookeeper-3.4.5/bin/zkserver.sh Status//view state
2) Start Journalnode (respectively in CentOS 4-02,centos6-02,centos7-02)
app/hadoop-2.7.2/sbin/hadoop-daemon.sh Start Journalnode
3) format HDFs (centos4-01)
HDFs Namenode-format
Since it has been started, it is not necessary to format it.
4) Start HDFs (centos4-01)
app/hadoop-2.7.2/sbin/start-dfs.sh
5) Start yarn (centos7-01,centos8-01, start on centos7-01 only)
app/hadoop-2.7.2/sbin/start-yarn.sh
6) All the others are Datanode
app/hadoop-2.7.2/sbin/hadoop-daemon.sh Start Datanode

The code is as follows:

1 expect EOF2 EOF3  Done<zoo.list4 5 Echo "-------------------------Start-namenode----------------------------"6app/hadoop-2.7.2/sbin/hadoop-daemon.SHStart Namenode7 SSHcentos6- onapp/hadoop-2.7.2/sbin/hadoop-daemon.SHStart Namenode8 9 Echo "------------------------Start-yarn----------------------------"Ten SSHcentos7- onapp/hadoop-2.7.2/sbin/start-yarn.SH One  A Echo "------------------------Start-datanode----------------------------" -  whileRead Line -  Do theip=$line -  Echo$line -  Echo$ip -/usr/bin/expect <<-EOF +SpawnSSH-P22 [email protected] $ip -Send"app/hadoop-2.7.2/sbin/hadoop-daemon.sh start datanode\r" +Expect"*#" ASend"exit\r" at Interact - expect EOF - EOF -  Done<data.list - Echo "-------------------------over!----------------------------"

Shell launches Hadoop cluster

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.