https://github.com/polardb/polardbx-sql/blob/main/docs/en/quickstart-development.md
Packages:
apt install make automake cmake git bison libaio-dev libncurses-dev libsasl2-dev libldap2-dev libssl-dev pkg-config ligtool
apt install libsnappy-dev libbz2-dev liblz4-dev
Fork PolarDBX Engine
git clone https://github.com/polardb/polardbx-engine
git submodule update --init
cmake . \
-DFORCE_INSOURCE_BUILD=ON \
-DCMAKE_BUILD_TYPE="Debug" \
-DSYSCONFDIR="/u01/mysql" \
-DCMAKE_INSTALL_PREFIX="/u01/mysql" \
-DMYSQL_DATADIR="/u01/mysql/data" -DWITH_BOOST="./extra/boost/boost_1_77_0.tar.gz" \
-DDOWNLOAD_BOOST=1 \
-DCMAKE_CXX_FLAGS="-Wno-error=unused-value" \
-DWITH_JEMALLOC=ON
Error 1:
[35%] Building CXX object sql/CMakeFiles/master.dir/rpl_source.cc.o
In file included from /home/cslog/polardbx-engine/sql/rpl_binlog_sender.h:40,
from /home/cslog/polardbx-engine/sql/rpl_source.cc:66:
/home/cslog/polardbx-engine/sql/lizard_rpl_binlog_sender.h:110:14: error: ‘Event’ was not declared in this scope 110 | std::array<Event, 2> m_events;
Edit source sql/lizard_rpl_binlog_sender.h
#include <array>
#include <string>
Error 2:
make[2]: [mysys/CMakeFiles/build_id_test.dir/build.make:116: runtime_output_directory/build_id_test] Erro 1
make[2]: Apagando arquivo 'runtime_output_directory/build_id_test'
make[1]: ** [CMakeFiles/Makefile2:7431: mysys/CMakeFiles/build_id_test.dir/all] Erro 2
make: * [Makefile:166: all] Erro 2
Run make with locale in English
LC_ALL=C make
cmake . \
-DFORCE_INSOURCE_BUILD=ON \
-DCMAKE_BUILD_TYPE="Release" \
-DSYSCONFDIR="/data/mysql" \
-DCMAKE_INSTALL_PREFIX="/data/mysql" \
-DMYSQL_DATADIR="/data/mysql/data" \
-DWITH_BOOST="./extra/boost/boost_1_77_0.tar.gz" \
-DDOWNLOAD_BOOST=1 \
-DCMAKE_CXX_FLAGS="-Wno-error=unused-value -Wno-error=restrict -Wno-error=use-after-free" \ -DWITH_JEMALLOC=ON
Ubuntu 24-0
Packages:
sudo apt-get install openjdk-11-jdk openjdk-11-jdk-headless openjdk-11-jre-zero
java -version
sudo apt install maven
mvn -version
Repositories:
git clone https://github.com/polardb/polardbx-sql
git clone https://github.com/polardb/polardbx-glue
git clone https://github.com/polardb/polardbx-cdc
git clone https://github.com/alibaba/canal.git
Build:
- cd polardbx-sql
git submodule update --init
mvn install -D maven.test.skip=true -D env=release -e
Error:
Could not find artifact com.alibaba.polardbx:polardbx-optimizer:jar:tests:5.4.19-SNAPSHOT
Pom.xml
Add in plugins
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
cd polardbx-optimizer
mvn install -DskipTests -pl :polardbx-optimizer
cd ..
mvn install -D maven.test.skip=true -D env=release -e
- canal
cd ~/canal
mvn clean install -DskipTests
- polardbx-cdc
cd polardbx-cdc/
git submodule update --init
Error: change polardbx-parser to version already compiled
- <polardbx-parser.version>6.21</polardbx-parser.version>
+ <polardbx-parser.version>5.4.19-SNAPSHOT</polardbx-parser.version>
mvn install -D maven.test.skip=true -D env=release -e
If error on Windows: D:\polardbx\polardbx-cdc\polardbx-cdc-client\target\classes\metrics.txt failed with UnmappableCharacterException: Input length = 1 -> [Help 1]
mvn clean install -Dproject.build.sourceEncoding=UTF-8 -Dproject.reporting.outputEncoding=UTF-8 -D maven.test.skip=true -D env=release -e
- polaerdbx-glue
Edit pom.xml to reference dir polardbx-sql
- <relativePath>../pom.xml</relativePath>
+ <relativePath>../polardbx-sql/pom.xml</relativePath>
mvn install -D maven.test.skip=true -D env=release -e