Patroni PostgreSQL

Overview

This is a patroni postgresql jail that can be started with pot.

The jail exposes these parameters that can either be set via the environment or by setting the cookparameters (or by editing the downloaded jails pot.conf file):

It is dependent on a consul server/cluster for the DCS store.

Installation

  • Create a ZFS data set on the parent system beforehand: zfs create -o mountpoint=/mnt/postgresqldata zroot/postgresqldata

  • Create your local jail from the image or the flavour files.

  • Mount in the ZFS data set you created: pot mount-in -p <jailname> -m /mnt -d /mnt/postgresqldata

  • Copy in the SSH private key for the user on the Vault leader: pot copy-in -p <jailname> -s /root/sshkey -d /root/sshkey

  • Optionally export the ports after creating the jail: pot export-ports -p <jailname> -e 5432:5432

  • Adjust to your environment:

    sudo pot set-env -p <jailname> -E DATACENTER=<datacentername> \
      -E NODENAME=<nodename> -E IP=<IP address of this node> \
      -E SERVICETAG=<master/replica/standby-leader> \
      -E CONSULSERVERS=<correctly-quoted-array-consul-IPs> \
      -E REMOTELOG=<IP of loki> [-E DNSFORWARDERS=<none|list of IPs>]
    

The SERVICETAG parameter defines if this is master, replica, or standby-leader node in the cluster.

The CONSULSERVERS parameter defines the consul server instances, and must be set as

  • CONSULSERVERS='"10.0.0.2"' or
  • CONSULSERVERS='"10.0.0.2", "10.0.0.3", "10.0.0.4"' or
  • CONSULSERVERS='"10.0.0.2", "10.0.0.3", "10.0.0.4", "10.0.0.5", "10.0.0.6"'

The REMOTELOG parameter is the IP address of a remote syslog server to send logs to, such as for the loki flavour on this site.

The DNSFORWARDERS parameter is a space delimited list of IPs to forward DNS requests to. If set to none or left out, no DNS forwarders are used.

To be documented: Booting the image the first time requires placing various credentials in /mnt/postgrescerts.

Usage

Usage notes

  • The mount-in data set goes to /mnt. This change from /var/db/postgres requires the postgres user’s home directory be updated from the default to this. This is done automatically and will work as long as the mount-in directory is /mnt.
  • You must su to the postgresql user and run psql to interact with PostgreSQL.
  • No default database exists. It will have to be setup or imported.

Verify node or cluster details with

# checks https://localhost:8008/patroni
/root/verifynode.sh
# checks https://localhost:8008/cluster
/root/verifycluster.sh
/usr/local/etc/rc.d/patroni list

Starting over

If you need to reset the cluster, and start from scratch, make sure to remove the kv values in consul. If you don’t the old data will simply be imported to the new cluster.

Getting Started

How To Use The Ready-Made Image

FreeBSD 14.0:
pot import -p postgresql-patroni-amd64-14_0 -t 2.3.1 -U https://potluck.honeyguide.net/postgresql-patroni

With Signify Verification:
fetch https://potluck.honeyguide.net/potluck.pub; pot import -p postgresql-patroni-amd64-14_0 -t 2.3.1 -C potluck.pub -U https://potluck.honeyguide.net/postgresql-patroni

If you don’t want to use the default pot bridged network configuration but instead need an individual network setup (e.g. assign a host IP address), after importing it you can simply clone the jail like that (em0 is the host network adapter in this example):
pot clone -P postgresql-patroni-amd64-14_0 -p my-cloned-jail -N alias -i "em0|10.10.10.10"

Note: Some images might require specific network configuration, double check the Overview-chapter at the top.

Alternatively: Create a Jail With This Flavour Yourself

1. Create Flavour Files

Save all files and directories from https://github.com/hny-gd/potluck/tree/master/postgresql-patroni to /usr/local/etc/pot/flavours/

2. Create Jail From Flavour

Run
pot create -b <FreeBSD Version> -p <jailname> -t single -N public-bridge -f fbsd-update

with your FreeBSD version (e.g. 14.0) and the name your jail should get.

Note: Some images might require specific network configuration, double check the Overview-chapter at the top.

Version History

2.3.1

  • Version bump for FBSD14 base image

2.2.17

  • Log queries that take longer than 100ms without parameters

2.2.16

  • Make consul-template retry more often

2.2.15

  • Update consul configuration to new version
  • Fix _app label in node-exporter

2.2.14

  • Disable QNAME minimization in unbound (consul can’t handle it)

2.2.13

  • Remove outdated consul patch

2.2.12

  • Various fixes, support for backup node

2.2.11

  • Add new parameter DNSFORWARDERS to allow controlling how unbound is configured
  • Add reseason support to allow restarting grafana with fresh credentials
  • Make patroni rc script adapt to the python version used (helps in development)

2.2.10

  • Updating for python39

2.2.9

  • Version bump for layered images

2.2.8

  • Make consul node_names non-FQDN

2.2.7

  • Major rework of templates, certificate issuing, and token/entity/group/role structure

2.2.6

  • Improve metrics collection and image config

2.2.5

  • Merged PR 26, incrementing version in changelog

2.2.4

  • Dummy entry, missing version increment

2.2.3

  • Dummy entry, missing version increment

2.2.2

  • Dummy entry, missing version increment

2.2.1

  • Incrementing version number after pull request 25

2.2.0

  • Many improvements to service mesh components

2.1.9

  • Rebuild for FreeBSD 12_3 and 13 & pot 13

2.1.8

  • Updating version for merge

2.1.7

  • Fixing missing certs directory

2.1.6

  • Adding syslog-ng back

2.1.5

  • Tweaking certificate filenames

2.1.4

  • Adding metrics pki stuff for node_exporter

2.1.3

  • Fixing missing pipes in cook scripts from TTL changes

2.1.2

  • Fixing errors in cook scripts from nomad files

2.1.1

  • Adding TTL parameter for consul template

2.1.0

  • Big hashcluster update for new setup

2.0.24

  • Need to use 127.0.0.1 instead of localhost in the scripts to check patroni status, else TLS fails

2.0.23

  • TLS everywhere for postgresql requires specific permissions on key.pem

2.0.22

  • Fixed the patroni.yml spacing

2.0.21

  • Fixed the README file

2.0.20

  • Encryption all round. Added scripts to check status.

2.0.19

  • Removing sftppass, unsetting consul sysrc parameters where needed

2.0.18

  • General security fixups and removal bad copy-paste entries

2.0.17

  • Tweaking mandatory variables for optional parameters

2.0.16

  • Bug-fix on gossip key

2.0.15

  • Implementing mandatory variables

2.0.14

  • Adding postgres_exporter for prometheus

