Pd-patch

来自ling
跳转至: 导航搜索

网络拓扑

nacos(测试) http://10.10.10.175:8848/nacos/index.html#/login nacos/nacos

nacos(正式) http://res.powerlong.com/nacos

Pd-patch-network.png

部署细节

prod_pd_patch_pipe

node {

     stage("pull code ") {
            git branch:'master',url:'http://10.10.10.188/newpd/pd_patch.git',credentialsId:'f5c76460-affc-4d18-92ad-7c2c2bebd1bd'
    }

    stage("build code ") {
        sh label: '', script: '''
            mvn clean install package -U -Dmaven.test.skip=true
            scp ./pd-patch-biz/target/pd-patch-biz.jar root@10.251.5.65:/data/apps/pd-patch/upload
        '''
    }
    
    stage("release code ") {
        sh label: '', script: '''
            ssh root@10.251.5.65 "sh /data/apps/pd-patch/deploy.sh"
        '''
    }

}    


pid=`ps -ef | grep pd-patch-biz.jar | grep -v grep | awk '{print $2}'`
if [  -f /data/apps/pd-patch/upload/pd-patch-biz.jar ]
then
        DATE=$(date +%Y%m%d_%H%M%S_%N)
        echo "begin barkup jar !"
        cp /data/apps/pd-patch/pd-patch-biz.jar /data/apps/pd-patch/barkup/jars/${DATE}.jar &> /dev/null
        echo "begin publish jar !"
        mv /data/apps/pd-patch/upload/pd-patch-biz.jar /data/apps/pd-patch/pd-patch-biz.jar &> /dev/null
        if [  -n $pid ]
        then
                echo "begin kill $pid !"
                kill -9 $pid
                echo "begin startup !"
                nohup /data/apps/jdk1.8.0_91/bin/java -jar /data/apps/pd-patch/pd-patch-biz.jar -Xms8192m -Xmx16384m --spring.profiles.active=prd ---spring.cloud.nacos.config.server-addr=res.powerlong.com:80 --spring.cloud.nacos.config.namespace=dc8e9e10-542d-456a-a9c7-97890e1f55ab --spring.cloud.nacos.discovery.namespace=dc8e9e10-542d-456a-a9c7-97890e1f55ab --server.port=4000 --server.max-http-header-size=102400 --log.path=/data/logs/pd-patch > /data/logs/pd-patch/pd-patch.log 2> /dev/null &
                echo
        else
                echo "begin startup !"
                nohup /data/apps/jdk1.8.0_91/bin/java -jar /data/apps/pd-patch/pd-patch-biz.jar -Xms8192m -Xmx16384m --spring.profiles.active=prd ---spring.cloud.nacos.config.server-addr=res.powerlong.com:80 --spring.cloud.nacos.config.namespace=dc8e9e10-542d-456a-a9c7-97890e1f55ab --spring.cloud.nacos.discovery.namespace=dc8e9e10-542d-456a-a9c7-97890e1f55ab --server.port=4000 --server.max-http-header-size=102400 --log.path=/data/logs/pd-patch > /data/logs/pd-patch/pd-patch.log 2> /dev/null &
                echo
        fi
else
        echo "Packag error !"
fi

demo_pd_patch_pipe

node {

     stage("pull code ") {
            git branch:'master',url:'http://10.10.10.188/newpd/pd_patch.git',credentialsId:'f5c76460-affc-4d18-92ad-7c2c2bebd1bd'
    }

    stage("build code ") {
        sh label: '', script: '''
            mvn clean install package -U -Dmaven.test.skip=true
            scp ./pd-patch-biz/target/pd-patch-biz.jar root@10.251.5.247:/data/apps/pd-patch/upload
        '''
    }
    
    stage("release code ") {
        sh label: '', script: '''
            ssh root@10.251.5.247 "sh /data/apps/pd-patch/deploy.sh"
        '''
    }

}    


pid=`ps -ef | grep pd-patch-biz.jar | grep -v grep | awk '{print $2}'`
if [  -f /data/apps/pd-patch/upload/pd-patch-biz.jar ]
then
        DATE=$(date +%Y%m%d_%H%M%S_%N)
        echo "begin barkup jar !"
        cp /data/apps/pd-patch/pd-patch-biz.jar /data/apps/pd-patch/barkup/jars/${DATE}.jar &> /dev/null
        echo "begin publish jar !"
        mv /data/apps/pd-patch/upload/pd-patch-biz.jar /data/apps/pd-patch/pd-patch-biz.jar &> /dev/null
        if [  -n $pid ]
        then
                echo "begin kill $pid !"
                kill -9 $pid
                echo "begin startup !"
                nohup /data/apps/jdk1.8.0_91/bin/java -jar /data/apps/pd-patch/pd-patch-biz.jar -Xms2148m -Xmx8192m --server.port=4000 --log.path=/data/logs/pd-patch  --server.servlet.context-path=/patch > /data/logs/pd-patch/pd-patch.log 2> /dev/null &
                echo
        else
                echo "begin startup !"
                nohup /data/apps/jdk1.8.0_91/bin/java -jar /data/apps/pd-patch/pd-patch-biz.jar -Xms2148m -Xmx8192m --server.port=4000 --log.path=/data/logs/pd-patch  --server.servlet.context-path=/patch > /data/logs/pd-patch/pd-patch.log 2> /dev/null &
                echo
        fi
else
        echo "Packag error !"
fi













#cd /data/bladex/pd-job-executor
#git pull origin demo
##git checkout origin/demo
#mvn -o -Dmaven.test.skip=true clean package dockerfile:build dockerfile:push
#export REGISTER=10.201.3.11:88/blade
#export TAG=1.0.0-SNAPSHOT
#export COMMAND='--spring.profiles.active=dev --spring.cloud.nacos.discovery.server-addr=10.201.3.11:8848 --spring.cloud.nacos.config.server-addr=10.201.3.11:8848 --spring.cloud.inetutils.preferredNetworks[0]=^172\.30'
#docker service rm blade_pd-job-executor-biz
#docker stack deploy -c pdjobexecutor.yml blade

pid=`ps -ef | grep pd-job-executor.jar | grep -v grep | awk '{print $2}'`
if [  -n $pid ]
        then
                echo "begin kill $pid !"
                kill -9 $pid
                echo "begin startup !"
                nohup nohup /usr/java/jdk1.8.0_192/bin/java -jar /data/bladex/pd-job-executor/target/pd-job-executor.jar --spring.profiles.active=dev --server.port=8109 -Xms2048m -Xmx2048m --server.max-http-header-size=102400 --log.path=/data/logs/pd-jobexecutor > /data/logs/pd-jobexecutor/pd-jobexecutor.log 2> /dev/null &
                echo
        else
                echo "begin startup !"
                nohup /usr/java/jdk1.8.0_192/bin/java -jar /data/bladex/pd-job-executor/target/pd-job-executor.jar --spring.profiles.active=dev --server.port=8109 -Xms2048m -Xmx2048m --server.max-http-header-size=102400 --log.path=/data/logs/pd-jobexecutor > /data/logs/pd-jobexecutor/pd-jobexecutor.log 2> /dev/null &
                echo
        fi