Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lijianghuflute
canal
提交
5a99de1f
canal
项目概览
lijianghuflute
/
canal
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
canal
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5a99de1f
编写于
12月 07, 2018
作者:
T
tankilo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
switch file format from DOS to UNIX
上级
ce956c98
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
0 addition
and
174 deletion
+0
-174
deployer/src/main/bin/restart.sh
deployer/src/main/bin/restart.sh
+0
-5
deployer/src/main/bin/startup.sh
deployer/src/main/bin/startup.sh
+0
-104
deployer/src/main/bin/stop.sh
deployer/src/main/bin/stop.sh
+0
-65
未找到文件。
deployer/src/main/bin/restart.sh
已删除
100644 → 0
浏览文件 @
ce956c98
#!/bin/bash
sh stop.sh
sh startup.sh
deployer/src/main/bin/startup.sh
已删除
100644 → 0
浏览文件 @
ce956c98
#!/bin/bash
current_path
=
`
pwd
`
case
"
`
uname
`
"
in
Linux
)
bin_abs_path
=
$(
readlink
-f
$(
dirname
$0
))
;;
*
)
bin_abs_path
=
`
cd
$(
dirname
$0
)
;
pwd
`
;;
esac
base
=
${
bin_abs_path
}
/..
canal_conf
=
$base
/conf/canal.properties
logback_configurationFile
=
$base
/conf/logback.xml
export
LANG
=
en_US.UTF-8
export
BASE
=
$base
if
[
-f
$base
/bin/canal.pid
]
;
then
echo
"found canal.pid , Please run stop.sh first ,then startup.sh"
2>&2
exit
1
fi
if
[
!
-d
$base
/logs/canal
]
;
then
mkdir
-p
$base
/logs/canal
fi
## set java path
if
[
-z
"
$JAVA
"
]
;
then
JAVA
=
$(
which java
)
fi
ALIBABA_JAVA
=
"/usr/alibaba/java/bin/java"
TAOBAO_JAVA
=
"/opt/taobao/java/bin/java"
if
[
-z
"
$JAVA
"
]
;
then
if
[
-f
$ALIBABA_JAVA
]
;
then
JAVA
=
$ALIBABA_JAVA
elif
[
-f
$TAOBAO_JAVA
]
;
then
JAVA
=
$TAOBAO_JAVA
else
echo
"Cannot find a Java JDK. Please set either set JAVA or put java (>=1.5) in your PATH."
2>&2
exit
1
fi
fi
case
"$#"
in
0
)
;;
1
)
var
=
$*
if
[
-f
$var
]
;
then
canal_conf
=
$var
else
echo
"THE PARAMETER IS NOT CORRECT.PLEASE CHECK AGAIN."
exit
fi
;;
2
)
var
=
$1
if
[
-f
$var
]
;
then
canal_conf
=
$var
else
if
[
"
$1
"
=
"debug"
]
;
then
DEBUG_PORT
=
$2
DEBUG_SUSPEND
=
"n"
JAVA_DEBUG_OPT
=
"-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=
$DEBUG_PORT
,server=y,suspend=
$DEBUG_SUSPEND
"
fi
fi
;;
*
)
echo
"THE PARAMETERS MUST BE TWO OR LESS.PLEASE CHECK AGAIN."
exit
;;
esac
str
=
`
file
-L
$JAVA
|
grep
64-bit
`
if
[
-n
"
$str
"
]
;
then
JAVA_OPTS
=
"-server -Xms2048m -Xmx3072m -Xmn1024m -XX:SurvivorRatio=2 -XX:PermSize=96m -XX:MaxPermSize=256m -Xss256k -XX:-UseAdaptiveSizePolicy -XX:MaxTenuringThreshold=15 -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError"
else
JAVA_OPTS
=
"-server -Xms1024m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:MaxPermSize=128m "
fi
JAVA_OPTS
=
"
$JAVA_OPTS
-Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dfile.encoding=UTF-8"
CANAL_OPTS
=
"-DappName=otter-canal -Dlogback.configurationFile=
$logback_configurationFile
-Dcanal.conf=
$canal_conf
"
if
[
-e
$canal_conf
-a
-e
$logback_configurationFile
]
then
for
i
in
$base
/lib/
*
;
do
CLASSPATH
=
$i
:
"
$CLASSPATH
"
;
done
CLASSPATH
=
"
$base
/conf:
$CLASSPATH
"
;
echo
"cd to
$bin_abs_path
for workaround relative path"
cd
$bin_abs_path
echo
LOG CONFIGURATION :
$logback_configurationFile
echo
canal conf :
$canal_conf
echo
CLASSPATH :
$CLASSPATH
$JAVA
$JAVA_OPTS
$JAVA_DEBUG_OPT
$CANAL_OPTS
-classpath
.:
$CLASSPATH
com.alibaba.otter.canal.deployer.CanalLauncher 1>>
$base
/logs/canal/canal.log 2>&1 &
echo
$!
>
$base
/bin/canal.pid
echo
"cd to
$current_path
for continue"
cd
$current_path
else
echo
"canal conf("
$canal_conf
") OR log configration file(
$logback_configurationFile
) is not exist,please create then first!"
fi
deployer/src/main/bin/stop.sh
已删除
100644 → 0
浏览文件 @
ce956c98
#!/bin/bash
cygwin
=
false
;
linux
=
false
;
case
"
`
uname
`
"
in
CYGWIN
*
)
cygwin
=
true
;;
Linux
*
)
linux
=
true
;;
esac
get_pid
()
{
STR
=
$1
PID
=
$2
if
$cygwin
;
then
JAVA_CMD
=
"
$JAVA_HOME
\b
in
\j
ava"
JAVA_CMD
=
`
cygpath
--path
--unix
$JAVA_CMD
`
JAVA_PID
=
`
ps |grep
$JAVA_CMD
|awk
'{print $1}'
`
else
if
$linux
;
then
if
[
!
-z
"
$PID
"
]
;
then
JAVA_PID
=
`
ps
-C
java
-f
--width
1000|grep
"
$STR
"
|grep
"
$PID
"
|grep
-v
grep
|awk
'{print $2}'
`
else
JAVA_PID
=
`
ps
-C
java
-f
--width
1000|grep
"
$STR
"
|grep
-v
grep
|awk
'{print $2}'
`
fi
else
if
[
!
-z
"
$PID
"
]
;
then
JAVA_PID
=
`
ps aux |grep
"
$STR
"
|grep
"
$PID
"
|grep
-v
grep
|awk
'{print $2}'
`
else
JAVA_PID
=
`
ps aux |grep
"
$STR
"
|grep
-v
grep
|awk
'{print $2}'
`
fi
fi
fi
echo
$JAVA_PID
;
}
base
=
`
dirname
$0
`
/..
pidfile
=
$base
/bin/canal.pid
if
[
!
-f
"
$pidfile
"
]
;
then
echo
"canal is not running. exists"
exit
fi
pid
=
`
cat
$pidfile
`
if
[
"
$pid
"
==
""
]
;
then
pid
=
`
get_pid
"appName=otter-canal"
`
fi
echo
-e
"
`
hostname
`
: stopping canal
$pid
... "
kill
$pid
LOOPS
=
0
while
(
true
)
;
do
gpid
=
`
get_pid
"appName=otter-canal"
"
$pid
"
`
if
[
"
$gpid
"
==
""
]
;
then
echo
"Oook! cost:
$LOOPS
"
`
rm
$pidfile
`
break
;
fi
let
LOOPS
=
LOOPS+1
sleep
1
done
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录