hapostgres / pg_auto_failover

Postgres extension and service for automated failover and high-availability
Other
1.09k stars 114 forks source link

low prio: ARM packages / Compiling Instructions #863

Closed s4ke closed 2 years ago

s4ke commented 2 years ago

With the recent advancements in ARM performance we are doing some evaluations of ARM compatibility of our stack. Everything works great so far but we haven't tested HA solutions, yet. Besides the big performance improvements, ARM based devices are often used in edge devices and industrial settings.

I noticed that the official citus deb packages do support non x86 architectures and now I am wondering if this is something that could change in the future (at least for pg_auto_failover).

Currently I am evaluating pg_auto_failover on a local Raspberry Pi 4 (4GB) and it seems to compile just fine - I haven't set up a cluster just yet, though.

s4ke commented 2 years ago

As a side note: The list of build dependencies in the readme is not complete it seems. I had to install some more packages on my raspbian/buster:

/usr/bin/ld: cannot find -lselinux
/usr/bin/ld: cannot find -lxslt
/usr/bin/ld: cannot find -lxml2
/usr/bin/ld: cannot find -lpam
/usr/bin/ld: cannot find -ledit
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:78: pg_autoctl] Error 1
make[2]: Leaving directory '/home/ansible/pg_auto_failover/src/bin/pg_autoctl'
make[1]: *** [Makefile:7: pg_autoctl] Error 2
make[1]: Leaving directory '/home/ansible/pg_auto_failover/src/bin'
make: *** [Makefile:127: bin] Error 2

This was fixed by running the apt-get install from the Dockerfile (which probably installed some extra packages that are unnecessary, but worked):

apt-get install -y --no-install-recommends \
    build-essential \
    ca-certificates \
    curl \
    gnupg \
    git \
    iproute2 \
    libicu-dev \
    libkrb5-dev \
    libssl-dev \
    libedit-dev \
    libreadline-dev \
    libpam-dev \
    zlib1g-dev \
    liblz4-dev \
    libxml2-dev \
    libxslt1-dev \
    libselinux1-dev \
    libncurses-dev \
    libncurses6 \
    make \
    openssl \
    pipenv \
    python3-nose \
    python3 \
    python3-setuptools \
    python3-psycopg2 \
    python3-pip \
    sudo \
    tmux \
    watch \
    lsof \
    psutils \
    valgrind \
    postgresql-common
DimCitus commented 2 years ago

Have you tried https://github.com/dimitri/pgaf_debian (see also https://gist.github.com/dimitri/009d2d73499ed2cbb6eeca2ef70d9fda) which is what we use for debian and apt.postgresql.org and where we support 32 bits architectures just fine, including ARM and its variants. See https://packages.debian.org/sid/pg-auto-failover-cli.

s4ke commented 2 years ago

Ah, so this is an issue with this part of the tutorial then?

curl https://install.citusdata.com/community/deb.sh | sudo bash

Because that exits for me saying that it doesn't support ARM. Thanks for the links :)

DimCitus commented 2 years ago

Well the official Citus packages for pg_auto_failover are the ones linked in the tutorial. The community packages for debian are maintained separately, because in debian we want to have 32 bits platform support. So yeah this is all confusing, but I think you'd be better off with the community packages in your case...