This topic describes how to install and deploy obcdc. You can install and deploy obcdc by using an RPM package or compiling your package.
Install obcdc by using an RPM package
RPM packages of obcdc will be published after OceanBase Database Community Edition is released, and are named in the format of oceanbase-ce-cdc-${package_version}. For details, see OceanBase Community Edition release notes.
Run the following command to decompress the package:
rpm2cpio oceanbase-ce-cdc-${package_version} | cpio -idv
In the directory to which the RPM package is decompressed, the home/admin/oceanbase directory exists and contains the following components that are essential for the running of obcdc:
- Header files:
libobcdc.handob_errno.hin theinclude/libobcdc/directory. - Configuration file for reference:
libobcdc.confin theetc/directory. - Library files:
libobcdc.soin thelib64/directory. - Executable files:
obcdc_tailfin thebin/directory. - Output messages: in the
include/oblogmsg/directory.
Build obcdc by compiling the source code
Code description
The obcdc code is in the src/logservice/libobcdc directory of the OceanBase Database open-source repository. The directory has two subdirectories:
srcdirectory: stores the obcdc code.testsdirectory: stores obcdc_tailf, a simple application for you to experience the features of obcdc. For more information, see obcdc_tailf. Thetestsdirectory contains the following files and directories:Source files of obcdc_tailf. You can use them as a reference when you compile your incremental data consumption tools for OceanBase Database.
watch\*.sh: various monitoring scripts.demo directory: contains libobcdc examples that describe the usage of libobcdc.
Compilation
You can run the following command to compile obcdc together with OceanBase Database:
./build.sh release -DOB_BUILD_CDC=ON --init --make
Notice
- Use the release mode to compile the code.
- If you want to use the dlopen system function to dynamically link to obcdc, add the
OB_BUILD_CDC=ONparameter during compilation.
The compilation output includes:
libobcdc.so: in the${PROJECT_BUILD_DIR}/src/logservice/libobcdc/src/directory.obcdc_tailf: in the$${PROJECT_BUILD_DIR}/src/logservice/libobcdc/tests/directory.
You can run the ./libobcdc.so -v command in the output directory to view the version, build time, and build method of obcdc.