Rockermq service management script (centos)

Source: Internet
Author: User

Put the script in/etc/init. d/and grant the executable permission.

Note that you need to change the Java and MQ installation directory to your own

Manage mqbroker

#/Bin/bash # Author: firxiao # data: 20140917 # usage manage rocketmq mqbroker # chkconfig:-99 90pid = 'ps ax | grep-I 'COM. alibaba. rocketmq. broker. brokerstartup '| grep Java | grep-V grep | awk' {print $1} ''# MQ installation location # mq_home =/opt/Alibaba-rocketmq/bin # Java directory # export java_home =/opt/JDK # log location # log_dir =/var/logfunction start () {if [-n "$ PID"]; then {echo "The mqbroker ($ {pid}) is running... "} else {CD $ mq_home; nohup sh mqbroker> $ log_dir/mqbroker. log 2> & 1 & Echo $ "mqbroker started logfile = $ log_dir/mqbroker. log "} fi} function stop () {if [-z" $ PID "]; then Echo" No mqbroker running. "Exit-1; FI echo" The mqbroker ($ {pid}) is running... "Kill $ {pid} echo" Send shutdown request to mqbroker ($ {pid}) OK "} function status () {if [-z" $ PID "]; then ECHO "No mqbroker running. "Exit-1; FI echo" The mqbroker ($ {pid}) is running... "} case $1 instart) Start; stop) Stop; Status) Status

Add boot start

#chkconfig --add /etc/init.d/mqbroker#chkconfig mqbroker on


Rockermq service management script (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.