Skip to content

Commit 8cac82e

Browse files
author
雪染
committed
Merge branch 'merge_3.1.0_release' into 'master'
3.1.0 release See merge request oceanbase/ob-deploy!274
2 parents ce3d97a + b2342bb commit 8cac82e

File tree

787 files changed

+9604
-26533
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

787 files changed

+9604
-26533
lines changed

LICENSE

Lines changed: 202 additions & 674 deletions
Large diffs are not rendered by default.

README-CN.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
11
# OceanBase Deployer
22

33
<!--
4+
# coding: utf-8
5+
# Copyright (c) 2025 OceanBase.
46
#
5-
# OceanBase Deploy.
6-
# Copyright (C) 2021 OceanBase
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
710
#
8-
# This file is part of OceanBase Deploy.
9-
#
10-
# OceanBase Deploy is free software: you can redistribute it and/or modify
11-
# it under the terms of the GNU General Public License as published by
12-
# the Free Software Foundation, either version 3 of the License, or
13-
# (at your option) any later version.
14-
#
15-
# OceanBase Deploy is distributed in the hope that it will be useful,
16-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
17-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18-
# GNU General Public License for more details.
19-
#
20-
# You should have received a copy of the GNU General Public License
21-
# along with OceanBase Deploy. If not, see <https://www.gnu.org/licenses/>.
11+
# http://www.apache.org/licenses/LICENSE-2.0
2212
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
2318
-->
2419

2520
<!-- TODO: some badges here -->

README.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
11
# OceanBase Deployer
22

33
<!--
4+
# coding: utf-8
5+
# Copyright (c) 2025 OceanBase.
46
#
5-
# OceanBase Deploy.
6-
# Copyright (C) 2021 OceanBase
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
710
#
8-
# This file is part of OceanBase Deploy.
9-
#
10-
# OceanBase Deploy is free software: you can redistribute it and/or modify
11-
# it under the terms of the GNU General Public License as published by
12-
# the Free Software Foundation, either version 3 of the License, or
13-
# (at your option) any later version.
14-
#
15-
# OceanBase Deploy is distributed in the hope that it will be useful,
16-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
17-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18-
# GNU General Public License for more details.
19-
#
20-
# You should have received a copy of the GNU General Public License
21-
# along with OceanBase Deploy. If not, see <https://www.gnu.org/licenses/>.
11+
# http://www.apache.org/licenses/LICENSE-2.0
2212
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
2318
-->
2419

2520
<!-- TODO: some badges here -->

_arch.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
# coding: utf-8
2+
# Copyright (c) 2025 OceanBase.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
215
import os
316
import ctypes
417
import struct

_cmd.py

Lines changed: 111 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
11

22
# coding: utf-8
3-
# OceanBase Deploy.
4-
# Copyright (C) 2021 OceanBase
3+
# Copyright (c) 2025 OceanBase.
54
#
6-
# This file is part of OceanBase Deploy.
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
78
#
8-
# OceanBase Deploy is free software: you can redistribute it and/or modify
9-
# it under the terms of the GNU General Public License as published by
10-
# the Free Software Foundation, either version 3 of the License, or
11-
# (at your option) any later version.
9+
# http://www.apache.org/licenses/LICENSE-2.0
1210
#
13-
# OceanBase Deploy is distributed in the hope that it will be useful,
14-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16-
# GNU General Public License for more details.
17-
#
18-
# You should have received a copy of the GNU General Public License
19-
# along with OceanBase Deploy. If not, see <https://www.gnu.org/licenses/>.
20-
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
2116

2217
from __future__ import absolute_import, division, print_function
2318

@@ -198,7 +193,7 @@ def init_home(self):
198193
version = version_fobj.read()
199194
if not COMMAND_ENV.get(ENV.ENV_OBD_ID):
200195
COMMAND_ENV.set(ENV.ENV_OBD_ID, uuid())
201-
if VERSION != version:
196+
if VERSION != version and BUILD_PLUGIN_LIST != '<B_PLUGIN_LIST>':
202197
for part in ['workflows', 'plugins', 'config_parser', 'optimize', 'mirror/remote']:
203198
obd_part_dir = os.path.join(self.OBD_PATH, part)
204199
root_part_path = os.path.join(self.OBD_INSTALL_PATH, part)
@@ -2200,6 +2195,103 @@ def _do_command(self, obd):
22002195
return obd.obdiag_offline_func("update_scene", self.opts)
22012196

22022197

