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
26c405ce
Commit
26c405ce
authored
Oct 01, 2020
by
白秀江
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
已删除conf-service/dump.sh
parent
b0c49a2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
92 deletions
+0
-92
dump.sh
conf-service/dump.sh
+0
-92
No files found.
conf-service/dump.sh
deleted
100755 → 0
View file @
b0c49a2e
#!/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'
`
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
[
-z
"
$PIDS
"
]
;
then
echo
"ERROR: The
$SERVER_NAME
does not started!"
exit
1
fi
LOGS_DIR
=
""
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
DUMP_DIR
=
$LOGS_DIR
/dump
if
[
!
-d
$DUMP_DIR
]
;
then
mkdir
$DUMP_DIR
fi
DUMP_DATE
=
`
date
+%Y%m%d%H%M%S
`
DATE_DIR
=
$DUMP_DIR
/
$DUMP_DATE
if
[
!
-d
$DATE_DIR
]
;
then
mkdir
$DATE_DIR
fi
echo
-e
"Dumping the
$SERVER_NAME
...
\c
"
for
PID
in
$PIDS
;
do
jstack
$PID
>
$DATE_DIR
/jstack-
$PID
.dump 2>&1
echo
-e
".
\c
"
jinfo
$PID
>
$DATE_DIR
/jinfo-
$PID
.dump 2>&1
echo
-e
".
\c
"
jstat
-gcutil
$PID
>
$DATE_DIR
/jstat-gcutil-
$PID
.dump 2>&1
echo
-e
".
\c
"
jstat
-gccapacity
$PID
>
$DATE_DIR
/jstat-gccapacity-
$PID
.dump 2>&1
echo
-e
".
\c
"
jmap
$PID
>
$DATE_DIR
/jmap-
$PID
.dump 2>&1
echo
-e
".
\c
"
jmap
-heap
$PID
>
$DATE_DIR
/jmap-heap-
$PID
.dump 2>&1
echo
-e
".
\c
"
jmap
-histo
$PID
>
$DATE_DIR
/jmap-histo-
$PID
.dump 2>&1
echo
-e
".
\c
"
if
[
-r
/usr/sbin/lsof
]
;
then
/usr/sbin/lsof
-p
$PID
>
$DATE_DIR
/lsof-
$PID
.dump
echo
-e
".
\c
"
fi
done
if
[
-r
/bin/netstat
]
;
then
/bin/netstat
-an
>
$DATE_DIR
/netstat.dump 2>&1
echo
-e
".
\c
"
fi
if
[
-r
/usr/bin/iostat
]
;
then
/usr/bin/iostat
>
$DATE_DIR
/iostat.dump 2>&1
echo
-e
".
\c
"
fi
if
[
-r
/usr/bin/mpstat
]
;
then
/usr/bin/mpstat
>
$DATE_DIR
/mpstat.dump 2>&1
echo
-e
".
\c
"
fi
if
[
-r
/usr/bin/vmstat
]
;
then
/usr/bin/vmstat
>
$DATE_DIR
/vmstat.dump 2>&1
echo
-e
".
\c
"
fi
if
[
-r
/usr/bin/free
]
;
then
/usr/bin/free
-t
>
$DATE_DIR
/free.dump 2>&1
echo
-e
".
\c
"
fi
if
[
-r
/usr/bin/sar
]
;
then
/usr/bin/sar
>
$DATE_DIR
/sar.dump 2>&1
echo
-e
".
\c
"
fi
if
[
-r
/usr/bin/uptime
]
;
then
/usr/bin/uptime
>
$DATE_DIR
/uptime.dump 2>&1
echo
-e
".
\c
"
fi
echo
"OK!"
echo
"DUMP:
$DATE_DIR
"
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