Set zookeeper to boot on CentOS

Source: Internet
Author: User

after deploying the zookeeper, when it is necessary to restart the machine, it often takes a little time to boot the zookeeper cluster, because zookeeper does not have the concept of a master node, and the restart of a node does not cause any image to the cluster, so you can consider Zookeeper is set to boot, the specific process is as follows
    1. preparation
      1. switch to/etc/rc.d/init.d/directory
      2. Create Zookeeper file: Touch zookeeper
      3. Update permissions: chmod +x zookeeper
      4. edit file, Enter the following in zookeeper
#!/bin/bash
#chkconfig: 2345
#description: Zookeeper
#processname: Zookeeper
Export java_home=/opt/cloud/jdk1.7.0_55
Export path= $JAVA _home/bin: $PATH
Case $ in
start) Su root/opt/cloud/zookeeper-3.4.6/bin/zkserver.sh start;
stop) su root/opt/cloud/zookeeper-3.4.6/bin/zkserver.sh stop;;
status) su root/opt/cloud/zookeeper-3.4.6/bin/zkserver.sh status;;
restart) su root/opt/cloud/zookeeper-3.4.6/bin/zkserver.sh restart;;
*) echo "require Start|stop|status|restart";;
Esac


2. Verification
      1. At this point we can start the Stop Zookeeper service with service zookeeper Start/stop.
      2. Use the Chkconfig--add Zookeeper command to add zookeeper to the boot boot

      3. After the add is complete, use chkconfig--list to see if the zookeeper we added is inside.
      4. If the above operation is normal, you can restart your Linux server.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Set zookeeper to boot on CentOS

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.