2198+
class BinlogCommand(MajorCommand):
2199+
2200+
def __init__(self):
2201+
super(BinlogCommand, self).__init__('binlog', 'binlog service tools')
2202+
self.register_command(BinlogCreateCommand())
2203+
self.register_command(BinlogStartCommand())
2204+
self.register_command(BinlogStopCommand())
2205+
self.register_command(BinlogShowCommand())
2206+
self.register_command(BinlogDropCommand())
2207+
2208+
2209+
class BinlogCreateCommand(ObdCommand):
2210+
2211+
def __init__(self):
2212+
super(BinlogCreateCommand, self).__init__('create', 'Apply binlog to create instance')
2213+
self.parser.add_option('--replicate-num', type='int', help="Number of copies", default=1)
2214+
self.parser.add_option('-d', '--obproxy-deployname', '--odp', type='string', help='Obproxy deploy name')
2215+
self.parser.add_option('-p', '--cdcro-password', type='string', help='Password of user `cdcro`.If user already been created manually, you need to enter the password here.')
2216+
2217+
def init(self, cmd, args):
2218+
super(BinlogCreateCommand, self).init(cmd, args)
2219+
self.parser.set_usage('%s <binlog deploy name> <oceanbase deploy name> <ceanbase tenant name> [options]' % self.prev_cmd)
2220+
return self
2221+
2222+
def _do_command(self, obd):
2223+
if len(self.cmds) == 3:
2224+
return obd.binlog_create_instance(self.cmds[0], self.cmds[1], self.cmds[2])
2225+
else:
2226+
return self._show_help()
2227+
2228+
2229+
class BinlogShowCommand(ClusterMirrorCommand):
2230+
2231+
def __init__(self):
2232+
super(BinlogShowCommand, self).__init__('show', 'Show the list of binlog instances')
2233+
self.parser.add_option('-d', '--deploy-name', type='str', help="Oceanbase deploy name, must be entered together with `--tenant-name`")
2234+
self.parser.add_option('-t', '-n', '--tenant-name', type='str', help='Tenant name, must be entered together with `--deploy-name`')
2235+
2236+
def _do_command(self, obd):
2237+
if len(self.cmds) == 1:
2238+
return obd.show_binlog_instance(self.cmds[0])
2239+
else:
2240+
return self._show_help()
2241+
2242+
2243+
class BinlogStartCommand(ObdCommand):
2244+
2245+
def __init__(self):
2246+
super(BinlogStartCommand, self).__init__('start', 'Start binlog instance')
2247+
2248+
def init(self, cmd, args):
2249+
super(BinlogStartCommand, self).init(cmd, args)
2250+
self.parser.set_usage('%s <binlog deploy name> <oceanbase deploy name> <ceanbase tenant name> [options]' % self.prev_cmd)
2251+
return self
2252+
2253+
def _do_command(self, obd):
2254+
if len(self.cmds) == 3:
2255+
return obd.start_binlog_instances(self.cmds[0], self.cmds[1], self.cmds[2])
2256+
else:
2257+
return self._show_help()
2258+
2259+
2260+
class BinlogStopCommand(ObdCommand):
2261+
2262+
def __init__(self):
2263+
super(BinlogStopCommand, self).__init__('stop', 'Stop binlog instance')
2264+
2265+
def init(self, cmd, args):
2266+
super(BinlogStopCommand, self).init(cmd, args)
2267+
self.parser.set_usage('%s <binlog deploy name> <oceanbase deploy name> <ceanbase tenant name> [options]' % self.prev_cmd)
2268+
return self
2269+
2270+
def _do_command(self, obd):
2271+
if len(self.cmds) == 3:
2272+
return obd.stop_binlog_instances(self.cmds[0], self.cmds[1], self.cmds[2])
2273+
else:
2274+
return self._show_help()
2275+
2276+
2277+
class BinlogDropCommand(ObdCommand):
2278+
2279+
def __init__(self):
2280+
super(BinlogDropCommand, self).__init__('drop', 'Drop binlog instance')
2281+
2282+
def init(self, cmd, args):
2283+
super(BinlogDropCommand, self).init(cmd, args)
2284+
self.parser.set_usage('%s <binlog deploy name> <oceanbase deploy name> <ceanbase tenant name> [options]' % self.prev_cmd)
2285+
return self
2286+
2287+
def _do_command(self, obd):
2288+
if len(self.cmds) == 3:
2289+
return obd.drop_binlog_instances(self.cmds[0], self.cmds[1], self.cmds[2])
2290+
else:
2291+
return self._show_help()
2292+
2293+
2294+
22032295
class ToolListCommand(ObdCommand):
22042296

22052297
def __init__(self):
@@ -2303,12 +2395,13 @@ def __init__(self):
23032395
self.register_command(TelemetryMajorCommand())
23042396
self.register_command(ToolCommand())
23052397
self.register_command(ObdiagCommand())
2398+
self.register_command(BinlogCommand())
23062399
self.parser.version = '''OceanBase Deploy: %s
23072400
REVISION: %s
23082401
BUILD_BRANCH: %s
23092402
BUILD_TIME: %s
2310-
Copyright (C) 2021 OceanBase
2311-
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
2403+
Copyright (C) 2025 OceanBase
2404+
License Apache 2.0: Apache version 2 or later <https://www.apache.org/licenses/LICENSE-2.0>.
23122405
This is free software: you are free to change and redistribute it.
23132406
There is NO WARRANTY, to the extent permitted by law.''' % (VERSION, REVISION, BUILD_BRANCH, BUILD_TIME)
23142407
self.parser._add_version_option()