2.0.13

  • Setup for tls-client-validation

2.0.12

  • README update, turning off flow-control in syslog-ng, setting 120s time_reopen, and reducing log-fifo parameter

2.0.11

  • Clearing syslog-ng /dev/console entries to remove log spam

2.0.10

  • Fixing typo in copy-in, future-proofing

2.0.9

  • Updating syslog-ng and standardised cert.pem key.pem ca.pem

2.0.8

  • Implementing syslog-ng with tls for remote logging

2.0.7

  • Replication password, other updates to improve initdb process such as 0750 perms on /mnt/postgres

2.0.6

  • Vault certificates intgration, pip install of psycopg2 due to conflicts with postgresql-client

2.0.5

  • Updating for persistent postgresql storage

2.0.4

  • Adjusting parameters for node-exporter service

2.0.3

  • Added node_exporter and setup consul service “node-exporter”

2.0.2

  • Consul pre-generated gossip encryption key added

2.0.1

  • Fixing up minor type with trailing comma in consul agent.json setup

2.0

  • Several updates including new postgresql version, better parameter variables

1.0

  • Initial commit with PostgreSQL Patroni configuration that connects to Consul

These images were built on Mon Mar 18 19:19:00 UTC 2024

Manual Image Download Links

postgresql-patroni-amd64-14_0_2.3.1.xz ( )
postgresql-patroni-amd64-14_0_2.3.1.xz.skein ( ) postgresql-patroni-amd64-14_0_2.3.1.xz.skein.sig ( ) postgresql-patroni-amd64-14_0_2.3.1.xz.meta ( )

Jenkins Pot Creation Logs

postgresql-patroni-amd64-14_0_2.3.1:


postgresql-patroni/postgresql-patroni:
copy-in -s /usr/local/etc/pot/flavours/postgresql-patroni.d/local -d /root/.pot_local
postgresql-patroni/postgresql-patroni.sh:
#!/bin/sh

# Based on POTLUCK TEMPLATE v3.0
# Altered by Michael Gmelin
#
# EDIT THE FOLLOWING FOR NEW FLAVOUR:
# 1. RUNS_IN_NOMAD - true or false
# 2. If RUNS_IN_NOMAD is false, can delete the <flavour>+4 file, else
#    make sure pot create command doesn't include it
# 3. Create a matching <flavour> file with this <flavour>.sh file that
#    contains the copy-in commands for the config files from <flavour>.d/
#    Remember that the package directories don't exist yet, so likely copy
#    to /root
# 4. Adjust package installation between BEGIN & END PACKAGE SETUP
# 5. Adjust jail configuration script generation between BEGIN & END COOK
#    Configure the config files that have been copied in where necessary

# Set this to true if this jail flavour is to be created as a nomad
# (i.e. blocking) jail.
# You can then query it in the cook script generation below and the script
# is installed appropriately at the end of this script
RUNS_IN_NOMAD=false

# set the cook log path/filename
COOKLOG=/var/log/cook.log

# check if cooklog exists, create it if not
if [ ! -e $COOKLOG ]
then
    echo "Creating $COOKLOG" | tee -a $COOKLOG
else
    echo "WARNING $COOKLOG already exists"  | tee -a $COOKLOG
fi
date >> $COOKLOG

# -------------------- COMMON ---------------

STEPCOUNT=0
step() {
  STEPCOUNT=$(("$STEPCOUNT" + 1))
  STEP="$*"
  echo "Step $STEPCOUNT: $STEP" | tee -a $COOKLOG
}

exit_ok() {
  trap - EXIT
  exit 0
}

FAILED=" failed"
exit_error() {
  STEP="$*"
  FAILED=""
  exit 1
}

set -e
trap 'echo ERROR: $STEP$FAILED | (>&2 tee -a $COOKLOG)' EXIT

# -------------- BEGIN PACKAGE SETUP -------------

step "Bootstrap package repo"
mkdir -p /usr/local/etc/pkg/repos
# only modify repo if not already done in base image
# shellcheck disable=SC2016
test -e /usr/local/etc/pkg/repos/FreeBSD.conf || \
  echo 'FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly" }' \
    >/usr/local/etc/pkg/repos/FreeBSD.conf
ASSUME_ALWAYS_YES=yes pkg bootstrap

step "Touch /etc/rc.conf"
touch /etc/rc.conf

# this is important, otherwise running /etc/rc from cook will
# overwrite the IP address set in tinirc
step "Remove ifconfig_epair0b from config"
# shellcheck disable=SC2015
sysrc -cq ifconfig_epair0b && sysrc -x ifconfig_epair0b || true

step "Disable sendmail"
service sendmail onedisable

step "Disable sshd"
service sshd onedisable || true

step "Create /usr/local/etc/rc.d"
mkdir -p /usr/local/etc/rc.d

step "Update package repository"
pkg update -f

step "Install package sudo"
pkg install -y sudo

step "Install package openssl"
pkg install -y openssl

step "Install package nginx"
pkg install -y nginx

step "Install package vault"
pkg install -y vault

step "Install package consul"
pkg install -y consul

step "Install package consul-template"
pkg install -y consul-template

step "Patching consul-template rc scripts"
sed -i '' 's/^\(start_precmd=consul_template_startprecmd\)$/\1;'\
'extra_commands=reload/'  /usr/local/etc/rc.d/consul-template || true

step "Install package node_exporter"
pkg install -y node_exporter

step "Install package syslog-ng"
pkg install -y syslog-ng

step "Install package postgresql-server"
pkg install -y postgresql13-server

step "Install package postgresql-client"
pkg install -y postgresql13-client

step "Install package python39"
pkg install -y python39

step "Install package python3-pip"
pkg install -y py39-pip

step "Install package python-consul2"
# this version gives error
pkg install -y py39-python-consul2

# using pip to install this package, as pkg removes postgres13 now,
# and installs postgres12 client as dependency
#step "Install package psycopg2"
#pkg install -y py39-psycopg2

step "Install package jq"
pkg install -y jq

step "Install package jo"
pkg install -y jo

step "Install package curl"
pkg install -y curl

#
# pip MUST ONLY be used:
# * With the --user flag, OR
# * To install or manage Python packages in virtual environments
# using -prefix here to force install in /usr/local/bin

step "Install pip package psycopg2-binary"
pip install psycopg2-binary --prefix="/usr/local/"

step "Install pip package patroni"
pip install patroni --prefix="/usr/local"
#
## WARNING: The scripts patroni, patroni_aws, patroni_raft_controller,
## patroni_wale_restore and patronictl are installed in
## '--prefix=/usr/local/bin' which is not in PATH.
## Consider adding this directory to PATH or, if you prefer to suppress
## this warning, use --no-warn-script-location.

