Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
野花太放肆
oceanbase
提交
73154b3a
O
oceanbase
项目概览
野花太放肆
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
73154b3a
编写于
3月 14, 2023
作者:
O
obdev
提交者:
ob-robot
3月 14, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add: mysqltest description 2
上级
8c3439db
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
64 addition
and
30 deletion
+64
-30
tools/deploy/obd.sh
tools/deploy/obd.sh
+64
-30
未找到文件。
tools/deploy/obd.sh
浏览文件 @
73154b3a
...
...
@@ -27,11 +27,19 @@ function variables_parpare {
HOST
=
$(
hostname
-i
)
DATA_PATH
=
"/data/
$(
whoami
)
"
IPADDRESS
=
"127.0.0.1"
export
IS_CE
=
1
COMPONENT
=
"oceanbase-ce"
DEP_PATH
=
$BASE_DIR
/deps/3rd
if
grep
'dep_create.sh'
$BASE_DIR
/build.sh 2>&1
>
/dev/null
then
DEP_PATH
=
$BASE_DIR
/deps/3rd
else
DEP_PATH
=
$BASE_DIR
/rpm/.dep_create/var
fi
OBCLIENT_BIN
=
$DEP_PATH
/u01/obclient/bin/obclient
MYSQLTEST_BIN
=
$DEP_PATH
/u01/obclient/bin/mysqltest
DEFAULT_DEPLOY_NAME_FILE
=
$OBD_HOME
/.obd/.default_deploy
}
...
...
@@ -53,12 +61,17 @@ function mirror_create {
fi
# observer mirror create
obs_version
=
$(
$OBSERVER_BIN
-V
2>&1 |
grep
-E
"observer
\(
OceanBase(
CE)? ([.0-9]+)
\)
"
|
grep
-Eo
'([.0-9]+)'
)
obs_version
=
$(
$OBSERVER_BIN
-V
2>&1 |
grep
-E
"observer
\(
OceanBase(
[
\_
]
CE)? ([.0-9]+)
\)
"
|
grep
-Eo
'([.0-9]+)'
)
if
[[
"
$obs_version
"
==
""
]]
then
echo
"
$OBSERVER_BIN
not found"
return
1
fi
if
[
"x
$IS_CE
"
==
"x"
]
then
export
IS_CE
=
"0"
[[
$(
$OBSERVER_BIN
-V
2>&1 |
grep
-E
'OceanBase[_ ]CE'
)
]]
&&
COMPONENT
=
"oceanbase-ce"
&&
export
IS_CE
=
"1"
fi
[[
-f
"
$BASE_DIR
/tools/deploy/obd/.observer_obd_plugin_version"
]]
&&
obs_version
=
$(
cat
$BASE_DIR
/tools/deploy/obd/.observer_obd_plugin_version
)
obs_mirror_info
=
$(
obd_exec mirror create
-n
$COMPONENT
-p
"
$DEPLOY_PATH
"
-V
"
$obs_version
"
-t
$tag
-f
)
&&
success
=
1
if
[[
"
$success
"
!=
"1"
]]
...
...
@@ -264,7 +277,6 @@ function get_obproxy {
}
function
deploy_cluster
{
[[
"
$YAML_CONF
"
==
""
]]
||
yaml_config_args
=
"-c
$YAML_CONF
"
get_deploy_name
if
[[
"
$YAML_CONF
"
!=
""
]]
then
...
...
@@ -286,7 +298,18 @@ function deploy_cluster {
else
obd cluster destroy
"
$deploy_name
"
-f
fi
obd cluster deploy
"
$deploy_name
"
$yaml_config_args
-C
||
exit
1
if
[
"x
$IS_CE
"
==
"x"
]
;
then
[[
"
$YAML_CONF
"
==
""
]]
||
yaml_config_args
=
"-c
$YAML_CONF
"
else
yaml_config_args
=
""
if
[
$IS_CE
==
'0'
]
;
then
sed
's/oceanbase-ce\(:\?\)$/oceanbase\1/g'
$config_yaml
| obd cluster edit-config
"
$deploy_name
"
fi
if
[
$IS_CE
==
'1'
]
;
then
sed
's/oceanbase\(:\?\)$/oceanbase-ce\1/g'
$config_yaml
| obd cluster edit-config
"
$deploy_name
"
fi
fi
obd cluster deploy
"
$deploy_name
"
-C
$yaml_config_args
||
exit
1
if
!
obd cluster start
"
$deploy_name
"
-f
;
then
while
[[
"
$NO_CONFIRM
"
!=
"1"
&&
"
$(
grep
'config_status: NEED_REDEPLOY'
$OBD_CLUSTER_PATH
/
$deploy_name
/.data
)
"
!=
""
]]
...
...
@@ -308,11 +331,22 @@ function deploy_cluster {
esac
done
fi
init_sql
get_init_sql
if
[[
"
$NEED_FAST_REBOOT
"
==
"1"
]]
then
obd
test
mysqltest
"
$deploy_name
"
$INIT_FLIES
--init-only
$CLIENT_BIN_ARGS
--fast-reboot
else
obd
test
mysqltest
"
$deploy_name
"
$INIT_FLIES
--init-only
$CLIENT_BIN_ARGS
fi
}
function
init_sql
{
obd
test
mysqltest
"
$deploy_name
"
"
$INIT_FLIES
"
--init-only
$CLIENT_BIN_ARGS
function
get_init_sql
{
[[
"
$INIT_FLIES
"
!=
""
]]
&&
return
if
[[
"
$MINI
"
==
"1"
&&
-f
$BASE_DIR
/tools/deploy/init.sql
]]
then
INIT_FLIES
=
"--init-sql-files=init.sql,init_user.sql|root@mysql|test"
[
-f
init_user_oracle.sql
]
&&
INIT_FLIES
=
"
${
INIT_FLIES
}
,init_user_oracle.sql|SYS@oracle|SYS"
fi
}
function
start_cluster
{
...
...
@@ -377,8 +411,9 @@ function mysqltest {
if
[[
"
$NEED_REBOOT
"
==
"1"
||
"
$YAML_CONF
"
!=
""
]]
then
mirror_create
||
return
1
deploy_cluster
||
return
2
deploy_cluster
fi
get_init_sql
obd
test
mysqltest
"
$deploy_name
"
$CLIENT_BIN_ARGS
$extra_args
$INIT_FLIES
}
...
...
@@ -453,6 +488,11 @@ function tpcds {
obd
test
tpcds
$deploy_name
$OBCLIENT_BIN_ARGS
$extra_args
}
function
graph
{
get_deploy_name
obd tool graph
$deploy_name
$extra_args
}
function
help_info
{
echo
"""
...
...
@@ -486,6 +526,7 @@ sql [-n DEPLOY_NAME] Connect to target server by root@sys, u
sys [-n DEPLOY_NAME] Connect to target server by root@sys, use '--help' for more details.
mysql [-n DEPLOY_NAME] Connect to target server by root@mysql, use '--help' for more details.
oracle [-n DEPLOY_NAME] Connect to target server by SYS@oracle, use '--help' for more details.
graph [-n DEPLOY_NAME]
Options:
-V, --version Show version of obd.
...
...
@@ -515,42 +556,32 @@ function main() {
case
"
$1
"
in
-v
)
VERBOSE_FLAG
=
'-v'
;
set
-x
;
shift
;;
--with-local-obproxy
)
WITH_LOCAL_PROXY
=
"1"
;
SKIP_COPY
=
"1"
;
shift
;;
-c
|
--config
)
if
[[
"
$commond
"
==
"deploy"
||
"
$commond
"
==
"redeploy"
||
"
$commond
"
==
"mysqltest"
]]
then
YAML_CONF
=
"
$2
"
shift
2
else
extra_args
=
"
$extra_args
$1
"
shift
fi
;;
-c
|
--config
)
YAML_CONF
=
"
$2
"
;
shift
2
;;
-n
|
--deploy-name
)
DEPLOY_NAME
=
"
$2
"
;
shift
2
;;
-p
|
--data-path
)
if
[[
"
$commond
"
==
"prepare"
]]
then
DATA_PATH
=
"
$2
"
;
shift
2
else
extra_args
=
"
$extra_args
$1
"
shift
fi
;;
-p
|
--data-path
)
DATA_PATH
=
"
$2
"
;
shift
2
;;
-N
)
NO_CONFIRM
=
"1"
;
shift
;;
--ip
)
IPADDRESS
=
"
$2
"
;
shift
2
;;
#
--disable-reboot ) DISABLE_REBOOT="1"; extra_args="$extra_args $1"; shift ;;
--disable-reboot
)
DISABLE_REBOOT
=
"1"
;
extra_args
=
"
$extra_args
$1
"
;
shift
;;
--reboot
)
NEED_REBOOT
=
"1"
;
shift
;;
--fast-reboot
)
NEED_FAST_REBOOT
=
"1"
;
extra_args
=
"
$extra_args
$1
"
;
shift
;;
--cp
)
EXEC_CP
=
"1"
;
shift
;;
--skip-copy
)
SKIP_COPY
=
"1"
;
shift
;;
--mini
)
MINI
=
"1"
;
shift
;;
--port
)
export
port_gen
=
"
$2
"
;
extra_args
=
"
$extra_args
$1
"
;
shift
;;
--
)
shift
;;
""
)
break
;;
*
)
extra_args
=
"
$extra_args
$1
"
;
[[
"
$1
"
==
"--help"
||
"
$1
"
==
"-h"
]]
&&
HELP
=
"1"
;
shift
;;
esac
done
if
[[
"
$MINI
"
==
"1"
&&
"
$DISABLE_REBOOT
"
!=
"1"
]]
then
NEED_REBOOT
=
"1"
fi
export
OBD_FORCE_UPDATE_PLUGINS
=
1
if
[[
!
-f
$OBD_HOME
/.obd/.obd_environ
||
"
$(
grep
'"OBD_DEV_MODE": "1"'
$OBD_HOME
/.obd/.obd_environ
)
"
==
""
]]
then
obd devmode
enable
||
(
echo
"Exec obd cmd failed. If your branch is based on 3.1_opensource_release, please go to the deps/3rd directory and execute 'bash dep_create.sh all' to install obd."
&&
exit
1
)
obd
env set
OBD_LOCK_MODE 1
fi
if
[[
"
$(
grep
'"OBD_DEPLOY_BASE_DIR":'
$DEPLOY_PATH
/.obd/.obd_environ
)
"
==
""
]]
then
...
...
@@ -647,6 +678,9 @@ function main() {
tpcds
)
tpcds
;;
graph
)
graph
;;
*
)
help_info
;;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录