_deploy.py

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
# coding: utf-8
2-
# OceanBase Deploy.
3-
# Copyright (C) 2021 OceanBase
2+
# Copyright (c) 2025 OceanBase.
43
#
5-
# This file is part of OceanBase Deploy.
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
67
#
7-
# OceanBase Deploy is free software: you can redistribute it and/or modify
8-
# it under the terms of the GNU General Public License as published by
9-
# the Free Software Foundation, either version 3 of the License, or
10-
# (at your option) any later version.
8+
# http://www.apache.org/licenses/LICENSE-2.0
119
#
12-
# OceanBase Deploy is distributed in the hope that it will be useful,
13-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15-
# GNU General Public License for more details.
16-
#
17-
# You should have received a copy of the GNU General Public License
18-
# along with OceanBase Deploy. If not, see <https://www.gnu.org/licenses/>.
19-
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
2015

2116
from __future__ import absolute_import, division, print_function
2217
from collections.abc import Iterable, Iterator

_environ.py

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
# coding: utf-8
2-
# OceanBase Deploy.
3-
# Copyright (C) 2021 OceanBase
2+
# Copyright (c) 2025 OceanBase.
43
#
5-
# This file is part of OceanBase Deploy.
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
67
#
7-
# OceanBase Deploy is free software: you can redistribute it and/or modify
8-
# it under the terms of the GNU General Public License as published by
9-
# the Free Software Foundation, either version 3 of the License, or
10-
# (at your option) any later version.
8+
# http://www.apache.org/licenses/LICENSE-2.0
119
#
12-
# OceanBase Deploy is distributed in the hope that it will be useful,
13-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15-
# GNU General Public License for more details.
16-
#
17-
# You should have received a copy of the GNU General Public License
18-
# along with OceanBase Deploy. If not, see <https://www.gnu.org/licenses/>.
19-
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
2015

2116
from __future__ import absolute_import, division, print_function
2217

_errno.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
# coding: utf-8
2-
# OceanBase Deploy.
3-
# Copyright (C) 2021 OceanBase
2+
# Copyright (c) 2025 OceanBase.
43
#
5-
# This file is part of OceanBase Deploy.
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
67
#
7-
# OceanBase Deploy is free software: you can redistribute it and/or modify
8-
# it under the terms of the GNU General Public License as published by
9-
# the Free Software Foundation, either version 3 of the License, or
10-
# (at your option) any later version.
8+
# http://www.apache.org/licenses/LICENSE-2.0
119
#
12-
# OceanBase Deploy is distributed in the hope that it will be useful,
13-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15-
# GNU General Public License for more details.
16-
#
17-
# You should have received a copy of the GNU General Public License
18-
# along with OceanBase Deploy. If not, see <https://www.gnu.org/licenses/>.
19-
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
2015

2116
from __future__ import absolute_import, division, print_function
2217

@@ -246,6 +241,10 @@ class InitDirFailedErrorMessage(object):
246241
# oblogproxy
247242
EC_OBLOGPROXY_DEPENDS_COMP_VERSION = OBDErrorCodeTemplate(4501, 'OBLogProxy {oblogproxy_version} needs to use {comp} with version {comp_version} or above')
248243

244+
# obbinlog
245+
EC_OBBINLOG_DEPENDS_COMP_MIN_VERSION = OBDErrorCodeTemplate(4601, 'OBBinlog {obbinlog_version} needs to use {comp} with version {min_version} or above.')
246+
EC_OBBINLOG_TARGET_DEPLOY_NEED_CONFIGSERVER = OBDErrorCodeTemplate(4602, 'Deploy {target_oceanbase_deploy} need depends ob-configserver. You could use `obd cluster component add {target_oceanbase_deploy} -c <ob-configserver.config>` to add.')
247+
249248
WC_PARAM_USELESS = OBDErrorCodeTemplate(4521, 'The config {key} in {current_comp} did not take effect, please config it in {comp}')
250249

251250
# sql

_lock.py

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
# coding: utf-8
2-
# OceanBase Deploy.
3-
# Copyright (C) 2021 OceanBase
2+
# Copyright (c) 2025 OceanBase.
43
#
5-
# This file is part of OceanBase Deploy.
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
67
#
7-
# OceanBase Deploy is free software: you can redistribute it and/or modify
8-
# it under the terms of the GNU General Public License as published by
9-
# the Free Software Foundation, either version 3 of the License, or
10-
# (at your option) any later version.
8+
# http://www.apache.org/licenses/LICENSE-2.0
119
#
12-
# OceanBase Deploy is distributed in the hope that it will be useful,
13-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15-
# GNU General Public License for more details.
16-
#
17-
# You should have received a copy of the GNU General Public License
18-
# along with OceanBase Deploy. If not, see <https://www.gnu.org/licenses/>.
19-
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
2015

2116
from __future__ import absolute_import, division, print_function
2217

0 commit comments

Comments
 (0)