Shell script Batch Start zookeeper

Source: Internet
Author: User
Tags zookeeper

Script name is zk_run.sh

Paste the following code into the zk_run.sh

Add Execute permissions chmode +x zk_run.sh

Run the script./zk_run.sh start

If you find that zookeeper is not starting up, try adding the following line at the top of each zookeeper zookeeper-3.4.10/bin/zkenv.sh script

Export java_home=/opt/jdk1.8.0_92

In this scenario, my script will work.

If you're not, try this one.

echo the profile configuration information to. BASHRC ' Source/etc/profile ' >> ~/.BASHRC

#!/bin/Bash  usage= "Usage: $ start|stop|status"if [$#-lt 1 ]; then  echo $usage  
    1fibehave=$1iparray=(node1 node2 node3)path= "/home/orco/resources/ zookeeper-3.4.10 "" $behave zkserver cluster " for IP in ${iparray[*]}  do "ssh to $ip    " "$path/bin/zkserver.sh $behave $path/conf/zoo.cfg"          0   

Shell script Batch Start zookeeper

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.