Dubbo Summary (5)--linux maintenance of Dubbo

Source: Internet
Author: User

Once the build JAR package has deployed all the dependencies to Linux, you can start the Dubbo service, which is, of course, a prerequisite for Java's Linux environment to be deployed.

Dubbo service startup is very simple, if only a small number of service interfaces, the manual can be used for service maintenance

The commands to maintain are as follows:

Java-jar Xxx.jar &
Kill PID
Kill-9 PID

But when we use Dubbo this framework, the General Service is a lot of, if each service is manually to maintain, this work is too cumbersome, so we need a custom shell for service maintenance. Direct implementation of scripts Start,stop and restart

A shell instance is posted below for reference

#!/bin/sh## java envexport java_home=/usr/local/java/jdk1.7.0_72export jre_home= $JAVA _home/jre## service nameAPP_ name=userservice_dir=/home/li/test/service/$APP _nameservice_name=test-service-$APP _namejar_name= $SERVICE _name\ . jarpid= $SERVICE _NAME\.PIDCD $SERVICE _dircase "$" in start) nohup $JRE _home/bin/java-xms256m-xmx512m-jar $JA R_name >/dev/null 2>&1 & Echo $!    > $SERVICE _dir/$PID echo "= = = Start $SERVICE _name";; stop) Kill ' cat $SERVICE _dir/$PID ' rm-rf $SERVICE _dir/$PID echo "= = = Stop $SERVICE _name" Slee P 5#### test-service-aa.jar## test-service-aa-bb.jar p_id= ' Ps-ef | Grep-w "$SERVICE _name" | Grep-v "grep" | awk ' {print $} ' if ["$P _id" = = ""];  then echo "= = = $SERVICE _name process not exists or stop success" else echo "= = = = $SERVICE _name  Process pid is: $P _id "echo" = = = Begin Kill $SERVICE _name process, PID is: $P _id "Kill-9 $P _id      fi;;    Restart) $ Stop Sleep 2 $ start echo "= = = Restart $SERVICE _name";; * # Restart $ stop sleep 2 $ start;; Esacexit 0


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

Dubbo Summary (5)--linux maintenance of Dubbo

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.