You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by hy...@apache.org on 2018/07/24 14:55:46 UTC

[incubator-dubbo-ops] branch master updated: Fix bugs for no applications, services && enhance script start.sh

This is an automated email from the ASF dual-hosted git repository.

hyunkun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo-ops.git


The following commit(s) were added to refs/heads/master by this push:
     new 3dc581f  Fix bugs for no applications, services && enhance script start.sh
3dc581f is described below

commit 3dc581f938eb84ae424cb7b2c63f0f8571150a03
Author: huadong <le...@gmail.com>
AuthorDate: Tue Jul 24 22:55:43 2018 +0800

    Fix bugs for no applications, services && enhance script start.sh
    
    * Fix no log output by adding package dependency of slf4j-log4j12.
    * Fix no charts,applications and services issue
    * Enhance script start.sh
---
 dubbo-monitor-simple/pom.xml                         |  5 ++++-
 .../main/resources/META-INF/assembly/bin/start.sh    | 20 +++++++++++++++++---
 .../internal/com.alibaba.dubbo.container.Container   |  2 +-
 .../src/main/resources/conf/dubbo.properties         |  4 ++--
 4 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/dubbo-monitor-simple/pom.xml b/dubbo-monitor-simple/pom.xml
index 0443934..0a422d3 100644
--- a/dubbo-monitor-simple/pom.xml
+++ b/dubbo-monitor-simple/pom.xml
@@ -59,9 +59,12 @@ limitations under the License.
             <artifactId>slf4j-api</artifactId>
         </dependency>
         <dependency>
+           <groupId>org.slf4j</groupId>
+           <artifactId>slf4j-log4j12</artifactId>
+        </dependency>
+        <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>javax.servlet-api</artifactId>
-            <scope>provided</scope>
         </dependency>
     </dependencies>
     <build>
diff --git a/dubbo-monitor-simple/src/main/resources/META-INF/assembly/bin/start.sh b/dubbo-monitor-simple/src/main/resources/META-INF/assembly/bin/start.sh
index 3b491f0..026903a 100755
--- a/dubbo-monitor-simple/src/main/resources/META-INF/assembly/bin/start.sh
+++ b/dubbo-monitor-simple/src/main/resources/META-INF/assembly/bin/start.sh
@@ -5,10 +5,16 @@ cd ..
 DEPLOY_DIR=`pwd`
 CONF_DIR=$DEPLOY_DIR/conf
 
+
 SERVER_NAME=`sed '/dubbo.application.name/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
 SERVER_PROTOCOL=`sed '/dubbo.protocol.name/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
-SERVER_HOST=`sed '/dubbo.protocol.host/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
-SERVER_PORT=`sed '/dubbo.protocol.port/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
+if [ -z "$SERVER_HOST" ]; then
+    SERVER_HOST=`sed '/dubbo.protocol.host/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
+fi
+
+if [ -z "$SERVER_PORT" ]; then
+    SERVER_PORT=`sed '/dubbo.protocol.port/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
+fi
 LOGS_FILE=`sed '/dubbo.log4j.file/!d;s/.*=//' conf/dubbo.properties | tr -d '\r'`
 
 if [ -z "$SERVER_HOST" ]; then
@@ -48,7 +54,7 @@ STDOUT_FILE=$LOGS_DIR/stdout.log
 LIB_DIR=$DEPLOY_DIR/lib
 LIB_JARS=`ls $LIB_DIR|grep .jar|awk '{print "'$LIB_DIR'/"$0}'|tr "\n" ":"`
 
-JAVA_OPTS=" -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true "
+JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true "
 JAVA_DEBUG_OPTS=""
 if [ "$1" = "debug" ]; then
     JAVA_DEBUG_OPTS=" -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n "
@@ -90,3 +96,11 @@ echo "OK!"
 PIDS=`ps -f | grep java | grep -v grep | grep "$DEPLOY_DIR" | awk '{print $2}'`
 echo "PID: $PIDS"
 echo "STDOUT: $STDOUT_FILE"
+
+if [ "$1" = "run" ]; then
+    while ps -p $PIDS > /dev/null
+    do
+        echo -e ".\c"
+        sleep 1 
+    done
+fi
diff --git a/dubbo-monitor-simple/src/main/resources/META-INF/dubbo/internal/com.alibaba.dubbo.container.Container b/dubbo-monitor-simple/src/main/resources/META-INF/dubbo/internal/com.alibaba.dubbo.container.Container
index 2e6beaa..b3bfcf6 100644
--- a/dubbo-monitor-simple/src/main/resources/META-INF/dubbo/internal/com.alibaba.dubbo.container.Container
+++ b/dubbo-monitor-simple/src/main/resources/META-INF/dubbo/internal/com.alibaba.dubbo.container.Container
@@ -1,2 +1,2 @@
 registry=com.alibaba.dubbo.monitor.simple.container.RegistryContainer
-jetty=com.alibaba.dubbo.monitor.simple.container.JettyContainer
\ No newline at end of file
+jetty-monitor=com.alibaba.dubbo.monitor.simple.container.JettyContainer
\ No newline at end of file
diff --git a/dubbo-monitor-simple/src/main/resources/conf/dubbo.properties b/dubbo-monitor-simple/src/main/resources/conf/dubbo.properties
index ef75f17..9bece5f 100644
--- a/dubbo-monitor-simple/src/main/resources/conf/dubbo.properties
+++ b/dubbo-monitor-simple/src/main/resources/conf/dubbo.properties
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-dubbo.container=log4j,spring,registry,jetty
+dubbo.container=log4j,spring,registry,jetty-monitor
 dubbo.application.name=simple-monitor
 dubbo.application.owner=dubbo
 #dubbo.registry.address=multicast://224.5.6.7:1234
@@ -23,7 +23,7 @@ dubbo.registry.address=zookeeper://127.0.0.1:2181
 dubbo.protocol.port=7070
 dubbo.jetty.port=8080
 dubbo.jetty.directory=${user.home}/monitor
-dubbo.charts.directory=${dubbo.jetty.directory}/charts
+dubbo.charts.directory=${user.home}/monitor/charts
 dubbo.statistics.directory=${user.home}/monitor/statistics
 dubbo.log4j.file=logs/dubbo-monitor-simple.log
 dubbo.log4j.level=WARN
\ No newline at end of file