OceanBase LogProxy (CE) is a proxy service of [OceanBase CE](https://github.com/oceanbase/oceanbase). It is a part of [OMS](https://www.oceanbase.com/product/oms), and it can establish and manage connections with OceanBase for incremental log reading even with a isolated network.
## Quick start
## Instructions before use
### Version compatibility
LogProxy is based on [libobcdc](https://github.com/oceanbase/oceanbase/tree/master/src/logservice/libobcdc)(former`liboblog`), so you should install the corresponding version of it firstly. The libobcdc is packaged in `oceanbase-ce-devel` before 4.0.0, and is packaged in `oceanbase-ce-cdc` in 4.0.0 and the later version, both of which can be found in the [official download page](https://open.oceanbase.com/softwareCenter/community) or [official mirror](https://mirrors.aliyun.com/oceanbase/community/stable/el/).
| libobcdc | oblogproxy |
|----------|------------|
| 3.1.1 | 1.0.0 |
| 3.1.2 | 1.0.1 |
| 3.1.3 | 1.0.2 |
| 3.1.4 | 1.0.3 |
| 4.0.0 | 1.1.0 |
### Installation
LogProxy service doesn't need params about OceanBase cluster to get started, one LogProxy can subscribe to multiple OceanBase clusters at the same time, and the connection configuration is passed from the client.
LogProxy will use a lot of memory, so it is strongly recommended to deploy it separately from the OceanBase server.
## Getting started
### Install
You can install a released version of LogProxy or build it from the source code.
#### Install a released version
If you want to install a released version, firstly you need to configure the yum repo.
Then you can install the rpm file by one of the following way:
+ Download from [release page](https://github.com/oceanbase/oblogproxy/releases), [official download page](https://open.oceanbase.com/softwareCenter/community) or [official mirror](https://mirrors.aliyun.com/oceanbase/community/stable/el/), and install it with `yum install -y oblogproxy-{version}.{arch}.rpm`
+ Install it with `yum install -y oblogproxy-{version}`
For security reasons, LogProxy needs to configure the username and password of a certain user, which must be a sys tenant user of the OceanBase to connect with. Note that the username here should not contain cluster name or tenant name.
| obcdc (devel) | oblogproxy |
|---------------|------------|
| 3.1.1 | 1.0.0 |
| 3.1.2 | 1.0.1 |
| 3.1.3 | 1.0.2 |
| 3.1.4 | 1.0.3 |
| 4.0 | 1.1.0 |
You can configure the username and password by one of the following ways:
- Add it to local conf at `conf/conf.json`.
- Set it in the client params. See the [client doc](https://github.com/oceanbase/oblogclient/blob/master/docs/quickstart/logproxy-client-tutorial.md) for details.
Then you can use [oblogclient](https://github.com/oceanbase/oblogclient) to subscribe the log data from LogProxy, and the service is bind to port `2983` by default.
## 文档
-[编译](./docs/manual.md#编译)
-[运行](./docs/manual.md#运行)
-[配置](./docs/manual.md#配置)
The service log of LogProxy is located at `logs/`, and the service log of LogReader (task thread) is located at `run/{client-id}/logs/`.
## Licencing
OceanBase Database is under MulanPubL - 2.0 license. You can freely copy and use the source code. When you modify or distribute the source code, please obey the MulanPubL - 2.0 license.
## Contributing
Contributions are warmly welcomed and greatly appreciated. Here are a few ways you can contribute:
- Raise us an [issue](https://github.com/oceanbase/oblogproxy/issues).
- Submit Pull Requests.
## Support
In case you have any problems when using OceanBase Database, welcome reach out for help:
In case you have any problems when using OceanBase LogProxy, welcome reach out for help:
| WITH_ASAN | OFF | Flag of whether to build with [AddressSanitizer](https://github.com/google/sanitizers). |
| WITH_TEST | OFF | Flag of whether to build test. |
| WITH_DEMO | OFF | Flag of whether to build demo. |
| WITH_GLOG | ON | Flag of whether to build with glog. |
| WITH_DEPS | ON | Flag of whether to automatically download precompiled dependencies. |
| USE_LIBOBLOG | OFF | Flag of whether to build with a customized precompiled libobcdc/liboblog. |
| USE_OBCDC_NS | ON | Flag of whether to build with libobcdc, use 'OFF' to build with former liboblog (before 3.1.3). |
| USE_CXX11_ABI | ON | Flag of whether to build with C++11 ABI. Note that if precompiled dependencies are used, they need to be consistent, otherwise the symbols will not be found |
For example, if you want to build with precompiled libobcdc, you can use the following commands.