This topic describes how to compile the source code to customize OceanBase Database Proxy (ODP) and test its latest features.
Prerequisites
Before you compile an ODP build, make sure that your server meets the following requirements:
Operating system: CentOS 7/8 (x86)
Number of servers: 1
Minimum hardware specifications:
Recommended hardware specifications:
Clone the repository
Run the following command to clone the ODP source code repository to your server:
git clone git@github.com:oceanbase/obproxy
Notice
To clone the repository, you must install and configure Git first. For more information, see Documentation on Git.
Get compilation dependencies
Most of the compilation dependencies are hosted in the official YUM repository of OceanBase Database. Run the following command to confirm whether your server has access to the YUM repository.
curl http://mirrors.aliyun.com/oceanbase/OceanBase.repo
If yes, you can get the compilation dependencies through the following methods:
Run the following command to install the global dependency:
yum install wget rpm* cpio make glibc-devel glibc-headersRun the following command to install the local dependency:
sh build.sh initNotice
To install the local dependency, you need the wget, rpm2cpio, and cpio utilities.
Compile dependencies
You can also compile the dependencies in the
deps/3rddirectory. The following table shows programs required for compiling dependencies.Program Recommended version (minimum) Purpose Dependencies provided Required Make 3.8.2 Compilation utility No Yes GCC 5.2.0 Compilation utility Yes Yes Binutils 2.30 Compilation utility Yes No Automake 1.15.0 Compilation utility No Yes Autoconf 2.69 Compilation utility No Yes Libtool 2.4.2 Compilation utility No Yes Flex 2.5.35 Code generator Yes Development only Python2 2.7(2.6) Code generator No Development only Bison 2.4.1 Code generator Yes Development only OpenSSL-static 1.0.1e Compile dependencies Yes Yes Libcurl 7.29.0 Compile dependencies Yes Yes MariaDB Connector/C 3.1.12 Compile dependencies Yes Yes Prometheus-cpp 0.8.0 Compile dependencies Yes Yes GoogleTest 1.8.0 Compile dependencies Yes Yes gRPC 1.20.1 Compile dependencies Yes Yes oceanbase-ce-sql-parser 3.1.0 Compile dependencies Yes Yes Glibc-devel or Glibc-headers 2.17 Compile dependencies No Yes RPM* 4.14.1(4.11) Packaging utility No Packaging only
Compile your ODP build
ODP is built by using Automake. You can either run Automake commands to create a directory and build it, or use the build.sh script to build it quickly. You can select one of the following compilation methods as needed.
DEBUG compilation
sh build.sh init sh build.sh config debug sh build.sh makeRELEASE compilation
sh build.sh init sh build.sh config sh build.sh makeCreate an RPM package (optional)
sh build.sh rpmNotice
To create an RPM package, you must install the rpm and rpmbuild utilities.
Subsequent operations
After the ODP build is compiled, you can use OceanBase Deployer (OBD) to deploy it. For more information, see OBD Documentation.