#### Build postgres_exporter - BEGIN
# change to a temporary directory and clone the github repo for
# postgres_exporter
step "Install package git-lite"
pkg install -y git-lite

step "Install package go"
pkg install -y go

step "Install package gmake"
pkg install -y gmake

cd /tmp

step "Fetch postgres_exporter sources"
/usr/local/bin/git clone --depth 1 -b v0.10.1 \
  https://github.com/prometheus-community/postgres_exporter.git
# make sure we're at the correct commit

step "Build postgres_exporter"
cd /tmp/postgres_exporter
# make sure we're at the expected commit
/usr/local/bin/git checkout 6cff384d7433bcb1104efe3b496cd27c0658eb09
/usr/local/bin/gmake build

step "Install postgres_exporter"
sed -i '' 's|-web.listen-address|--web.listen-address|g' \
  /tmp/postgres_exporter/postgres_exporter.rc
sed -i '' 's|sslmode=disable|sslmode=verify-ca|g' \
  /tmp/postgres_exporter/postgres_exporter.rc
# shellcheck disable=SC2016
sed -i '' 's|-p ${pidfile}|-f -p ${pidfile} -T ${name}|g' \
  /tmp/postgres_exporter/postgres_exporter.rc
cp -f /tmp/postgres_exporter/postgres_exporter.rc \
  /usr/local/etc/rc.d/postgres_exporter
chmod +x /usr/local/etc/rc.d/postgres_exporter
cp -f /tmp/postgres_exporter/postgres_exporter \
  /usr/local/bin/postgres_exporter
chmod +x /usr/local/bin/postgres_exporter

step "Clean postgres_exporter build"
rm -rf /tmp/postgres_exporter
pkg delete -y git-lite gmake go

#### Build postgres_exporter - END

step "Clean package installation"
pkg clean -y

# -------------- END PACKAGE SETUP -------------
#
# Create configurations
#

#
# Now generate the run command script "cook"
# It configures the system on the first run by creating the config file(s)
# On subsequent runs, it only starts sleeps (if nomad-jail) or simply exits
#

# this runs when image boots
# ----------------- BEGIN COOK ------------------


step "Clean cook artifacts"
rm -rf /usr/local/bin/cook /usr/local/share/cook

step "Install pot local"
tar -C /root/.pot_local -cf - . | tar -C /usr/local -xf -
rm -rf /root/.pot_local

