2023-12-15 14:50:18 +08:00
|
|
|
|
<p align="center">
|
|
|
|
|
<a href="https://github.com/oceanbase/oblogproxy/blob/dev/LICENSE">
|
|
|
|
|
<img alt="license" src="https://img.shields.io/badge/license-MulanPubL--2.0-blue" />
|
|
|
|
|
</a>
|
|
|
|
|
<a href="https://github.com/oceanbase/oblogproxy/releases/latest">
|
|
|
|
|
<img alt="license" src="https://img.shields.io/badge/dynamic/json?color=blue&label=release&query=tag_name&url=https%3A%2F%2Fapi.github.com%2Frepos%2Foceanbase%2Foblogproxy%2Freleases%2Flatest" />
|
|
|
|
|
</a>
|
|
|
|
|
<a href="https://www.oceanbase.com/docs/oblogproxy-doc">
|
|
|
|
|
<img alt="Chinese doc" src="https://img.shields.io/badge/文档-简体中文-blue" />
|
|
|
|
|
</a>
|
|
|
|
|
<a href="https://github.com/oceanbase/oblogproxy/commits/dev">
|
|
|
|
|
<img alt="last commit" src="https://img.shields.io/github/last-commit/oceanbase/oblogproxy/dev" />
|
|
|
|
|
</a>
|
|
|
|
|
</p>
|
2023-11-15 16:32:13 +08:00
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
# OBLogProxy
|
2023-11-15 16:32:13 +08:00
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
[OBLogProxy](https://github.com/oceanbase/oblogproxy) 是 [OceanBase](https://github.com/oceanbase/oceanbase) 的增量日志代理服务,它可以与 OceanBase 建立连接并进行增量日志读取,为下游服务提供了变更数据捕获(CDC)的能力。
|
2023-11-15 16:32:13 +08:00
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
## OBLogProxy 功能特点
|
2023-11-15 16:32:13 +08:00
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
OBLogProxy 有 2 种模式,分别是 Binlog 模式和 CDC 模式。
|
2023-11-15 16:32:13 +08:00
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
### Binlog 模式
|
2023-11-15 16:32:13 +08:00
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
Binlog 模式为 OceanBase 兼容 MySQL binlog 而推出,支持现有的 MySQL binlog 增量解析工具实时同步 OceanBase,使 MySQL binlog 增量解析工具可以平滑切换到 OceanBase 数据库。
|
2023-11-15 16:32:13 +08:00
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
### CDC 模式
|
2023-11-15 16:32:13 +08:00
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
CDC 模式用于解决数据同步,CDC 模式下 OBLogProxy 可以订阅 OceanBase 数据库中的数据变更,并将这些数据变更实时同步至下游服务,实现数据的实时或准实时复制和同步。
|
2023-11-15 21:06:51 +08:00
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
**有关于 OBLogProxy 的更多内容,请参考 [OBLogProxy 文档](https://www.oceanbase.com/docs/oblogproxy-doc) 。**
|
2023-11-15 21:06:51 +08:00
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
## 源码构建 OBLogProxy
|
2023-11-15 16:32:13 +08:00
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
### 前提条件
|
2023-11-15 16:32:13 +08:00
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
安装 CMake,要求版本 3.20 及以上。下载安装,请参考 [CMake 官方网站](https://cmake.org/download) 。
|
2023-11-15 16:32:13 +08:00
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
### 安装依赖
|
2023-11-15 16:32:13 +08:00
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
基于 Fedora (包括 CentOS,Fedora,OpenAnolis,RedHat,UOS 等)
|
2023-11-15 16:32:13 +08:00
|
|
|
|
|
|
|
|
|
```bash
|
2024-06-21 14:35:57 +08:00
|
|
|
|
yum install -y which git wget rpm rpm-build cpio gcc gcc-c++ make glibc-devel glibc-headers libstdc++-static binutils zlib zlib-devel bison flex java-11-openjdk
|
2023-11-15 16:32:13 +08:00
|
|
|
|
```
|
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
### 源码编译
|
2023-11-15 16:32:13 +08:00
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
```shell
|
|
|
|
|
git clone https://github.com/oceanbase/oblogproxy.git
|
|
|
|
|
cd oblogproxy
|
|
|
|
|
mkdir build
|
|
|
|
|
cd build
|
|
|
|
|
cmake ..
|
|
|
|
|
cmake --build . -j 8
|
|
|
|
|
```
|
|
|
|
|
### 编译选项
|
2023-11-15 16:32:13 +08:00
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
在执行 CMake 编译时,可以添加编译选项改变默认的行为。例如, 编译出 Demo,成功后,当前目录还会产出 `demo_client` 二进制。
|
2023-11-15 16:32:13 +08:00
|
|
|
|
|
|
|
|
|
```bash
|
2023-12-15 14:50:18 +08:00
|
|
|
|
mkdir build
|
|
|
|
|
cd build
|
|
|
|
|
cmake -DWITH_DEMO=ON ..
|
|
|
|
|
cmake --build . -j 8
|
2023-11-15 16:32:13 +08:00
|
|
|
|
```
|
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
项目中的其他编译选项。
|
2023-11-15 16:32:13 +08:00
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
| 选项 | 默认 | 说明 |
|
|
|
|
|
|------------|-----|------------------------------------------------------------------------------------|
|
|
|
|
|
| WITH_DEBUG | ON | 调试模式带 Debug 符号 |
|
|
|
|
|
| WITH_ASAN | OFF | 编译带 [AddressSanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizer) |
|
|
|
|
|
| WITH_TEST | OFF | 测试 |
|
|
|
|
|
| WITH_DEMO | OFF | Demo |
|
|
|
|
|
| WITH_DEPS | ON | 自动下载预编译依赖 |
|
2023-11-15 16:32:13 +08:00
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
## 许可
|
2023-11-15 16:32:13 +08:00
|
|
|
|
|
2024-06-21 14:35:57 +08:00
|
|
|
|
OBLogProxy 使用 MulanPubL-2.0 许可。当您修改或分发源代码时,请遵守 [MulanPubL-2.0](LICENSE) 。
|
2023-11-15 16:32:13 +08:00
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
## 贡献
|
2023-11-15 16:32:13 +08:00
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
我们热烈欢迎并高度赞赏您的贡献。您可以通过以下几种方式做出贡献:
|
2023-11-15 21:06:51 +08:00
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
- 向我们提出 [issue](https://github.com/oceanbase/oblogproxy/issues) 。
|
|
|
|
|
- 向我们提交请求 [pull request](https://github.com/oceanbase/oblogproxy/pulls) 。
|
2023-11-15 16:32:13 +08:00
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
## 支持
|
2023-11-15 16:32:13 +08:00
|
|
|
|
|
2023-12-15 14:50:18 +08:00
|
|
|
|
如果您在使用 OBLogProxy 时遇到任何问题,欢迎联系我们寻求帮助:
|
2023-11-15 21:06:51 +08:00
|
|
|
|
|
2023-11-15 16:32:13 +08:00
|
|
|
|
- [GitHub Issue](https://github.com/oceanbase/oblogproxy/issues)
|
2024-06-21 14:35:57 +08:00
|
|
|
|
- [问答论坛](https://ask.oceanbase.com/)
|