README.md 4.7 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 32 33 34 35 36 37 38 39 40 41 42 43 44
- pip
- pyinstaller

> Notes:
> 
> You can install pip for Python2.7 or Python3.8 refer below cmd:
>   ```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
>   ```
> 
> then install pyinstaller as below:
>   ```shell
>   sudo pip install pyinstaller==3.6
>   ```

A
Amber Zhang 已提交
45

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

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

A
Amber Zhang 已提交
53 54 55 56 57 58 59
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 已提交
60

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

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

A
Amber Zhang 已提交
68 69
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 已提交
70

A
Amber Zhang 已提交
71 72 73 74
- 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 已提交
75

张素娟 已提交
76
> **NOTE:** If the preceding conditions are not met, see [Use OBD to start an OceanBase cluster](./docs/docs-en/install-and-use/start-OceanBase-cluster-with-obd.md).
O
oceanbase-admin 已提交
77

张素娟 已提交
78
> **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.
张素娟 已提交
79

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

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

张素娟 已提交
89
If you want to know how to use OBD to start an OceanBase cluster, please see [Use OBD to start an OceanBase cluster](./docs/docs-en/install-and-use/start-OceanBase-cluster-with-obd.md).
O
oceanbase-admin 已提交
90

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

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

张素娟 已提交
95 96 97
- [Mirror and repository commands](./docs/docs-en/obd-commands/mirror-and-repository-commands.md)
- [Cluster commands](./docs/docs-en/obd-commands/cluster-commands.md)
- [Testing commands](./docs/docs-en/obd-commands/testing-commands.md)
R
Rongfeng Fu 已提交
98

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

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

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

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

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

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

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

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

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

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

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

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

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

## TPC-C
- [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)