Spring Boot 2.0.0.M7 Production Environment deployment

Source: Internet
Author: User


Springboot production Environment

Caution 1. Remove unwanted jars

    • Development tools Jar:spring-boot-devtools


monitor be sure to do the right control or remove

    • control jar:spring-boot-starter-actuator

    • druid monitoring

    • swagger interface 3, packaging , skip test

    • maven:cleanpackage -dmaven.test.skip=true

    • Script

#!/bin/sh## chang hereservice_dir=/var/www/ctoeduservice_name= Blog-api-boot-jpa-data-0.0.1-snapshotspring_profiles_active=dev## java envexport java_home=/opt /jdk1.8export jre_home=${java_home}/jrecase  "$"  in start) procedure= ' ps -ef |  grep -w  "${service_name}"  |grep -w  "java" | grep -v  "grep"  |  awk  ' {print $2} ' if [  ' ${procedure} '  =  '  ];thenecho  ' start &nbsp "if [ " " != " " ];thenSPRING_PROFILES_ACTIVE=$2fiecho " Spring.profiles.active=${spring_profiles_active} "exec nohup ${jre_home}/bin/java -xms128m  -xmx512m -jar ${service_dir}/${service_name}\.jar --spring.profiles.active=${spring_profiles_ active} >/dev/null 2>&1 &echo  "start success" elseecho  "${SERVICE_ Name} is start "FI;; Stop) procedure= ' ps -ef | grep -w  "${service_name}"  |grep -w  "java" | grep -v  "grep"  | awk   ' {print $2} ' if [  ' ${procedure} '  =  '  ];thenecho  ' ${service_name}  is stop "Elsekill -9 ${procedure}sleep 1argprocedure= ' Ps -ef | grep  -w  "${service_name}"  |grep -w  "java" | grep -v  "grep"  | awk   ' {print $2} ' if [  ' ${argprocedure} '  =  '  ];thenecho  ' ${service_name}  stop success "elsekill -9 ${argprocedure}echo " ${service_name} stop error " Fifi;; Restart) $0 stopsleep 1$0 start $2;;   *) echo  "Usage: $0 [start|stop|restart] [dev|test|prod]";;   esac
Execute script

./ctoedu.sh Start
./ctoedu.sh Stop/ctoedu.sh start test./ctoedu.sh start dev./ctoedu.sh Start prod

Ps-ef | grep blog-api-boot-jpa-data-0.0.1-snapshot

TAIL-100F logs


Spring Boot 2.0.0.M7 Production Environment deployment

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.