Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
deploy-script
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
script
deploy-script
Commits
dd87f1e3
Commit
dd87f1e3
authored
Oct 01, 2020
by
白秀江
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新/dubbo-core/start.sh
parent
af15ade2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
89 additions
and
0 deletions
+89
-0
start.sh
dubbo-core/start.sh
+89
-0
No files found.
dubbo-core/start.sh
0 → 100644
View file @
dd87f1e3
#!/bin/bash
cd
`
dirname
$0
`
BIN_DIR
=
`
pwd
`
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_PORT
=
`
sed
'/dubbo.protocol.port/!d;s/.*=//'
conf/dubbo.properties |
tr
-d
'\r'
`
LOGS_FILE
=
`
sed
'/dubbo.log4j.file/!d;s/.*=//'
conf/dubbo.properties |
tr
-d
'\r'
`
if
[
-z
"
$SERVER_NAME
"
]
;
then
SERVER_NAME
=
`
hostname
`
fi
PIDS
=
`
ps
-f
|
grep
java |
grep
"
$CONF_DIR
"
|awk
'{print $2}'
`
if
[
-n
"
$PIDS
"
]
;
then
echo
"ERROR: The
$SERVER_NAME
already started!"
echo
"PID:
$PIDS
"
exit
1
fi
if
[
-n
"
$SERVER_PORT
"
]
;
then
SERVER_PORT_COUNT
=
`
netstat
-tln
|
grep
$SERVER_PORT
|
wc
-l
`
if
[
$SERVER_PORT_COUNT
-gt
0
]
;
then
echo
"ERROR: The
$SERVER_NAME
port
$SERVER_PORT
already used!"
exit
1
fi
fi
LOGS_DIR
=
"/data/dubbo/"
if
[
-n
"
$LOGS_FILE
"
]
;
then
LOGS_DIR
=
`
dirname
$LOGS_FILE
`
else
LOGS_DIR
=
$DEPLOY_DIR
/logs
fi
if
[
!
-d
$LOGS_DIR
]
;
then
mkdir
$LOGS_DIR
fi
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=" -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 "
fi
JAVA_JMX_OPTS
=
""
if
[
"
$1
"
=
"jmx"
]
;
then
JAVA_JMX_OPTS
=
" -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false "
fi
JAVA_MEM_OPTS
=
""
BITS
=
`
java
-version
2>&1 |
grep
-i
64-bit
`
if
[
-n
"
$BITS
"
]
;
then
#JAVA_MEM_OPTS="-Ddubbo.registry.file=dubbo-registry-Order-0.cache -server -Xms3550m -Xmx3550m -Xmn2048m -XX:PermSize=128m -Xss2000k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 "
JAVA_MEM_OPTS
=
"-Ddubbo.registry.file=dubbo-registry-Order-0.cache -server -Xms4096m -Xmx4096m -Xmn2048m -XX:PermSize=384m -Xss2000k -XX:SurvivorRatio=4 -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:ParallelGCThreads=4 -XX:-UseAdaptiveSizePolicy -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=
${
LOGS_DIR
}
/HeapDumpOnOutOfMemoryError.log"
else
JAVA_MEM_OPTS
=
" -server -Xms512m -Xmx512m -XX:PermSize=128m -XX:SurvivorRatio=2 -XX:+UseParallelGC "
fi
echo
-e
"Starting the
$SERVER_NAME
...
\c
"
nohup
java
$JAVA_OPTS
$JAVA_MEM_OPTS
$JAVA_DEBUG_OPTS
$JAVA_JMX_OPTS
-classpath
$CONF_DIR
:
$LIB_JARS
com.alibaba.dubbo.container.Main
>
$STDOUT_FILE
2>&1 &
COUNT
=
0
while
[
$COUNT
-lt
1
]
;
do
echo
-e
".
\c
"
sleep
1
if
[
-n
"
$SERVER_PORT
"
]
;
then
if
[
"
$SERVER_PROTOCOL
"
==
"dubbo1"
]
;
then
COUNT
=
`
echo
status | nc
-i
1 127.0.0.1
$SERVER_PORT
|
grep
-c
OK
`
else
COUNT
=
`
netstat
-lnp
|
grep
$SERVER_PORT
|
wc
-l
`
fi
else
COUNT
=
`
ps
-f
|
grep
java |
grep
"
$DEPLOY_DIR
"
|
awk
'{print $2}'
|
wc
-l
`
fi
if
[
$COUNT
-gt
0
]
;
then
break
fi
done
echo
"OK!"
PIDS
=
`
ps
-f
|
grep
java |
grep
"
$DEPLOY_DIR
"
|
awk
'{print $2}'
`
echo
"PID:
$PIDS
"
echo
"STDOUT:
$STDOUT_FILE
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment