openshift 503 Service上的Spring启动暂时不可用

时间:2017-05-24 16:35:30

标签: spring spring-boot openshift

我想在openshift上部署Spring boot App

我已经

.openshift / action_hooks / deploy file as

@IBAction func enterScore(_ sender: Any) {
        score += 1


            THESCROOL.contentSize.height = 1000
            if score >= 3 {
                THESCROOL.contentSize.height = 5000

            }}

和.openshift / action_hooks /启动文件为

#!/bin/bash

set -x

if [ ! -d $OPENSHIFT_DATA_DIR/m2/repository ]
then
    mkdir -p $OPENSHIFT_DATA_DIR/m2/repository
fi

if [ ! -d $OPENSHIFT_DATA_DIR/logs ]
then
    mkdir -p $OPENSHIFT_DATA_DIR/logs
fi

if [ ! -d $OPENSHIFT_DATA_DIR/apache-maven-3.3.9 ]
then
    wget -P $OPENSHIFT_DATA_DIR http://mirror.cc.columbia.edu/pub/software/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
    tar xvf $OPENSHIFT_DATA_DIR/apache-maven*.tar.gz --directory $OPENSHIFT_DATA_DIR
    rm -f $OPENSHIFT_DATA_DIR/apache-maven*.tar.gz
fi


export JAVA_HOME=/etc/alternatives/java_sdk_1.8.0
export M2=$OPENSHIFT_DATA_DIR/apache-maven-3.3.9/bin
export MAVEN_OPTS="-Xms384m -Xmx412m"
export PATH=$JAVA_HOME/bin:$PATH

cd $OPENSHIFT_REPO_DIR

$M2/mvn --version
$M2/mvn -s settings.xml clean install

# if you get error then un comment the following line
#$M2/mvn -s settings.xml package

nohup java -Xms384m -Xmx412m -jar target/*.jar --server.port=${OPENSHIFT_DIY_PORT} --server.address=${OPENSHIFT_DIY_IP} --spring.profiles.active=openshift &

和.openshift / action_hooks /停止文件为

#!/bin/bash

source $OPENSHIFT_CARTRIDGE_SDK_BASH

set -x

export JAVA_HOME=/etc/alternatives/java_sdk_1.8.0
export PATH=$JAVA_HOME/bin:$PATH

cd $OPENSHIFT_REPO_DIR
nohup java -Xms384m -Xmx412m -jar target/*.jar --server.port=${OPENSHIFT_DIY_PORT} --server.address=${OPENSHIFT_DIY_IP} --spring.profiles.active=openshift &

部署到openshift之后我得到了

#!/bin/bash
source $OPENSHIFT_CARTRIDGE_SDK_BASH

# The logic to stop your application should be put in this script.
if [ -z "$(ps -ef | grep testrubyserver.rb | grep -v grep)" ]
then
    client_result "Application is already stopped"
else
    kill `ps -ef | grep testrubyserver.rb | grep -v grep | awk '{ print $2 }'` > /dev/null 2>&1
fi

如何解决这个问题?

0 个答案:

没有答案