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

A
Amber Zhang 已提交
3
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 已提交
4

A
Amber Zhang 已提交
5
## Install OBD
O
oceanbase-admin 已提交
6

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

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

R
Rongfeng Fu 已提交
11 12 13 14 15 16
```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 已提交
17

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

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

R
Rongfeng Fu 已提交
22 23 24 25 26 27
- gcc
- wget
- python-devel
- openssl-devel
- xz-devel
- mysql-devel
28 29 30 31
- pip
- pyinstaller

> Notes:
X
Xjxjy 已提交
32
>
33
> You can install pip for Python2.7 or Python3.8 refer below cmd:
X
Xjxjy 已提交
34 35 36 37 38 39 40
>
> ```shell
> curl -o get-pip.py https://bootstrap.pypa.io/pip/2.7/get-pip.py # for Python2.7 
> curl -o get-pip.py https://bootstrap.pypa.io/get-pip.py # for Python3.8 
> sudo python get-pip.py
> ```
>
41
> then install pyinstaller as below:
X
Xjxjy 已提交
42 43 44 45
>
> ```shell
> sudo pip install pyinstaller==3.6
> ```
A
Amber Zhang 已提交
46

张素娟 已提交
47
To install OBD on Python2.7, run these commands:
O
oceanbase-admin 已提交
48

R
Rongfeng Fu 已提交
49
```shell
A
Amber Zhang 已提交
50
sh rpm/build.sh build
R
Rongfeng Fu 已提交
51 52
source /etc/profile.d/obd.sh
```
O
oceanbase-admin 已提交
53

A
Amber Zhang 已提交
54 55 56 57 58 59 60
To install OBD on Python3.8, run these commands on Python2.7 first:

```shell
sh rpm/build.sh executer
```

Then run these commands on Python3.8:
O
oceanbase-admin 已提交
61

R
Rongfeng Fu 已提交
62
```shell
A
Amber Zhang 已提交
63
sh rpm/build.sh build_obd
R
Rongfeng Fu 已提交
64 65
source /etc/profile.d/obd.sh
```
O
oceanbase-admin 已提交
66

A
Amber Zhang 已提交
67
## Start an OceanBase cluster
O
oceanbase-admin 已提交
68

A
Amber Zhang 已提交
69 70
After you install OBD, you can run these commands as the root user to start a local single-node OceanBase cluster.
Before you run the commands, make sure that these conditions are met:
O
oceanbase-admin 已提交
71

A
Amber Zhang 已提交
72 73 74 75
- You have logged on as the root user.
- Ports `2882` and `2883` are available.
- Your server has at least 8 GB of memory.
- Your server has at least 2 CPU cores.
O
oceanbase-admin 已提交
76

X
Xjxjy 已提交
77
> **NOTE:** If the preceding conditions are not met, 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 已提交
78

张素娟 已提交
79
> **NOTE:** For the convenience of using root here, OBD and OceanBase database do not have any restrictions on running users. We do not recommend that you use root in production.
张素娟 已提交
80

O
oceanbase-admin 已提交
81 82 83
```shell
obd cluster deploy c1 -c ./example/mini-local-example.yaml
obd cluster start c1
A
Amber Zhang 已提交
84
# Connect to the OceanBase Database by using a MySQL client.
R
Rongfeng Fu 已提交
85
mysql -h127.1 -uroot -P2883
O
oceanbase-admin 已提交
86 87
```

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

X
Xjxjy 已提交
90
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 已提交
91

A
Amber Zhang 已提交
92
## Other OBD commands
O
oceanbase-admin 已提交
93

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

X
Xjxjy 已提交
96 97 98
- [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 已提交
99

O
oceanbase-admin 已提交
100 101
## Q&A

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

A
Amber Zhang 已提交
104
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 已提交
105 106 107 108 109 110

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

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

A
Amber Zhang 已提交
113 114
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 已提交
115 116 117 118 119 120

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

A
Amber Zhang 已提交
121
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 已提交
122 123 124 125 126 127

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

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

A
Amber Zhang 已提交
130
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 已提交
131

132 133 134 135
### 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 已提交
136
## Protocol
O
oceanbase-admin 已提交
137

A
Amber Zhang 已提交
138
OBD complies with [GPL-3.0](/LICENSE).
L
LIN 已提交
139 140

## TPC-C
X
Xjxjy 已提交
141

L
LIN 已提交
142
- [Run TPC-C benchmark test on OceanBase](https://github.com/oceanbase/oceanbase-doc/blob/V3.1.4/en-US/1.Get-Started/5.Experience-OceanBase-Advanced-Features/1.Experience-Scalable-OLTP/1.Run-the-TPC-C-benchmark-test-in-OceanBase-Database.md)