Overview

PostgreSQL-XL and later installment of the PostgreSQL code.Unlike the PostgreSQL-XC PostgreSQL-XL is more suitable for OLAP/Warehouse systems since it is tightly linked with SQL and Parallel execution. We will discuss the following stages of installing the PostgreSQL-XL cluster. For clarity reasons, let's assume we have the following instances:

Software Installation

There are many ways how you can download / install PostgreSQL-XL cluster, but the safest way is to use GIT, so let's do it like this :)

Using Git

Git client should be firstly installed so we can download the needed packages:

Prerequisites

We have to add the “postgres” user:

Compiler

Don't forget to install the C compiler as well:

Otherwise you will have the following error, when you try to compile the packages from GIT.

Don't forget to install install the following packages:

Cloning the Repository

Now we can start to clone the repository, with the postgres user:

Compilation

Once all the packages are clone we can compile them:

Finish

Compile and install the packages as follows:

Compile

Install

By default PostgreSQL will install on: /usr/local/pgsql/

Check

Repeat this on the rest of the nodes :)

Database Installation

In order to start our cluster configuration we should do couple things:

Compile PGXC_CTL utility

Disable/edit firewalld

Edit the SeLinux

Configure passwordless connection between host1 and the rest

Initialize the cluster

Compile pgxc_ctl utility

This package is located at: “/home/postgres/postgres-xl/contrib/pgxc_ctl”

Firstly, enter there as posgres and compile this as follows:

After this, install the package with root as follows:

Disable/Edit firewall

To disable/edit the firewall just turn off and disable the “firewalld” demon as follows:

This will also disable the SeLinux policy to permissive. Repeat that for the rest of the nodes

Edit SeLinux

Edit the /etc/selinux/config file as follows:

Configure passwordless connection

In order to do that, we have to create RSA public key and ship it to the other nodes. Furthermore, the directory and file permissions should be specific. Otherwise, it won't work if you give them too many permissions as well.

Initialize the cluster

In order to initialize our cluster we have to execute the pgxc_ctl ONCE on host1 so it will create the: /home/postgres/pgxc_ctl directory. PostgreSQL-XL uses this as default directory for it's configuration files. Create a new file called: “pgxc_ctl.conf” with the following values (according your configuration)

After all this :) We can start the initialization as follows:

Congrats, you have a brand new PostgreSQL-XL cluster