Installation¶
Install from Packages¶
visit our release page here to download a synchdb packages on supported platforms. We currently support .deb packages on Debian-based Linux systems such as Ubuntu. CentOS based .rpm packages will be supported in the near future. The SynchDB .deb package requires PostgreSQL to be installed first. The version of PostgreSQL it requires is described in the package name. For example, postgresql-16-synchdb_1.0-1.22.04_amd64.deb
is a SynchDB .deb package built on Ubuntu 22.04 against PostgreSQL 16.
.deb Packages¶
-
Install PostgreSQL from official apt repository:
1 2 3
sudo apt install -y postgresql-common sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh sudo apt install postgresql-16
-
Install Java Runtime Environment:
1
sudo apt install openjdk-17-jre-headless
-
Update shared library path:
1 2 3 4 5
JAVA_PATH=$(which java) JRE_HOME_PATH=$(readlink -f ${JAVA_PATH} | sed 's:/bin/java::') JRE_LIB_PATH=${JRE_HOME_PATH}/lib echo "$JRE_LIB_PATH" | sudo tee /etc/ld.so.conf.d/java.conf sudo ldconfig
-
Install SynchDB:
1
dpkg -i postgresql-16-synchdb_1.0-1.22.04_amd64.deb
- SynchDB should be ready to go. Refer to quick start page to get started
.rpm Packages¶
TBD
Install from Pre-compiled Binaries¶
visit our release page here to download a pre-compiled binaries on supported platforms. We currently support pre-compiled binaries on Debian-based Linux systems such as Ubuntu. Other platforms will be supported in the near future. SynchDB pre-compiled binaries requires existing PostgreSQL to be installed first. The version of PostgreSQL it requires is described in the package name. For example, postgresql-16-synchdb_1.0-1.22.04_amd64.tar.gz
is tar.gz package built on Ubuntu 22.04 against PostgreSQL 16.
Pre-compiled Binaries¶
-
Extract the tar.gz package that contains the pre-compiled binaries:
1
tar xzvf postgresql-16-synchdb_1.0-1.22.04_amd64.tar.gz -C /tmp
-
Find out the lib and share directories of your current PostgreSQL installation
1 2
LIBDIR=$(pg_config | grep -w LIBDIR | awk -F ' = ' '/LIBDIR/ {print $2}') SHAREDIR=$(pg_config | grep -w SHAREDIR | awk -F ' = ' '/SHAREDIR/ {print $2}')
-
Copy pre-compiled binaries to the respective directories:
1 2
cp /tmp/postgresql-16-synchdb_1.0-1.22.04_amd64/usr/lib/postgresql/16/lib/* $LIBDIR cp /tmp/postgresql-16-synchdb_1.0-1.22.04_amd64/usr/share/postgresql/16/extension/* $SHAREDIR
-
Install Java Runtime Environment:
1
sudo apt install openjdk-17-jre-headless
-
Update shared library path:
1 2 3 4 5
JAVA_PATH=$(which java) JRE_HOME_PATH=$(readlink -f ${JAVA_PATH} | sed 's:/bin/java::') JRE_LIB_PATH=${JRE_HOME_PATH}/lib echo "$JRE_LIB_PATH" | sudo tee /etc/ld.so.conf.d/java.conf sudo ldconfig
-
SynchDB should be ready to go. Refer to quick start page to get started
Install from Source¶
This option requires you to build both PostgreSQL and SynchDB from source code.
Build Requirements¶
The following software is required to build and run SynchDB. The versions listed are the versions tested during development. Older versions may still work.
- Java Development Kit 17 or later. Download here
- Apache Maven 3.6.3 or later. Download here
- PostgreSQL 16 Source. Git clone here. Refer to this wiki for PostgreSQL build requirements
- Docker compose 2.28.1 (for testing). Refer to here
Prepare Source¶
Clone the PostgreSQL source and switch to 16.3 release tag
1 2 3 |
|
Clone the SynchDB source from within the extension folder Note: Branch (synchdb-devel)[https://github.com/Hornetlabs/synchdb/tree/synchdb-devel] is used for development so far.
1 2 |
|
Prepare Tools¶
Install Maven¶
If you are working on Ubuntu 22.04.4 LTS, install the Maven as below:
sudo apt install maven
if you are using MacOS, you can use the brew command to install maven (refer (here)[https://brew.sh/] for how to install Homebrew) without any other settings:
brew install maven
Install Java SDK (OpenJDK)¶
If you are working on Ubuntu 22.04.4 LTS, install the OpenJDK as below:
sudo apt install openjdk-21-jdk
If you are working on MacOS, please install the JDK with brew command:
brew install openjdk@22
Build and Install PostgreSQL¶
Follow the official PostgreSQL documentation here to build and install PostgreSQL from source. Generally, the procedure consists of:
1 2 3 4 |
|
You should build and install the default extensions as well:
1 2 3 |
|
Build and Install Debezium Runner Engine¶
With Java and Maven setup, we are ready to build Debezium Runner Engine. This installs the Debezium Runner Engine jar file to your PostgreSQL's lib folder.
1 2 3 |
|
Build and Install SynchDB PostgreSQL Extension¶
With the Java lib
and include
installed in your system, SynchDB can be built by:
1 2 3 |
|
Configure Your Linker (Ubuntu)¶
Lastly, we also need to tell your system's linker where the newly added Java library is located in your system. The following procedure is based on Ubuntu 22.04.
1 2 3 4 5 6 7 8 9 10 |
|
Note, for mac with M1/M2 chips, you need to the two lines into /etc/ld.so.conf.d/aarch64-linux-gnu.conf
1 2 |
|
Run ldconfig to reload:
sudo ldconfig
Check Installation¶
Ensure synchdo.so extension can link to libjvm Java library on your system:
1 2 3 4 5 6 7 8 9 |
|