step "Set file ownership on cook scripts"
chown -R root:wheel /usr/local/bin/cook /usr/local/share/cook
chmod 755 /usr/local/share/cook/bin/*

# ----------------- END COOK ------------------


# ---------- NO NEED TO EDIT BELOW ------------

step "Make cook script executable"
if [ -e /usr/local/bin/cook ]
then
    echo "setting executable bit on /usr/local/bin/cook" | tee -a $COOKLOG
    chmod u+x /usr/local/bin/cook
else
    exit_error "there is no /usr/local/bin/cook to make executable"
fi

#
# There are two ways of running a pot jail: "Normal", non-blocking mode and
# "Nomad", i.e. blocking mode (the pot start command does not return until
# the jail is stopped).
# For the normal mode, we create a /usr/local/etc/rc.d script that starts
# the "cook" script generated above each time, for the "Nomad" mode, the cook
# script is started by pot (configuration through flavour file), therefore
# we do not need to do anything here.
#

# Create rc.d script for "normal" mode:
step "Create rc.d script to start cook"
echo "creating rc.d script to start cook" | tee -a $COOKLOG

# shellcheck disable=SC2016
echo '#!/bin/sh
#
# PROVIDE: cook
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
. /etc/rc.subr
name="cook"
rcvar="cook_enable"
load_rc_config $name
: ${cook_enable:="NO"}
: ${cook_env:=""}
command="/usr/local/bin/cook"
command_args=""
run_rc_command "$1"
' > /usr/local/etc/rc.d/cook

step "Make rc.d script to start cook executable"
if [ -e /usr/local/etc/rc.d/cook ]
then
  echo "Setting executable bit on cook rc file" | tee -a $COOKLOG
  chmod u+x /usr/local/etc/rc.d/cook
else
  exit_error "/usr/local/etc/rc.d/cook does not exist"
fi

if [ "$RUNS_IN_NOMAD" != "true" ]
then
  step "Enable cook service"
  # This is a non-nomad (non-blocking) jail, so we need to make sure the script
  # gets started when the jail is started:
  # Otherwise, /usr/local/bin/cook will be set as start script by the pot
  # flavour
  echo "enabling cook" | tee -a $COOKLOG
  service cook enable
fi

# -------------------- DONE ---------------
exit_ok

postgresql-patroni/postgresql-patroni+1:
postgresql-patroni/postgresql-patroni+1.sh:

postgresql-patroni/postgresql-patroni+2:
postgresql-patroni/postgresql-patroni+2.sh:

postgresql-patroni/postgresql-patroni+3:
postgresql-patroni/postgresql-patroni+3.sh:

postgresql-patroni/postgresql-patroni+4:
postgresql-patroni/postgresql-patroni+4.sh:
=====>  Create conf dir (/mnt/srv/pot/jails/postgresql-patroni-amd64-14_0/conf)
=====>  Cloning freebsd-potluck-amd64-14_0_0_0_22 with snap 
=====>  clone zroot/srv/pot/jails/freebsd-potluck-amd64-14_0_0_0_22/m@1709457007 into zroot/srv/pot/jails/postgresql-patroni-amd64-14_0/m
=====>  Flavour: fbsd-update
=====>  Starting postgresql-patroni-amd64-14_0 pot for the initial bootstrap
=====>  mount /mnt/srv/pot/jails/postgresql-patroni-amd64-14_0/m/tmp
defaultrouter: 10.192.0.1 -> 10.192.0.1
===>  Starting the pot postgresql-patroni-amd64-14_0
=====>  Pot postgresql-patroni-amd64-14_0 jail params are: allow.set_hostname=false allow.raw_sockets allow.socket_af allow.chflags exec.clean mount.devfs enforce_statfs=2 sysvshm=new sysvsem=new sysvmsg=new children.max=0 devfs_ruleset=4 stop.timeout=10 name=postgresql-patroni-amd64-14_0 host.hostname=postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net osrelease=14.0-RELEASE-p5 path=/mnt/srv/pot/jails/postgresql-patroni-amd64-14_0/m persist vnet vnet.interface=epair0b
ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lib/compat/pkg /usr/local/lib/compat/pkg
32-bit compatibility ldconfig path: /usr/lib32
Starting Network: lo0 epair0b.
lo0: flags=1008049<UP,LOOPBACK,RUNNING,MULTICAST,LOWER_UP> metric 0 mtu 16384
	options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
	inet 127.0.0.1 netmask 0xff000000
	inet6 ::1 prefixlen 128
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x6
	groups: lo
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
epair0b: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
	options=8<VLAN_MTU>
	ether 02:7d:84:54:ac:0b
	inet 10.192.0.3 netmask 0xffc00000 broadcast 10.255.255.255
	groups: epair
	media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
	status: active
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
add host 127.0.0.1: gateway lo0 fib 0: route already in table
add net default: gateway 10.192.0.1
add host ::1: gateway lo0 fib 0: route already in table
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
Clearing /tmp (X related).
Updating /var/run/os-release done.
Creating and/or trimming log files.
Updating motd:.
Starting syslogd.
Starting sendmail_submit.
Starting cron.

Mon Mar 18 19:05:10 UTC 2024
/usr/local/etc/pot/flavours/fbsd-update.sh -> /mnt/srv/pot/jails/postgresql-patroni-amd64-14_0/m/tmp/fbsd-update.sh
=====>  Executing fbsd-update script on postgresql-patroni-amd64-14_0
src component not installed, skipped
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching metadata signature for 14.0-RELEASE from update1.freebsd.org... done.
Fetching metadata index... done.
Inspecting system... done.
Preparing to download files... done.

No updates needed to update system to 14.0-RELEASE-p5.
No updates are available to install.
=====>  Stop the pot postgresql-patroni-amd64-14_0
=====>  Remove p465f89064c2a2 epair network interfaces
=====>  unmount /mnt/srv/pot/jails/postgresql-patroni-amd64-14_0/m/tmp
=====>  unmount /mnt/srv/pot/jails/postgresql-patroni-amd64-14_0/m/dev
=====>  Flavour: postgresql-patroni
=====>  Executing postgresql-patroni pot commands on postgresql-patroni-amd64-14_0
=====>  mount /mnt/srv/pot/jails/postgresql-patroni-amd64-14_0/m/tmp
=====>  Source /usr/local/etc/pot/flavours/postgresql-patroni.d/local copied in the pot postgresql-patroni-amd64-14_0
=====>  unmount /mnt/srv/pot/jails/postgresql-patroni-amd64-14_0/m/tmp
=====>  /mnt/srv/pot/jails/postgresql-patroni-amd64-14_0/m/dev is already unmounted
=====>  Starting postgresql-patroni-amd64-14_0 pot for the initial bootstrap
=====>  mount /mnt/srv/pot/jails/postgresql-patroni-amd64-14_0/m/tmp
defaultrouter: 10.192.0.1 -> 10.192.0.1
===>  Starting the pot postgresql-patroni-amd64-14_0
=====>  Pot postgresql-patroni-amd64-14_0 jail params are: allow.set_hostname=false allow.raw_sockets allow.socket_af allow.chflags exec.clean mount.devfs enforce_statfs=2 sysvshm=new sysvsem=new sysvmsg=new children.max=0 devfs_ruleset=4 stop.timeout=10 name=postgresql-patroni-amd64-14_0 host.hostname=postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net osrelease=14.0-RELEASE-p5 path=/mnt/srv/pot/jails/postgresql-patroni-amd64-14_0/m persist vnet vnet.interface=epair0b
ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lib/compat/pkg /usr/local/lib/compat/pkg
32-bit compatibility ldconfig path: /usr/lib32
Starting Network: lo0 epair0b.
lo0: flags=1008049<UP,LOOPBACK,RUNNING,MULTICAST,LOWER_UP> metric 0 mtu 16384
	options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
	inet 127.0.0.1 netmask 0xff000000
	inet6 ::1 prefixlen 128
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x6
	groups: lo
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
epair0b: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
	options=8<VLAN_MTU>
	ether 02:4d:d1:03:53:0b
	inet 10.192.0.3 netmask 0xffc00000 broadcast 10.255.255.255
	groups: epair
	media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
	status: active
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
add host 127.0.0.1: gateway lo0 fib 0: route already in table
add net default: gateway 10.192.0.1
add host ::1: gateway lo0 fib 0: route already in table
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
Clearing /tmp (X related).
Updating /var/run/os-release done.
Creating and/or trimming log files.
Updating motd:.
Starting syslogd.
Starting sendmail_submit.
Starting cron.

Mon Mar 18 19:05:43 UTC 2024
/usr/local/etc/pot/flavours/postgresql-patroni.sh -> /mnt/srv/pot/jails/postgresql-patroni-amd64-14_0/m/tmp/postgresql-patroni.sh
=====>  Executing postgresql-patroni script on postgresql-patroni-amd64-14_0
WARNING /var/log/cook.log already exists
Step 1: Bootstrap package repo
pkg already bootstrapped at /usr/local/sbin/pkg
Step 2: Touch /etc/rc.conf
Step 3: Remove ifconfig_epair0b from config
Step 4: Disable sendmail
sendmail disabled in /etc/rc.conf
sendmail_submit disabled in /etc/rc.conf
sendmail_msp_queue disabled in /etc/rc.conf
Step 5: Disable sshd
sshd disabled in /etc/rc.conf
Step 6: Create /usr/local/etc/rc.d
Step 7: Update package repository
Updating FreeBSD repository catalogue...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] Fetching meta.conf: . done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] Fetching packagesite.pkg: .......... done
Processing entries: .......... done
FreeBSD repository update completed. 33718 packages processed.
All repositories are up to date.
Step 8: Install package sudo
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed
Step 9: Install package openssl
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed
Step 10: Install package nginx
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	nginx: 1.24.0_14,3
	pcre2: 10.42

Number of packages to be installed: 2

The process will require 8 MiB more space.
2 MiB to be downloaded.
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/2] Fetching nginx-1.24.0_14,3.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [2/2] Fetching pcre2-10.42.pkg: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/2] Installing pcre2-10.42...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/2] Extracting pcre2-10.42: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [2/2] Installing nginx-1.24.0_14,3...
===> Creating groups.
Using existing group 'www'.
===> Creating users
Using existing user 'www'.
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [2/2] Extracting nginx-1.24.0_14,3: .......... done
=====
Message from nginx-1.24.0_14,3:

--
Recent version of the NGINX introduces dynamic modules support.  In
FreeBSD ports tree this feature was enabled by default with the DSO
knob.  Several vendor's and third-party modules have been converted
to dynamic modules.  Unset the DSO knob builds an NGINX without
dynamic modules support.

To load a module at runtime, include the new `load_module'
directive in the main context, specifying the path to the shared
object file for the module, enclosed in quotation marks.  When you
reload the configuration or restart NGINX, the module is loaded in.
It is possible to specify a path relative to the source directory,
or a full path, please see
https://www.nginx.com/blog/dynamic-modules-nginx-1-9-11/ and
http://nginx.org/en/docs/ngx_core_module.html#load_module for
details.

Default path for the NGINX dynamic modules is

/usr/local/libexec/nginx.
Step 11: Install package vault
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	vault: 1.14.1_1

Number of packages to be installed: 1

The process will require 179 MiB more space.
37 MiB to be downloaded.
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/1] Fetching vault-1.14.1_1.pkg: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/1] Installing vault-1.14.1_1...
===> Creating groups.
Creating group 'vault' with gid '471'.
===> Creating users
Creating user 'vault' with uid '471'.
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/1] Extracting vault-1.14.1_1: ..... done
=====
Message from vault-1.14.1_1:

--
The vault user created by the vault package is now a member of the daemon
class, which will allow it to use mlock() when started by the rc script. This
will not be reflected in systems where the user already exists. Please add the
vault user to the daemon class manually by running:

pw usermod -L daemon -n vault

or delete the user and reinstall the package.

You may also need to increase memorylocked for the daemon class in
/etc/rc.conf to more than 1024M (the default) or more:

vault_limits_mlock="2048M"

Or to disable mlock, add:

disable_mlock = 1

to /usr/local/etc/vault.hcl
Step 12: Install package consul
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	consul: 1.17.1_1

Number of packages to be installed: 1

The process will require 118 MiB more space.
23 MiB to be downloaded.
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/1] Fetching consul-1.17.1_1.pkg: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/1] Installing consul-1.17.1_1...
===> Creating groups.
Creating group 'consul' with gid '469'.
===> Creating users
Creating user 'consul' with uid '469'.
===> Creating homedir(s)
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/1] Extracting consul-1.17.1_1: ..... done
Step 13: Install package consul-template
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	consul-template: 0.36.0

Number of packages to be installed: 1

The process will require 12 MiB more space.
4 MiB to be downloaded.
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/1] Fetching consul-template-0.36.0.pkg: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/1] Installing consul-template-0.36.0...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/1] Extracting consul-template-0.36.0: ..... done
Step 14: Patching consul-template rc scripts
Step 15: Install package node_exporter
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	node_exporter: 1.6.1_1

Number of packages to be installed: 1

The process will require 11 MiB more space.
4 MiB to be downloaded.
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/1] Fetching node_exporter-1.6.1_1.pkg: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/1] Installing node_exporter-1.6.1_1...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/1] Extracting node_exporter-1.6.1_1: .......... done
=====
Message from node_exporter-1.6.1_1:

--
If upgrading from a version of node_exporter <0.15.0 you'll need to update any
custom command line flags that you may have set as it now requires a
double-dash (--flag) instead of a single dash (-flag).
The collector flags in 0.15.0 have now been replaced with individual boolean
flags and the -collector.procfs` and -collector.sysfs` flags have been renamed
to --path.procfs and --path.sysfs respectively.
Step 16: Install package syslog-ng
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 9 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	e2fsprogs-libuuid: 1.47.0
	glib: 2.78.3,2
	ivykis: 0.42.4_1
	json-c: 0.17
	libffi: 3.4.4
	libxml2: 2.10.4_2
	mpdecimal: 2.5.1
	python39: 3.9.18
	syslog-ng: 4.4.0

Number of packages to be installed: 9

The process will require 158 MiB more space.
25 MiB to be downloaded.
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/9] Fetching ivykis-0.42.4_1.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [2/9] Fetching libxml2-2.10.4_2.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [3/9] Fetching mpdecimal-2.5.1.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [4/9] Fetching python39-3.9.18.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [5/9] Fetching glib-2.78.3,2.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [6/9] Fetching syslog-ng-4.4.0.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [7/9] Fetching libffi-3.4.4.pkg: ......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [8/9] Fetching json-c-0.17.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [9/9] Fetching e2fsprogs-libuuid-1.47.0.pkg: ....... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/9] Installing mpdecimal-2.5.1...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/9] Extracting mpdecimal-2.5.1: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [2/9] Installing libffi-3.4.4...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [2/9] Extracting libffi-3.4.4: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [3/9] Installing libxml2-2.10.4_2...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [3/9] Extracting libxml2-2.10.4_2: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [4/9] Installing python39-3.9.18...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [4/9] Extracting python39-3.9.18: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [5/9] Installing ivykis-0.42.4_1...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [5/9] Extracting ivykis-0.42.4_1: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [6/9] Installing glib-2.78.3,2...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [6/9] Extracting glib-2.78.3,2: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [7/9] Installing json-c-0.17...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [7/9] Extracting json-c-0.17: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [8/9] Installing e2fsprogs-libuuid-1.47.0...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [8/9] Extracting e2fsprogs-libuuid-1.47.0: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [9/9] Installing syslog-ng-4.4.0...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [9/9] Extracting syslog-ng-4.4.0: .......... done
==> Running trigger: glib-schemas.ucl
Compiling glib schemas
No schema files found: doing nothing.
==> Running trigger: gio-modules.ucl
Generating GIO modules cache
=====
Message from python39-3.9.18:

--
Note that some standard Python modules are provided as separate ports
as they require additional dependencies. They are available as:

py39-gdbm       databases/py-gdbm@py39
py39-sqlite3    databases/py-sqlite3@py39
py39-tkinter    x11-toolkits/py-tkinter@py39
=====
Message from syslog-ng-4.4.0:

--
syslog-ng is now installed!  To replace FreeBSD's standard syslogd
(/usr/sbin/syslogd), complete these steps:

1. Create a configuration file named /usr/local/etc/syslog-ng.conf
   (a sample named syslog-ng.conf.sample has been included in
   /usr/local/etc). Note that this is a change in 2.0.2
   version, previous ones put the config file in
   /usr/local/etc/syslog-ng/syslog-ng.conf, so if this is an update
   move that file in the right place

2. Configure syslog-ng to start automatically by adding the following
   to /etc/rc.conf:

        syslog_ng_enable="YES"

3. Prevent the standard FreeBSD syslogd from starting automatically by
   adding a line to the end of your /etc/rc.conf file that reads:

        syslogd_enable="NO"

4. Shut down the standard FreeBSD syslogd:

     kill `cat /var/run/syslog.pid`

5. Start syslog-ng:

     /usr/local/etc/rc.d/syslog-ng start
Step 17: Install package postgresql-server
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 7 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	icu: 74.2,1
	libedit: 3.1.20230828,1
	llvm15: 15.0.7_9
	lua53: 5.3.6
	perl5: 5.36.3_1
	postgresql13-client: 13.13
	postgresql13-server: 13.13_2

Number of packages to be installed: 7

The process will require 1 GiB more space.
195 MiB to be downloaded.
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/7] Fetching postgresql13-client-13.13.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [2/7] Fetching libedit-3.1.20230828,1.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [3/7] Fetching postgresql13-server-13.13_2.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [4/7] Fetching lua53-5.3.6.pkg: ........ done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [5/7] Fetching icu-74.2,1.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [6/7] Fetching llvm15-15.0.7_9.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [7/7] Fetching perl5-5.36.3_1.pkg: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/7] Installing libedit-3.1.20230828,1...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/7] Extracting libedit-3.1.20230828,1: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [2/7] Installing lua53-5.3.6...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [2/7] Extracting lua53-5.3.6: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [3/7] Installing perl5-5.36.3_1...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [3/7] Extracting perl5-5.36.3_1: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [4/7] Installing postgresql13-client-13.13...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [4/7] Extracting postgresql13-client-13.13: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [5/7] Installing icu-74.2,1...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [5/7] Extracting icu-74.2,1: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [6/7] Installing llvm15-15.0.7_9...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [6/7] Extracting llvm15-15.0.7_9: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [7/7] Installing postgresql13-server-13.13_2...
===> Creating groups.
Creating group 'postgres' with gid '770'.
===> Creating users
Creating user 'postgres' with uid '770'.
===> Creating homedir(s)

  =========== BACKUP YOUR DATA! =============
  As always, backup your data before
  upgrading. If the upgrade leads to a higher
  major revision (e.g. 9.6 -> 10), a dump
  and restore of all databases is
  required. This is *NOT* done by the port!
  See https://www.postgresql.org/docs/current/upgrading.html
  ===========================================
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [7/7] Extracting postgresql13-server-13.13_2: .......... done
=====
Message from postgresql13-client-13.13:

--
The PostgreSQL port has a collection of "side orders":

postgresql-docs
  For all of the html documentation

p5-Pg
  A perl5 API for client access to PostgreSQL databases.

postgresql-tcltk 
  If you want tcl/tk client support.

postgresql-jdbc
  For Java JDBC support.

postgresql-odbc
  For client access from unix applications using ODBC as access
  method. Not needed to access unix PostgreSQL servers from Win32
  using ODBC. See below.

ruby-postgres, py-psycopg2
  For client access to PostgreSQL databases using the ruby & python
  languages.

postgresql-plperl, postgresql-pltcl & postgresql-plruby
  For using perl5, tcl & ruby as procedural languages.

postgresql-contrib
  Lots of contributed utilities, postgresql functions and
  datatypes. There you find pg_standby, pgcrypto and many other cool
  things.

etc...
=====
Message from postgresql13-server-13.13_2:

--
For procedural languages and postgresql functions, please note that
you might have to update them when updating the server.

If you have many tables and many clients running, consider raising
kern.maxfiles using sysctl(8), or reconfigure your kernel
appropriately.

The port is set up to use autovacuum for new databases, but you might
also want to vacuum and perhaps backup your database regularly. There
is a periodic script, /usr/local/etc/periodic/daily/502.pgsql, that
you may find useful. You can use it to backup and perform vacuum on all
databases nightly. Per default, it performs `vacuum analyze'. See the
script for instructions. For autovacuum settings, please review
~postgres/data/postgresql.conf.

If you plan to access your PostgreSQL server using ODBC, please
consider running the SQL script /usr/local/share/postgresql/odbc.sql
to get the functions required for ODBC compliance.

Please note that if you use the rc script,
/usr/local/etc/rc.d/postgresql, to initialize the database, unicode
(UTF-8) will be used to store character data by default.  Set
postgresql_initdb_flags or use login.conf settings described below to
alter this behaviour. See the start rc script for more info.

To set limits, environment stuff like locale and collation and other
things, you can set up a class in /etc/login.conf before initializing
the database. Add something similar to this to /etc/login.conf:
---
postgres:\
	:lang=en_US.UTF-8:\
	:setenv=LC_COLLATE=C:\
	:tc=default:
---
and run `cap_mkdb /etc/login.conf'.
Then add 'postgresql_login_class="postgres"' to /etc/rc.conf.

======================================================================

To initialize the database, run

  /usr/local/etc/rc.d/postgresql initdb

You can then start PostgreSQL by running:

  /usr/local/etc/rc.d/postgresql start

For postmaster settings, see ~postgres/data/postgresql.conf

NB. FreeBSD's PostgreSQL port logs to syslog by default
    See ~postgres/data/postgresql.conf for more info

NB. If you're not using a checksumming filesystem like ZFS, you might
    wish to enable data checksumming. It can be enabled during
    the initdb phase, by adding the "--data-checksums" flag to
    the postgresql_initdb_flags rcvar. Otherwise you can enable it later by
    pg_checksums.  Check the initdb(1) manpage for more info
    and make sure you understand the performance implications.

======================================================================

To run PostgreSQL at startup, add
'postgresql_enable="YES"' to /etc/rc.conf
Step 18: Install package postgresql-client
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed
Step 19: Install package python39
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed
Step 20: Install package python3-pip
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	py39-pip: 23.3.2
	py39-setuptools: 63.1.0_1

Number of packages to be installed: 2

The process will require 27 MiB more space.
4 MiB to be downloaded.
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/2] Fetching py39-pip-23.3.2.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [2/2] Fetching py39-setuptools-63.1.0_1.pkg: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/2] Installing py39-setuptools-63.1.0_1...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/2] Extracting py39-setuptools-63.1.0_1: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [2/2] Installing py39-pip-23.3.2...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [2/2] Extracting py39-pip-23.3.2: .......... done
=====
Message from py39-pip-23.3.2:

--
pip MUST ONLY be used:

 * With the --user flag, OR
 * To install or manage Python packages in virtual environments

Failure to follow this warning can and will result in an inconsistent
system-wide Python environment (LOCALBASE/lib/pythonX.Y/site-packages) and
cause errors.

Avoid using pip as root unless you know what you're doing.
Step 21: Install package python-consul2
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 8 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	py39-certifi: 2023.11.17
	py39-charset-normalizer: 3.3.2
	py39-idna: 3.6
	py39-pysocks: 1.7.1
	py39-python-consul2: 0.1.5
	py39-requests: 2.31.0
	py39-six: 1.16.0
	py39-urllib3: 1.26.18,1

Number of packages to be installed: 8

The process will require 3 MiB more space.
677 KiB to be downloaded.
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/8] Fetching py39-python-consul2-0.1.5.pkg: ......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [2/8] Fetching py39-six-1.16.0.pkg: ....... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [3/8] Fetching py39-urllib3-1.26.18,1.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [4/8] Fetching py39-charset-normalizer-3.3.2.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [5/8] Fetching py39-certifi-2023.11.17.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [6/8] Fetching py39-requests-2.31.0.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [7/8] Fetching py39-pysocks-1.7.1.pkg: ..... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [8/8] Fetching py39-idna-3.6.pkg: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/8] Installing py39-pysocks-1.7.1...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/8] Extracting py39-pysocks-1.7.1: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [2/8] Installing py39-urllib3-1.26.18,1...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [2/8] Extracting py39-urllib3-1.26.18,1: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [3/8] Installing py39-charset-normalizer-3.3.2...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [3/8] Extracting py39-charset-normalizer-3.3.2: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [4/8] Installing py39-certifi-2023.11.17...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [4/8] Extracting py39-certifi-2023.11.17: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [5/8] Installing py39-idna-3.6...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [5/8] Extracting py39-idna-3.6: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [6/8] Installing py39-six-1.16.0...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [6/8] Extracting py39-six-1.16.0: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [7/8] Installing py39-requests-2.31.0...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [7/8] Extracting py39-requests-2.31.0: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [8/8] Installing py39-python-consul2-0.1.5...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [8/8] Extracting py39-python-consul2-0.1.5: .......... done
=====
Message from py39-urllib3-1.26.18,1:

--
Since version 1.25 HTTPS connections are now verified by default which is done
via "cert_reqs = 'CERT_REQUIRED'".  While certificate verification can be
disabled via "cert_reqs = 'CERT_NONE'", it's highly recommended to leave it on.

Various consumers of net/py-urllib3 already have implemented routines that
either explicitly enable or disable HTTPS certificate verification (e.g. via
configuration settings, CLI arguments, etc.).

Yet it may happen that there are still some consumers which don't explicitly
enable/disable certificate verification for HTTPS connections which could then
lead to errors (as is often the case with self-signed certificates).

In case of an error one should try first to temporarily disable certificate
verification of the problematic urllib3 consumer to see if that approach will
remedy the issue.
Step 22: Install package jq
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed
Step 23: Install package jo
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed
Step 24: Install package curl
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed
Step 25: Install pip package psycopg2-binary
Collecting psycopg2-binary
  Downloading psycopg2-binary-2.9.9.tar.gz (384 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 385.0/385.0 kB 436.2 kB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Building wheels for collected packages: psycopg2-binary
  Building wheel for psycopg2-binary (pyproject.toml): started
  Building wheel for psycopg2-binary (pyproject.toml): finished with status 'done'
  Created wheel for psycopg2-binary: filename=psycopg2_binary-2.9.9-cp39-cp39-freebsd_14_0_release_p5_amd64.whl size=157176 sha256=c82454e778e8652fcb1f890e3a3c8ccebf5d687993011632c5a948e464d01024
  Stored in directory: /root/.cache/pip/wheels/5d/df/4c/2c25d8dacbe58040f4a910b9304baaafbc720618452720337a
Successfully built psycopg2-binary
Installing collected packages: psycopg2-binary
Successfully installed psycopg2-binary-2.9.9
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Step 26: Install pip package patroni
Collecting patroni
  Downloading patroni-3.2.2-py3-none-any.whl.metadata (11 kB)
Requirement already satisfied: urllib3!=1.21,>=1.19.1 in /usr/local/lib/python3.9/site-packages (from patroni) (1.26.18)
Collecting PyYAML (from patroni)
  Downloading PyYAML-6.0.1.tar.gz (125 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 125.2/125.2 kB 1.7 MB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Collecting click>=4.1 (from patroni)
  Downloading click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Collecting prettytable>=0.7 (from patroni)
  Downloading prettytable-3.10.0-py3-none-any.whl.metadata (30 kB)
Collecting python-dateutil (from patroni)
  Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
Collecting psutil>=2.0.0 (from patroni)
  Downloading psutil-5.9.8.tar.gz (503 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 503.2/503.2 kB 6.2 MB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Collecting ydiff>=1.2.0 (from patroni)
  Downloading ydiff-1.2.tar.gz (42 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.8/42.8 kB 1.2 MB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Collecting wcwidth (from prettytable>=0.7->patroni)
  Downloading wcwidth-0.2.13-py2.py3-none-any.whl.metadata (14 kB)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.9/site-packages (from python-dateutil->patroni) (1.16.0)
Downloading patroni-3.2.2-py3-none-any.whl (317 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 318.0/318.0 kB 10.6 MB/s eta 0:00:00
Downloading click-8.1.7-py3-none-any.whl (97 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.9/97.9 kB 3.5 MB/s eta 0:00:00
Downloading prettytable-3.10.0-py3-none-any.whl (28 kB)
Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 229.9/229.9 kB 8.0 MB/s eta 0:00:00
Downloading wcwidth-0.2.13-py2.py3-none-any.whl (34 kB)
Building wheels for collected packages: psutil, ydiff, PyYAML
  Building wheel for psutil (pyproject.toml): started
  Building wheel for psutil (pyproject.toml): finished with status 'done'
  Created wheel for psutil: filename=psutil-5.9.8-cp39-cp39-freebsd_14_0_release_p5_amd64.whl size=257059 sha256=071ece42705c36895ee1dfa34be47e5c2d07bfed340424befdea1c186d4a519b
  Stored in directory: /root/.cache/pip/wheels/b2/34/a0/a3d8471a2850f9fcba93e560104dc7e6161e31fe72ac3d2b8b
  Building wheel for ydiff (pyproject.toml): started
  Building wheel for ydiff (pyproject.toml): finished with status 'done'
  Created wheel for ydiff: filename=ydiff-1.2-py3-none-any.whl size=16628 sha256=6f6b230987d1afdbb85b37091df28ec4b7aaea2101663bdbdc1853b01d6c2a03
  Stored in directory: /root/.cache/pip/wheels/d5/76/ce/f3933d358dc34e20107f21a5a3c853917bea3f4e20d91a02d3
  Building wheel for PyYAML (pyproject.toml): started
  Building wheel for PyYAML (pyproject.toml): finished with status 'done'
  Created wheel for PyYAML: filename=PyYAML-6.0.1-cp39-cp39-freebsd_14_0_release_p5_amd64.whl size=45373 sha256=2d9fa57e1f8c30813375ccf7924cc4374d1630bacc5c4ea1739051de6a32c7f7
  Stored in directory: /root/.cache/pip/wheels/1c/ff/88/3a317d1db793206ab64cb66367bf6f84186b75849656be786a
Successfully built psutil ydiff PyYAML
Installing collected packages: ydiff, wcwidth, PyYAML, python-dateutil, psutil, prettytable, click, patroni
Successfully installed PyYAML-6.0.1 click-8.1.7 patroni-3.2.2 prettytable-3.10.0 psutil-5.9.8 python-dateutil-2.9.0.post0 wcwidth-0.2.13 ydiff-1.2
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Step 27: Install package git-lite
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	expat: 2.5.0
	git-lite: 2.43.0

Number of packages to be installed: 2

The process will require 34 MiB more space.
6 MiB to be downloaded.
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/2] Fetching expat-2.5.0.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [2/2] Fetching git-lite-2.43.0.pkg: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/2] Installing expat-2.5.0...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/2] Extracting expat-2.5.0: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [2/2] Installing git-lite-2.43.0...
===> Creating groups.
Creating group 'git_daemon' with gid '964'.
===> Creating users
Creating user 'git_daemon' with uid '964'.
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [2/2] Extracting git-lite-2.43.0: .......... done
=====
Message from git-lite-2.43.0:

--
If you installed the GITWEB option please follow these instructions:

In the directory /usr/local/share/examples/git/gitweb you can find all files to
make gitweb work as a public repository on the web.

All you have to do to make gitweb work is:
1) Please be sure you're able to execute CGI scripts in
   /usr/local/share/examples/git/gitweb.
2) Set the GITWEB_CONFIG variable in your webserver's config to
   /usr/local/etc/git/gitweb.conf. This variable is passed to gitweb.cgi.
3) Restart server.


If you installed the CONTRIB option please note that the scripts are
installed in /usr/local/share/git-core/contrib. Some of them require
other ports to be installed (perl, python, etc), which you may need to
install manually.
Step 28: Install package go
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	go: 1.20,2
	go120: 1.20.12

Number of packages to be installed: 2

The process will require 200 MiB more space.
41 MiB to be downloaded.
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/2] Fetching go-1.20,2.pkg: . done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [2/2] Fetching go120-1.20.12.pkg: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/2] Installing go120-1.20.12...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/2] Extracting go120-1.20.12: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [2/2] Installing go-1.20,2...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [2/2] Extracting go-1.20,2: .. done
Step 29: Install package gmake
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	gmake: 4.3_2

Number of packages to be installed: 1

The process will require 2 MiB more space.
447 KiB to be downloaded.
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/1] Fetching gmake-4.3_2.pkg: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/1] Installing gmake-4.3_2...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/1] Extracting gmake-4.3_2: .......... done
Step 30: Fetch postgres_exporter sources
Cloning into 'postgres_exporter'...
Note: switching to '6cff384d7433bcb1104efe3b496cd27c0658eb09'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

Step 31: Build postgres_exporter
HEAD is now at 6cff384 Merge pull request #600 from prometheus-community/superq/0.10.1
curl -s -L https://github.com/prometheus/promu/releases/download/v0.13.0/promu-0.13.0.freebsd-amd64.tar.gz | tar -xvzf - -C /tmp/tmp.w13d7aG4lI
x promu-0.13.0.freebsd-amd64/
x promu-0.13.0.freebsd-amd64/LICENSE
x promu-0.13.0.freebsd-amd64/NOTICE
x promu-0.13.0.freebsd-amd64/promu
mkdir -p /root/go/bin
cp /tmp/tmp.w13d7aG4lI/promu-0.13.0.freebsd-amd64/promu /root/go/bin/promu
rm -r /tmp/tmp.w13d7aG4lI
>> building binaries
GO111MODULE=on /root/go/bin/promu build --prefix /tmp/postgres_exporter 
 >   postgres_exporter
go: downloading github.com/blang/semver v3.5.1+incompatible
go: downloading github.com/go-kit/log v0.2.0
go: downloading github.com/lib/pq v1.10.4
go: downloading github.com/prometheus/client_golang v1.11.0
go: downloading github.com/prometheus/common v0.32.1
go: downloading github.com/prometheus/exporter-toolkit v0.7.1
go: downloading gopkg.in/alecthomas/kingpin.v2 v2.2.6
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/go-logfmt/logfmt v0.5.1
go: downloading github.com/pkg/errors v0.9.1
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/cespare/xxhash/v2 v2.1.1
go: downloading github.com/golang/protobuf v1.4.3
go: downloading github.com/prometheus/client_model v0.2.0
go: downloading github.com/prometheus/procfs v0.6.0
go: downloading github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
go: downloading github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d
go: downloading golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e
go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.1
go: downloading google.golang.org/protobuf v1.26.0-rc.1
go: downloading github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f
go: downloading golang.org/x/net v0.0.0-20210525063256-abc453219eb5
go: downloading golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c
go: downloading golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1
go: downloading github.com/jpillora/backoff v1.0.0
go: downloading golang.org/x/text v0.3.6
Step 32: Install postgres_exporter
Step 33: Clean postgres_exporter build
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 3 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
	git-lite: 2.43.0
	gmake: 4.3_2
	go: 1.20,2

Number of packages to be removed: 3

The operation will free 36 MiB.
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/3] Deinstalling go-1.20,2...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [1/3] Deleting files for go-1.20,2: .. done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [2/3] Deinstalling gmake-4.3_2...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [2/3] Deleting files for gmake-4.3_2: .......... done
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [3/3] Deinstalling git-lite-2.43.0...
[postgresql-patroni-amd64-14_0.vsf00001.cpt.za.honeyguide.net] [3/3] Deleting files for git-lite-2.43.0: .......... done
==> You should manually remove the "git_daemon" user. 
==> You should manually remove the "git_daemon" group 
Step 34: Clean package installation
Nothing to do.
Step 35: Clean cook artifacts
Step 36: Install pot local
Step 37: Set file ownership on cook scripts
Step 38: Make cook script executable
setting executable bit on /usr/local/bin/cook
Step 39: Create rc.d script to start cook
creating rc.d script to start cook
Step 40: Make rc.d script to start cook executable
Setting executable bit on cook rc file
Step 41: Enable cook service
enabling cook
cook enabled in /etc/rc.conf
=====>  Stop the pot postgresql-patroni-amd64-14_0
=====>  Remove p465f89086c2a2 epair network interfaces
=====>  unmount /mnt/srv/pot/jails/postgresql-patroni-amd64-14_0/m/tmp
=====>  unmount /mnt/srv/pot/jails/postgresql-patroni-amd64-14_0/m/dev
===>  exporting postgresql-patroni-amd64-14_0 @ 1710789025 to /tmp/postgresql-patroni-amd64-14_0_2.3.1.xz
xz: Reduced the number of threads from 4 to 3 to not exceed the memory usage limit of 503 MiB

This site © Honeyguide Group (Pty) Ltd, all the hosted software their respective license owners 2020 - 2021 - Disclaimer