README.md 4.9 KB
Newer Older
A
Amber Zhang 已提交
1
# OceanBase Deployer
O
oceanbase-admin 已提交
2

R
Rongfeng Fu 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
<!--
#
# OceanBase Deploy.
# Copyright (C) 2021 OceanBase
#
# This file is part of OceanBase Deploy.
#
# OceanBase Deploy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OceanBase Deploy is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OceanBase Deploy.  If not, see <https://www.gnu.org/licenses/>.
#
-->

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

A
Amber Zhang 已提交
27
OceanBase Deployer (OBD) is an installation and deployment tool for open-source OceanBase software. It is also a package manager for managing all open-source OceanBase software. This topic describes how to install OBD, how to use OBD, and OBD commands.
O
oceanbase-admin 已提交
28

A
Amber Zhang 已提交
29
## Install OBD
O
oceanbase-admin 已提交
30

A
Amber Zhang 已提交
31
You can install OBD by using these methods:
O
oceanbase-admin 已提交
32

A
Amber Zhang 已提交
33
### Method 1: Install OBD by using RPM packages (only for CentOS 7 or later)
O
oceanbase-admin 已提交
34

R
Rongfeng Fu 已提交
35 36 37 38 39 40
```shell
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://mirrors.aliyun.com/oceanbase/OceanBase.repo
sudo yum install -y ob-deploy
source /etc/profile.d/obd.sh
```
O
oceanbase-admin 已提交
41

A
Amber Zhang 已提交
42
### Method 2: Install OBD by using the source code
O
oceanbase-admin 已提交
43

A
Amber Zhang 已提交
44
Before you install OBD by using the source code, make sure that you have installed these dependencies:
O
oceanbase-admin 已提交
45

R
Rongfeng Fu 已提交
46 47 48 49 50 51
- gcc
- wget
- python-devel
- openssl-devel
- xz-devel
- mysql-devel
O
oceanbase-admin 已提交
52

R
Rongfeng Fu 已提交
53
To install OBD on Python3.8, run these commands:
A
Amber Zhang 已提交
54 55

```shell
R
Rongfeng Fu 已提交
56 57
pip install -r requirements3.txt
sh build.sh build_obd
R
Rongfeng Fu 已提交
58 59
source /etc/profile.d/obd.sh
```
O
oceanbase-admin 已提交
60

A
Amber Zhang 已提交
61
## Start an OceanBase cluster
O
oceanbase-admin 已提交
62

R
Rongfeng Fu 已提交
63
After you deploy OceanBase Deployer (OBD), you can run the `obd demo` command to deploy and start OceanBase Database on a single local server. Make sure the following prerequisites are met:
O
oceanbase-admin 已提交
64

R
Rongfeng Fu 已提交
65
- Ports `2881` and `2882` are not occupied.
O
oceanbase-admin 已提交
66

R
Rongfeng Fu 已提交
67
- At least 6 GB of memory is available on the server.
O
oceanbase-admin 已提交
68

R
Rongfeng Fu 已提交
69 70 71 72 73 74 75
- At least two CPU cores are available on the server.

- At least 54 GB of disk space is available on the server.

> **Note**
>
> If the foregoing prerequisites are not met, see [Use OBD to start an OceanBase cluster](../3.user-guide/2.start-the-oceanbase-cluster-by-using-obd.md).
张素娟 已提交
76

O
oceanbase-admin 已提交
77
```shell
R
Rongfeng Fu 已提交
78 79 80 81
# Deploy and start OceanBase Database.
obd demo
# Run the following command to connect to OceanBase Database by using the OBClient:
obclient -h127.0.0.1 -uroot -P2881
O
oceanbase-admin 已提交
82 83
```

A
Amber Zhang 已提交
84
## Use OBD to start an OceanBase cluster
O
oceanbase-admin 已提交
85

X
Xjxjy 已提交
86
If you want to know how to use OBD to start an OceanBase cluster, please see [Use OBD to start an OceanBase cluster](./docs/en-US/3.user-guide/2.start-the-oceanbase-cluster-by-using-obd.md).
O
oceanbase-admin 已提交
87

A
Amber Zhang 已提交
88
## Other OBD commands
O
oceanbase-admin 已提交
89

A
Amber Zhang 已提交
90
OBD provides multiple-level commands. You can use the`-h/--help` option to view the help information of sub-commands.
O
oceanbase-admin 已提交
91

X
Xjxjy 已提交
92 93 94
- [Mirror and repository commands](./docs/en-US/3.user-guide/3.obd-command/2.command-group-for-mirroring-and-warehousing.md)
- [Cluster commands](./docs/en-US/3.user-guide/3.obd-command/1.cluster-command-groups.md)
- [Testing commands](./docs/en-US/3.user-guide/3.obd-command/3.test-command-group.md)
R
Rongfeng Fu 已提交
95

O
oceanbase-admin 已提交
96 97
## Q&A

A
Amber Zhang 已提交
98
### Q: How can I specify the version of a component?
O
oceanbase-admin 已提交
99

A
Amber Zhang 已提交
100
A: You can add the version declaration to the deployment configuration file. For example, you can specify the version of OceanBase-CE V3.1.0 in the deployment configuration file in the following format:
O
oceanbase-admin 已提交
101 102 103 104 105 106

```yaml
oceanbase-ce:
  version: 3.1.0
```

A
Amber Zhang 已提交
107
### Q: How can I use a component of a specific version?
O
oceanbase-admin 已提交
108

A
Amber Zhang 已提交
109 110
A: You can add the package_hash or tag declaration to the deployment configuration file.
For example, if you have tagged your compiled OceanBase-CE, you can specify it by tag. For example:
O
oceanbase-admin 已提交
111 112 113 114 115 116

```yaml
oceanbase-ce:
  tag: my-oceanbase
```

A
Amber Zhang 已提交
117
You can also use package_hash to specify a specific version. When you run an `obd mirror` command, OBD will return an MD5 value of the component. The MD5 value is the value of package_hash.
O
oceanbase-admin 已提交
118 119 120 121 122 123

```yaml
oceanbase-ce:
  package_hash: 929df53459404d9b0c1f945e7e23ea4b89972069
```

A
Amber Zhang 已提交
124
### Q: How can I modify the startup process after I modify the code of OceanBase-CE?
O
oceanbase-admin 已提交
125

A
Amber Zhang 已提交
126
A: You can modify the startup plug-ins in the `~/.obd/plugins/oceanbase-ce/` directory. For example, after you add a new startup configuration item for OceanBase-CE V3.1.0, you can modify the `start.py` file in the `~/.obd/plugins/oceanbase-ce/3.1.0` directory.
O
oceanbase-admin 已提交
127

128 129 130 131
### Q:How to update OBD?

A:You can use the `obd update` command to update OBD. When you are done with the update, use the `obd --version` command to confirm the version of OBD.

A
Amber Zhang 已提交
132
## Protocol
O
oceanbase-admin 已提交
133

A
Amber Zhang 已提交
134
OBD complies with [GPL-3.0](/LICENSE).
R
Rongfeng Fu 已提交
135 136 137 138

## Sysbench benchmark

- [Run the Sysbench benchmark test in OceanBase Database (Paetica, VLDB 2023)](https://github.com/oceanbase/oceanbase-doc/blob/V4.1.0/en-US/7.reference/3.performance-tuning-guide/6.performance-whitepaper/3.run-the-sysbench-benchmark-test-in-oceanbase-database.md)