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

vongosling pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-docker.git

commit 048b348310d71414974a7f6cbb21d9fda49b7592
Author: 刘睿 <liurui@liuruideMacBook-Pro.local>
AuthorDate: Fri Aug 23 15:25:49 2019 +0800

    Fix(issue#7): drop placeholder and use scripts
---
 README.md                                          | 19 -----
 image-build/Dockerfile-alpine                      |  4 +-
 image-build/Dockerfile-centos                      |  2 +-
 templates/data/broker/logs/placeholder             |  0
 templates/data/broker/store/placeholder            |  0
 templates/data/broker0/logs/placeholder            |  0
 templates/data/broker0/store/placeholder           |  0
 templates/data/broker1/logs/placeholder            |  0
 templates/data/broker1/store/placeholder           |  0
 templates/data/broker2/logs/placeholder            |  0
 templates/data/broker2/store/placeholder           |  0
 templates/data/namesrv/logs/placeholder            |  0
 templates/data/namesrv/store/placeholder           |  0
 .../docker-compose/data/broker/logs/placeholder    |  0
 .../docker-compose/data/broker/store/placeholder   |  0
 .../docker-compose/data/namesrv/logs/placeholder   |  0
 .../docker-compose/data/namesrv/store/placeholder  |  0
 .../docker-compose/data1/broker/logs/placeholder   |  0
 .../docker-compose/data1/broker/store/placeholder  |  0
 templates/docker-compose/docker-compose.yml        |  1 -
 templates/kubernetes/deployment.yaml               |  2 -
 templates/kubernetes/deployment2.yaml              |  2 -
 templates/play-docker-compose.sh                   | 17 +++--
 templates/play-docker-deledger.sh                  | 25 ++++---
 templates/play-docker-tls.sh                       | 19 +++--
 templates/play-docker.sh                           | 19 +++--
 templates/play-kubernetes.sh                       |  2 -
 templates/scripts/runbroker-customize.sh           | 84 ----------------------
 templates/scripts/runserver-customize.sh           | 70 ------------------
 29 files changed, 61 insertions(+), 205 deletions(-)

diff --git a/README.md b/README.md
index 064f259..e44fedb 100644
--- a/README.md
+++ b/README.md
@@ -102,24 +102,6 @@ cd stages/4.5.0
 ./play-consumer.sh
 ```
 
-
-
-### To use specified heap size for JVM
-
-1. Use the environment variable MAX_POSSIBLE_HEAP to specify the max heap 
which JVM could use. Meanwhile, the max direct memory is the same size as 
MAX_POSSIBLE_HEAP.
-
-2. To verify the usage:
-
-Run:
-
-```
-
-docker run -d -p 9876:9876 -v `pwd`/data/namesrv/logs:/root/logs -v 
`pwd`/data/namesrv/store:/root/store --name rmqnamesrv -e 
"MAX_POSSIBLE_HEAP=100000000" rocketmqinc/rocketmq:4.4.0 sh mqnamesrv
-
-docker run -d -p 10911:10911 -p 10909:10909 -v 
`pwd`/data/broker/logs:/root/logs -v `pwd`/data/broker/store:/root/store --name 
rmqbroker --link rmqnamesrv:namesrv -e "NAMESRV_ADDR=namesrv:9876" -e 
"MAX_POSSIBLE_HEAP=200000000" rocketmqinc/rocketmq:4.4.0 sh mqbroker
-
-```
-
 ### How to update RocketMQ image repository using update.sh
 Run:
 
@@ -233,7 +215,6 @@ services:
       - 9876:9876
     volumes:
       - ./data/namesrv/logs:/home/rocketmq/logs
-      - ./data/namesrv/store:/home/rocketmq/store
     command: sh mqnamesrv
   broker:
     image: rocketmqinc/rocketmq:4.4.0
diff --git a/image-build/Dockerfile-alpine b/image-build/Dockerfile-alpine
index 6145021..4228dc3 100644
--- a/image-build/Dockerfile-alpine
+++ b/image-build/Dockerfile-alpine
@@ -22,7 +22,7 @@ RUN apk add --no-cache bash gettext nmap-ncat openssl 
busybox-extras
 ARG user=rocketmq
 ARG group=rocketmq
 ARG uid=3000
-ARG gid=3000
+ARG gid=999
 
 # RocketMQ is run with user `rocketmq`, uid = 3000
 # If you bind mount a volume from the host or a data container,
@@ -87,4 +87,4 @@ RUN sed -i 
's/${JAVA_HOME}\/jre\/lib\/ext/${JAVA_HOME}\/jre\/lib\/ext:${JAVA_HOM
 
 USER ${user}
 
-WORKDIR ${ROCKETMQ_HOME}/bin
+WORKDIR ${ROCKETMQ_HOME}/bin
\ No newline at end of file
diff --git a/image-build/Dockerfile-centos b/image-build/Dockerfile-centos
index b810dc6..8331c2e 100644
--- a/image-build/Dockerfile-centos
+++ b/image-build/Dockerfile-centos
@@ -28,7 +28,7 @@ RUN yum install -y java-1.8.0-openjdk-devel.x86_64 unzip 
gettext nmap-ncat opens
 ARG user=rocketmq
 ARG group=rocketmq
 ARG uid=3000
-ARG gid=3000
+ARG gid=999
 
 # RocketMQ is run with user `rocketmq`, uid = 3000
 # If you bind mount a volume from the host or a data container,
diff --git a/templates/data/broker/logs/placeholder 
b/templates/data/broker/logs/placeholder
deleted file mode 100644
index e69de29..0000000
diff --git a/templates/data/broker/store/placeholder 
b/templates/data/broker/store/placeholder
deleted file mode 100644
index e69de29..0000000
diff --git a/templates/data/broker0/logs/placeholder 
b/templates/data/broker0/logs/placeholder
deleted file mode 100644
index e69de29..0000000
diff --git a/templates/data/broker0/store/placeholder 
b/templates/data/broker0/store/placeholder
deleted file mode 100644
index e69de29..0000000
diff --git a/templates/data/broker1/logs/placeholder 
b/templates/data/broker1/logs/placeholder
deleted file mode 100644
index e69de29..0000000
diff --git a/templates/data/broker1/store/placeholder 
b/templates/data/broker1/store/placeholder
deleted file mode 100644
index e69de29..0000000
diff --git a/templates/data/broker2/logs/placeholder 
b/templates/data/broker2/logs/placeholder
deleted file mode 100644
index e69de29..0000000
diff --git a/templates/data/broker2/store/placeholder 
b/templates/data/broker2/store/placeholder
deleted file mode 100644
index e69de29..0000000
diff --git a/templates/data/namesrv/logs/placeholder 
b/templates/data/namesrv/logs/placeholder
deleted file mode 100644
index e69de29..0000000
diff --git a/templates/data/namesrv/store/placeholder 
b/templates/data/namesrv/store/placeholder
deleted file mode 100644
index e69de29..0000000
diff --git a/templates/docker-compose/data/broker/logs/placeholder 
b/templates/docker-compose/data/broker/logs/placeholder
deleted file mode 100644
index e69de29..0000000
diff --git a/templates/docker-compose/data/broker/store/placeholder 
b/templates/docker-compose/data/broker/store/placeholder
deleted file mode 100644
index e69de29..0000000
diff --git a/templates/docker-compose/data/namesrv/logs/placeholder 
b/templates/docker-compose/data/namesrv/logs/placeholder
deleted file mode 100644
index e69de29..0000000
diff --git a/templates/docker-compose/data/namesrv/store/placeholder 
b/templates/docker-compose/data/namesrv/store/placeholder
deleted file mode 100644
index e69de29..0000000
diff --git a/templates/docker-compose/data1/broker/logs/placeholder 
b/templates/docker-compose/data1/broker/logs/placeholder
deleted file mode 100644
index e69de29..0000000
diff --git a/templates/docker-compose/data1/broker/store/placeholder 
b/templates/docker-compose/data1/broker/store/placeholder
deleted file mode 100644
index e69de29..0000000
diff --git a/templates/docker-compose/docker-compose.yml 
b/templates/docker-compose/docker-compose.yml
index 8d3afab..70c52a7 100644
--- a/templates/docker-compose/docker-compose.yml
+++ b/templates/docker-compose/docker-compose.yml
@@ -8,7 +8,6 @@ services:
       - 9876:9876
     volumes:
       - ./data/namesrv/logs:/home/rocketmq/logs
-      - ./data/namesrv/store:/home/rocketmq/store
     command: sh mqnamesrv
 
   #Service for broker
diff --git a/templates/kubernetes/deployment.yaml 
b/templates/kubernetes/deployment.yaml
index a71e8b1..61824bf 100644
--- a/templates/kubernetes/deployment.yaml
+++ b/templates/kubernetes/deployment.yaml
@@ -31,8 +31,6 @@ spec:
         volumeMounts:
           - mountPath: /home/rocketmq/logs
             name: namesrvoptlogs
-          - mountPath: /home/rocketmq/store
-            name: namesrvoptstore
       volumes:
       - name: brokeroptlogs
         hostPath:
diff --git a/templates/kubernetes/deployment2.yaml 
b/templates/kubernetes/deployment2.yaml
index fa5db99..c351b0e 100644
--- a/templates/kubernetes/deployment2.yaml
+++ b/templates/kubernetes/deployment2.yaml
@@ -24,8 +24,6 @@ spec:
         volumeMounts:
           - mountPath: /home/rocketmq/logs
             name: namesrvlogs
-          - mountPath: /home/rocketmq/store
-            name: namesrvstore
       volumes:
       - name: namesrvlogs
         emptyDir: {}
diff --git a/templates/play-docker-compose.sh b/templates/play-docker-compose.sh
index fa24164..0ed7dc2 100755
--- a/templates/play-docker-compose.sh
+++ b/templates/play-docker-compose.sh
@@ -23,11 +23,20 @@ if [[ -n "$RMQ_CONTAINER" ]]; then
    sleep 5
 fi
 
-if [ ! -d "`pwd`/data" ]; then
-  mkdir -p "data"
-fi
+prepare_dir()
+{
+    dirs=("docker-compose/data/namesrv/logs" "docker-compose/data/broker/logs" 
"docker-compose/data/broker/store" "docker-compose/data1/broker/logs" 
"docker-compose/data1/broker/store")
+
+    for dir in ${dirs[@]}
+    do
+        if [ ! -d "`pwd`/${dir}" ]; then
+            mkdir -p "`pwd`/${dir}"
+            chmod a+rw "`pwd`/${dir}"
+        fi
+    done
+}
 
-chmod a+rw -R docker-compose
+prepare_dir
 
 # Run nameserver and broker
 docker-compose -f ./docker-compose/docker-compose.yml up -d
diff --git a/templates/play-docker-deledger.sh 
b/templates/play-docker-deledger.sh
index 7648361..0df1254 100755
--- a/templates/play-docker-deledger.sh
+++ b/templates/play-docker-deledger.sh
@@ -31,11 +31,20 @@ if [[ -n "$DLEDGER_NET" ]]; then
    sleep 5
 fi
 
-if [ ! -d "`pwd`/data" ]; then
-  mkdir -p "data"
-fi
+prepare_dir()
+{
+    dirs=("data/namesrv/logs" "data/broker0/logs" "data/broker0/store" 
"data/broker1/logs" "data/broker1/store" "data/broker2/logs" 
"data/broker2/store")
+
+    for dir in ${dirs[@]}
+    do
+        if [ ! -d "`pwd`/${dir}" ]; then
+            mkdir -p "`pwd`/${dir}"
+            chmod a+rw "`pwd`/${dir}"
+        fi
+    done
+}
 
-chmod a+rw -R data
+prepare_dir
 
 echo "Starting RocketMQ nodes..."
 
@@ -43,12 +52,12 @@ echo "Starting RocketMQ nodes..."
 docker network create --subnet=172.18.0.0/16 dledger-br
 
 # Start nameserver
-docker run --net dledger-br --ip 172.18.0.11  -d -p 9876:9876 -v 
`pwd`/data/namesrv/logs:/home/rocketmq/logs -v 
`pwd`/data/namesrv/store:/home/rocketmq/store --name rmqnamesrv  
rocketmqinc/rocketmq:ROCKETMQ_VERSION sh mqnamesrv
+docker run --net dledger-br --ip 172.18.0.11  -d -p 9876:9876 -v 
`pwd`/data/namesrv/logs:/home/rocketmq/logs --name rmqnamesrv  
rocketmqinc/rocketmq:ROCKETMQ_VERSION sh mqnamesrv
 
 # Start Brokers
-docker run --net dledger-br --ip 172.18.0.12 -d -p 30911:30911 -p 30909:30909 
-v `pwd`/data/broker0/logs:/home/rocketmq/logs -v 
`pwd`/data/broker0/store:/home/rocketmq/store -v 
`pwd`/data/broker0/conf/dledger:/opt/rocketmq-ROCKETMQ_VERSION/conf/dledger 
--name rmqbroker --link rmqnamesrv:namesrv -e "MAX_POSSIBLE_HEAP=200000000" -e 
"NAMESRV_ADDR=namesrv:9876" rocketmqinc/rocketmq:ROCKETMQ_VERSION sh mqbroker  
-c  ../conf/dledger/broker.conf
-docker run --net dledger-br --ip 172.18.0.13 -d -p 30921:30921 -p 30919:30919 
-v `pwd`/data/broker1/logs:/home/rocketmq/logs -v 
`pwd`/data/broker1/store:/home/rocketmq/store -v 
`pwd`/data/broker1/conf/dledger:/opt/rocketmq-ROCKETMQ_VERSION/conf/dledger 
--name rmqbroker1 --link rmqnamesrv:namesrv -e "MAX_POSSIBLE_HEAP=200000000" -e 
"NAMESRV_ADDR=namesrv:9876" rocketmqinc/rocketmq:ROCKETMQ_VERSION sh mqbroker  
-c  ../conf/dledger/broker.conf
-docker run --net dledger-br --ip 172.18.0.14 -d -p 30931:30931 -p 30929:30929 
-v `pwd`/data/broker2/logs:/home/rocketmq/logs -v 
`pwd`/data/broker2/store:/home/rocketmq/store -v 
`pwd`/data/broker2/conf/dledger:/opt/rocketmq-ROCKETMQ_VERSION/conf/dledger 
--name rmqbroker2 --link rmqnamesrv:namesrv -e "MAX_POSSIBLE_HEAP=200000000" -e 
"NAMESRV_ADDR=namesrv:9876" rocketmqinc/rocketmq:ROCKETMQ_VERSION sh mqbroker  
-c  ../conf/dledger/broker.conf
+docker run --net dledger-br --ip 172.18.0.12 -d -p 30911:30911 -p 30909:30909 
-v `pwd`/data/broker0/logs:/home/rocketmq/logs -v 
`pwd`/data/broker0/store:/home/rocketmq/store -v 
`pwd`/data/broker0/conf/dledger:/opt/rocketmq-ROCKETMQ_VERSION/conf/dledger 
--name rmqbroker --link rmqnamesrv:namesrv -e "NAMESRV_ADDR=namesrv:9876" 
rocketmqinc/rocketmq:ROCKETMQ_VERSION sh mqbroker  -c  
../conf/dledger/broker.conf
+docker run --net dledger-br --ip 172.18.0.13 -d -p 30921:30921 -p 30919:30919 
-v `pwd`/data/broker1/logs:/home/rocketmq/logs -v 
`pwd`/data/broker1/store:/home/rocketmq/store -v 
`pwd`/data/broker1/conf/dledger:/opt/rocketmq-ROCKETMQ_VERSION/conf/dledger 
--name rmqbroker1 --link rmqnamesrv:namesrv -e "NAMESRV_ADDR=namesrv:9876" 
rocketmqinc/rocketmq:ROCKETMQ_VERSION sh mqbroker  -c  
../conf/dledger/broker.conf
+docker run --net dledger-br --ip 172.18.0.14 -d -p 30931:30931 -p 30929:30929 
-v `pwd`/data/broker2/logs:/home/rocketmq/logs -v 
`pwd`/data/broker2/store:/home/rocketmq/store -v 
`pwd`/data/broker2/conf/dledger:/opt/rocketmq-ROCKETMQ_VERSION/conf/dledger 
--name rmqbroker2 --link rmqnamesrv:namesrv -e "NAMESRV_ADDR=namesrv:9876" 
rocketmqinc/rocketmq:ROCKETMQ_VERSION sh mqbroker  -c  
../conf/dledger/broker.conf
 
 # Service unavailable when not ready
 # sleep 20
diff --git a/templates/play-docker-tls.sh b/templates/play-docker-tls.sh
index c8d7ff5..492075b 100755
--- a/templates/play-docker-tls.sh
+++ b/templates/play-docker-tls.sh
@@ -23,16 +23,25 @@ if [[ -n "$RMQ_CONTAINER" ]]; then
    sleep 5
 fi
 
-if [ ! -d "`pwd`/data" ]; then
-  mkdir -p "data"
-fi
+prepare_dir()
+{
+    dirs=("data/namesrv/logs" "data/broker/logs" "data/broker/store")
+
+    for dir in ${dirs[@]}
+    do
+        if [ ! -d "`pwd`/${dir}" ]; then
+            mkdir -p "`pwd`/${dir}"
+            chmod a+rw "`pwd`/${dir}"
+        fi
+    done
+}
 
-chmod a+rw -R data
+prepare_dir
 
 echo "Starting RocketMQ nodes..."
 
 # Start nameserver
-docker run -d -v `pwd`/ssl:/home/rocketmq/ssl  -v 
`pwd`/data/namesrv/logs:/home/rocketmq/logs -v 
`pwd`/data/namesrv/store:/home/rocketmq/store --name rmqnamesrv -e 
"JAVA_OPT=-Dtls.test.mode.enable=false 
-Dtls.config.file=/home/rocketmq/ssl/ssl.properties 
-Dtls.test.mode.enable=false -Dtls.server.need.client.auth=required"  
rocketmqinc/rocketmq:ROCKETMQ_VERSION sh mqnamesrv
+docker run -d -v `pwd`/ssl:/home/rocketmq/ssl  -v 
`pwd`/data/namesrv/logs:/home/rocketmq/logs --name rmqnamesrv -e 
"JAVA_OPT=-Dtls.test.mode.enable=false 
-Dtls.config.file=/home/rocketmq/ssl/ssl.properties 
-Dtls.test.mode.enable=false -Dtls.server.need.client.auth=required"  
rocketmqinc/rocketmq:ROCKETMQ_VERSION sh mqnamesrv
 
 # Start Broker
 docker run -d -v `pwd`/ssl:/home/rocketmq/ssl  -v 
`pwd`/data/broker/logs:/home/rocketmq/logs -v 
`pwd`/data/broker/store:/home/rocketmq/store --name rmqbroker --link 
rmqnamesrv:namesrv -e "NAMESRV_ADDR=namesrv:9876" -e 
"JAVA_OPT=-Dtls.enable=true -Dtls.client.authServer=true 
-Dtls.test.mode.enable=false 
-Dtls.config.file=/home/rocketmq/ssl/ssl.properties 
-Dtls.test.mode.enable=false -Dtls.server.mode=enforcing  
-Dtls.server.need.client.auth=required" rocketmqinc/rocketmq:ROCKETMQ_VERSION  
[...]
diff --git a/templates/play-docker.sh b/templates/play-docker.sh
index b2f87a4..638cef4 100755
--- a/templates/play-docker.sh
+++ b/templates/play-docker.sh
@@ -19,7 +19,7 @@ start_namesrv_broker()
 {
     TAG_SUFFIX=$1
     # Start nameserver
-    docker run -d -v `pwd`/data/namesrv/logs:/home/rocketmq/logs -v 
`pwd`/data/namesrv/store:/home/rocketmq/store --name rmqnamesrv 
rocketmqinc/rocketmq:ROCKETMQ_VERSION${TAG_SUFFIX} sh mqnamesrv
+    docker run -d -v `pwd`/data/namesrv/logs:/home/rocketmq/logs --name 
rmqnamesrv rocketmqinc/rocketmq:ROCKETMQ_VERSION${TAG_SUFFIX} sh mqnamesrv
     # Start Broker
     docker run -d -v `pwd`/data/broker/logs:/home/rocketmq/logs -v 
`pwd`/data/broker/store:/home/rocketmq/store --name rmqbroker --link 
rmqnamesrv:namesrv -e "NAMESRV_ADDR=namesrv:9876" 
rocketmqinc/rocketmq:ROCKETMQ_VERSION${TAG_SUFFIX} sh mqbroker
 }
@@ -41,11 +41,20 @@ if [[ -n "$RMQ_CONTAINER" ]]; then
    sleep 5
 fi
 
-if [ ! -d "`pwd`/data" ]; then
-  mkdir -p "data"
-fi
+prepare_dir()
+{
+    dirs=("data/namesrv/logs" "data/broker/logs" "data/broker/store")
+
+    for dir in ${dirs[@]}
+    do
+        if [ ! -d "`pwd`/${dir}" ]; then
+            mkdir -p "`pwd`/${dir}"
+            chmod a+rw "`pwd`/${dir}"
+        fi
+    done
+}
 
-chmod a+rw -R data
+prepare_dir
 
 echo "Starting RocketMQ nodes..."
 
diff --git a/templates/play-kubernetes.sh b/templates/play-kubernetes.sh
index b6138b8..5a3a539 100755
--- a/templates/play-kubernetes.sh
+++ b/templates/play-kubernetes.sh
@@ -19,7 +19,5 @@ if [ ! -d "`pwd`/data" ]; then
   mkdir -p "data"
 fi
 
-chmod a+rw -R data
-
 # Run nameserver and broker on your Kubernetes cluster
 kubectl apply -f kubernetes/deployment.yaml
diff --git a/templates/scripts/runbroker-customize.sh 
b/templates/scripts/runbroker-customize.sh
deleted file mode 100755
index 7c625cf..0000000
--- a/templates/scripts/runbroker-customize.sh
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/bin/sh
-
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-#===========================================================================================
-# Java Environment Setting
-#===========================================================================================
-error_exit ()
-{
-    echo "ERROR: $1 !!"
-    exit 1
-}
-
-[ ! -e "$JAVA_HOME/bin/java" ] && JAVA_HOME=$HOME/jdk/java
-[ ! -e "$JAVA_HOME/bin/java" ] && JAVA_HOME=/usr/java
-[ ! -e "$JAVA_HOME/bin/java" ] && error_exit "Please set the JAVA_HOME 
variable in your environment, We need java(x64)!"
-
-export JAVA_HOME
-export JAVA="$JAVA_HOME/bin/java"
-export BASE_DIR=$(dirname $0)/..
-export CLASSPATH=.:${BASE_DIR}/conf:${CLASSPATH}
-
-#===========================================================================================
-# JVM Configuration
-#===========================================================================================
-# Get the max heap used by a jvm, which used all the ram available to the 
container.
-if [ -z "$MAX_POSSIBLE_HEAP" ]
-then
-       MAX_POSSIBLE_RAM_STR=$(java -XX:+UnlockExperimentalVMOptions 
-XX:MaxRAMFraction=1 -XshowSettings:vm -version |& awk '/Max\. Heap Size 
\(Estimated\): [0-9KMG]+/{ print $5}')
-       MAX_POSSIBLE_RAM=$MAX_POSSIBLE_RAM_STR
-       CAL_UNIT=${MAX_POSSIBLE_RAM_STR: -1}
-       if [ "$CAL_UNIT" == "G" -o "$CAL_UNIT" == "g" ]; then
-               MAX_POSSIBLE_RAM=$(echo 
${MAX_POSSIBLE_RAM_STR:0:${#MAX_POSSIBLE_RAM_STR}-1} `expr 1 \* 1024 \* 1024 \* 
1024` | awk '{printf "%d",$1*$2}')
-       elif [ "$CAL_UNIT" == "M" -o "$CAL_UNIT" == "m" ]; then
-               MAX_POSSIBLE_RAM=$(echo 
${MAX_POSSIBLE_RAM_STR:0:${#MAX_POSSIBLE_RAM_STR}-1} `expr 1 \* 1024 \* 1024` | 
awk '{printf "%d",$1*$2}')
-       elif [ "$CAL_UNIT" == "K" -o "$CAL_UNIT" == "k" ]; then
-               MAX_POSSIBLE_RAM=$(echo 
${MAX_POSSIBLE_RAM_STR:0:${#MAX_POSSIBLE_RAM_STR}-1} `expr 1 \* 1024` | awk 
'{printf "%d",$1*$2}')
-       fi
-       MAX_POSSIBLE_HEAP=$[MAX_POSSIBLE_RAM/4]
-fi
-
-# Dynamically calculate parameters, for reference.
-Xms=$MAX_POSSIBLE_HEAP
-Xmx=$MAX_POSSIBLE_HEAP
-Xmn=$[MAX_POSSIBLE_HEAP/2]
-MaxDirectMemorySize=$MAX_POSSIBLE_HEAP
-# Set for `JAVA_OPT`.
-JAVA_OPT="${JAVA_OPT} -server -Xms${Xms} -Xmx${Xmx} -Xmn${Xmn}"
-JAVA_OPT="${JAVA_OPT} -XX:+UseG1GC -XX:G1HeapRegionSize=16m 
-XX:G1ReservePercent=25 -XX:InitiatingHeapOccupancyPercent=30 
-XX:SoftRefLRUPolicyMSPerMB=0 -XX:SurvivorRatio=8"
-JAVA_OPT="${JAVA_OPT} -verbose:gc -Xloggc:/dev/shm/mq_gc_%p.log 
-XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationStoppedTime 
-XX:+PrintAdaptiveSizePolicy"
-JAVA_OPT="${JAVA_OPT} -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 
-XX:GCLogFileSize=30m"
-JAVA_OPT="${JAVA_OPT} -XX:-OmitStackTraceInFastThrow"
-JAVA_OPT="${JAVA_OPT} -XX:+AlwaysPreTouch"
-JAVA_OPT="${JAVA_OPT} -XX:MaxDirectMemorySize=${MaxDirectMemorySize}"
-JAVA_OPT="${JAVA_OPT} -XX:-UseLargePages -XX:-UseBiasedLocking"
-JAVA_OPT="${JAVA_OPT} -Djava.ext.dirs=${JAVA_HOME}/jre/lib/ext:${BASE_DIR}/lib"
-#JAVA_OPT="${JAVA_OPT} -Xdebug 
-Xrunjdwp:transport=dt_socket,address=9555,server=y,suspend=n"
-JAVA_OPT="${JAVA_OPT} ${JAVA_OPT_EXT}"
-JAVA_OPT="${JAVA_OPT} -cp ${CLASSPATH}"
-
-numactl --interleave=all pwd > /dev/null 2>&1
-if [ $? -eq 0 ]
-then
-       if [ -z "$RMQ_NUMA_NODE" ] ; then
-               numactl --interleave=all $JAVA ${JAVA_OPT} $@
-       else
-               numactl --cpunodebind=$RMQ_NUMA_NODE --membind=$RMQ_NUMA_NODE 
$JAVA ${JAVA_OPT} $@
-       fi
-else
-       $JAVA ${JAVA_OPT} $@
-fi
diff --git a/templates/scripts/runserver-customize.sh 
b/templates/scripts/runserver-customize.sh
deleted file mode 100755
index 4cefb00..0000000
--- a/templates/scripts/runserver-customize.sh
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/bin/sh
-
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-#===========================================================================================
-# Java Environment Setting
-#===========================================================================================
-error_exit ()
-{
-    echo "ERROR: $1 !!"
-    exit 1
-}
-
-[ ! -e "$JAVA_HOME/bin/java" ] && JAVA_HOME=$HOME/jdk/java
-[ ! -e "$JAVA_HOME/bin/java" ] && JAVA_HOME=/usr/java
-[ ! -e "$JAVA_HOME/bin/java" ] && error_exit "Please set the JAVA_HOME 
variable in your environment, We need java(x64)!"
-
-export JAVA_HOME
-export JAVA="$JAVA_HOME/bin/java"
-export BASE_DIR=$(dirname $0)/..
-export CLASSPATH=.:${BASE_DIR}/conf:${CLASSPATH}
-
-#===========================================================================================
-# JVM Configuration
-#===========================================================================================
-# Get the max heap used by a jvm, which used all the ram available to the 
container.
-if [ -z "$MAX_POSSIBLE_HEAP" ]
-then
-       MAX_POSSIBLE_RAM_STR=$(java -XX:+UnlockExperimentalVMOptions 
-XX:MaxRAMFraction=1 -XshowSettings:vm -version |& awk '/Max\. Heap Size 
\(Estimated\): [0-9KMG]+/{ print $5}')
-       MAX_POSSIBLE_RAM=$MAX_POSSIBLE_RAM_STR
-       CAL_UNIT=${MAX_POSSIBLE_RAM_STR: -1}
-       if [ "$CAL_UNIT" == "G" -o "$CAL_UNIT" == "g" ]; then
-               MAX_POSSIBLE_RAM=$(echo 
${MAX_POSSIBLE_RAM_STR:0:${#MAX_POSSIBLE_RAM_STR}-1} `expr 1 \* 1024 \* 1024 \* 
1024` | awk '{printf "%d",$1*$2}')
-       elif [ "$CAL_UNIT" == "M" -o "$CAL_UNIT" == "m" ]; then
-               MAX_POSSIBLE_RAM=$(echo 
${MAX_POSSIBLE_RAM_STR:0:${#MAX_POSSIBLE_RAM_STR}-1} `expr 1 \* 1024 \* 1024` | 
awk '{printf "%d",$1*$2}')
-       elif [ "$CAL_UNIT" == "K" -o "$CAL_UNIT" == "k" ]; then
-               MAX_POSSIBLE_RAM=$(echo 
${MAX_POSSIBLE_RAM_STR:0:${#MAX_POSSIBLE_RAM_STR}-1} `expr 1 \* 1024` | awk 
'{printf "%d",$1*$2}')
-       fi
-       MAX_POSSIBLE_HEAP=$[MAX_POSSIBLE_RAM/4]
-fi
-
-# Dynamically calculate parameters, for reference.
-Xms=$MAX_POSSIBLE_HEAP
-Xmx=$MAX_POSSIBLE_HEAP
-Xmn=$[MAX_POSSIBLE_HEAP/2]
-# Set for `JAVA_OPT`.
-JAVA_OPT="${JAVA_OPT} -server -Xms${Xms} -Xmx${Xmx} -Xmn${Xmn}"
-JAVA_OPT="${JAVA_OPT} -XX:+UseConcMarkSweepGC 
-XX:+UseCMSCompactAtFullCollection -XX:CMSInitiatingOccupancyFraction=70 
-XX:+CMSParallelRemarkEnabled -XX:SoftRefLRUPolicyMSPerMB=0 
-XX:+CMSClassUnloadingEnabled -XX:SurvivorRatio=8  -XX:-UseParNewGC"
-JAVA_OPT="${JAVA_OPT} -verbose:gc -Xloggc:/dev/shm/rmq_srv_gc.log 
-XX:+PrintGCDetails"
-JAVA_OPT="${JAVA_OPT} -XX:-OmitStackTraceInFastThrow"
-JAVA_OPT="${JAVA_OPT}  -XX:-UseLargePages"
-JAVA_OPT="${JAVA_OPT} -Djava.ext.dirs=${JAVA_HOME}/jre/lib/ext:${BASE_DIR}/lib"
-#JAVA_OPT="${JAVA_OPT} -Xdebug 
-Xrunjdwp:transport=dt_socket,address=9555,server=y,suspend=n"
-JAVA_OPT="${JAVA_OPT} ${JAVA_OPT_EXT}"
-JAVA_OPT="${JAVA_OPT} -cp ${CLASSPATH}"
-
-$JAVA ${JAVA_OPT} $@

Reply via email to