@@ -6,12 +6,13 @@ OceanBase Log Client is a library for obtaining log of [OceanBase](https://githu
Getting Started
---------------
There are modules as following:
### Work with LogProxy
-`common`: some common utils
-`logproxy-client`: the client for [oblogproxy](https://github.com/oceanbase/oblogproxy)
You can use `logproxy-client` with [oblogproxy](https://github.com/oceanbase/oblogproxy) to get the commit log of OceanBase cluster, see the [tutorial](docs/quickstart/logproxy-client-tutorial.md) for more details.
You can try the `logproxy-client` following the [LogProxyClient Tutorial](docs/quickstart/logproxy-client-tutorial.md).
@@ -47,12 +47,6 @@ If you'd rather like the latest snapshots of the upcoming major version, use our
</repositories>
```
## Workflow
![image](../images/logproxy-client-workflow.png)
When `LogProxyClient.start()` is executed, a new thread will be created in `ClientStream`. The thread will initialize a netty channel which will receive log data from LogProxy and put the data as `TransferPacket` to a BlockingQueue. When the netty connection is established, the thread will poll the queue and pass the `LogMessage` in TransferPacket to `RecordListener.notify`.
## Usage
### Basic Usage
...
...
@@ -67,21 +61,33 @@ To connect to LogProxy, there are some parameters to set in `ObReaderConfig`:
-*tb_white_list*: Table whitelist in format `tenant_name.database_name.table_name`, `*` indicates any value, and multiple values can be separated by `|`. Default is `*.*.*`.
-*tb_black_list*: Table blacklist in the same format with whitelist. Default is `|`.
-*timezone*: Timezone offset from UTC. Default value is `+8:00`.
-*working_mode*: Working mode. Can be `storage` (default value, supported from `obcdc` 3.1.3) or `memory`.
These parameters are used in `obcdc` (former `liboblog`), and the items not listed above can be passed to `obcdc` through the `ObReaderConfig` constructor with parameters.
Here is an example to set ObReaderConfig with a user of sys tenant, and the OceanBase and LogProxy server are on the same machine.
Here is an example to set `ObReaderConfig` with OceanBase Community Edition:
The method `LogProxyClient.start()` will start a new thread which serving with a netty socket to receive data from LogProxy.
For details about `LogMessage`, see [LogMessage](../formats/logmessage.md).
There are also some configurations for the client in `ClientConf`, if you don't want to use its default values, you can customize a `ClientConf` and pass it to the corresponding constructor to create the client instance.
@@ -133,6 +155,22 @@ Here you need provide following files:
See [manual](https://github.com/oceanbase/oblogproxy/blob/master/docs/manual.md) of LogProxy for more details about SSL encryption.
## Version Compatibility
The communication protocol between the `logproxy-client` and `oblogproxy` is forward compatible, and the latest version of `logproxy-client` can work with any version of `oblogproxy`. But for legacy versions, there are some restrictions in functionality.
#### OceanBase Enterprise Edition
To monitor change data from OceanBase EE, you need to configure `cluster_url` to replace the `rootserver_list` parameter for `obcdc`, which is supported from `1.0.4` of the client.
#### Record Compression
The log proxy compresses the record data by default from `1.0.1`, and the client fixed the bug in decompression process with [#33](https://github.com/oceanbase/oblogclient/pull/33) from `1.0.4`. So if you want to work with log proxy `1.0.1` or later version, you should use `1.0.4` or later version of the client.
#### Reuse Client Id
The log proxy use `clientId` to identify a connection, and reuse it will make the log proxy reduce the use of hardware resources. In legacy versions of the client, there is a bug [#38](https://github.com/oceanbase/oblogclient/issues/38) which will cause connection close failure, and it's fixed in `1.0.4`. So you can only reuse a fixed `clientId` from `1.0.4` of the client.
## Heartbeat and Troubleshooting
Once the connection is established properly, LogProxy will start to fetch log messages from OceanBase and send them to LogProxyClient. When the connection is idle, LogProxy will send heartbeat messages to LogProxyClient.