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 cook
parameters (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"'
orCONSULSERVERS='"10.0.0.2", "10.0.0.3", "10.0.0.4"'
orCONSULSERVERS='"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
- Image Readme
- How To Use The Ready-Made Image
- Alternatively: Create a Jail With This Flavour Yourself
- Version History
- Manual Image Download Links
- Jenkins Pot Creation Logs
How To Use The Ready-Made Image
FreeBSD 14.0:
pot import -p postgresql-patroni-amd64-14_0 -t 2.4.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.4.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.4.1
- Version bump for new base image
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 Tue Jul 2 17:18:56 UTC 2024
Manual Image Download Links
postgresql-patroni-amd64-14_0_2.4.1.xz (
)
postgresql-patroni-amd64-14_0_2.4.1.xz.skein (
)
postgresql-patroni-amd64-14_0_2.4.1.xz.skein.sig (
)
postgresql-patroni-amd64-14_0_2.4.1.xz.meta (
)
Jenkins Pot Creation Logs
postgresql-patroni-amd64-14_0_2.4.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_25 with snap
=====> clone zroot/srv/pot/jails/freebsd-potluck-amd64-14_0_0_0_25/m@1719860171 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.vsf00002.cpt.za.honeyguide.net osrelease=14.0-RELEASE-p8 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:ea:06:14:2c: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.
Tue Jul 2 17:07:47 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 update2.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-p8.
No updates are available to install.
=====> Stop the pot postgresql-patroni-amd64-14_0
=====> Remove p4668433e214ba2 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.vsf00002.cpt.za.honeyguide.net osrelease=14.0-RELEASE-p8 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:6b:e5:0c:e2: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.
Tue Jul 2 17:08:19 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.vsf00002.cpt.za.honeyguide.net] Fetching meta.conf: . done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] Fetching data.pkg: .......... done
Processing entries: .......... done
FreeBSD repository update completed. 34081 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_16,3
pcre2: 10.43
Number of packages to be installed: 2
The process will require 9 MiB more space.
2 MiB to be downloaded.
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/2] Fetching nginx-1.24.0_16,3.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [2/2] Fetching pcre2-10.43.pkg: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/2] Installing pcre2-10.43...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/2] Extracting pcre2-10.43: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [2/2] Installing nginx-1.24.0_16,3...
===> Creating groups.
Using existing group 'www'.
===> Creating users
Using existing user 'www'.
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [2/2] Extracting nginx-1.24.0_16,3: .......... done
=====
Message from nginx-1.24.0_16,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_6
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.vsf00002.cpt.za.honeyguide.net] [1/1] Fetching vault-1.14.1_6.pkg: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/1] Installing vault-1.14.1_6...
===> Creating groups.
Creating group 'vault' with gid '471'.
===> Creating users
Creating user 'vault' with uid '471'.
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/1] Extracting vault-1.14.1_6: ..... done
=====
Message from vault-1.14.1_6:
--
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.18.1_3
Number of packages to be installed: 1
The process will require 121 MiB more space.
24 MiB to be downloaded.
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/1] Fetching consul-1.18.1_3.pkg: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/1] Installing consul-1.18.1_3...
===> Creating groups.
Creating group 'consul' with gid '469'.
===> Creating users
Creating user 'consul' with uid '469'.
===> Creating homedir(s)
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/1] Extracting consul-1.18.1_3: ..... 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.37.4_1
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.vsf00002.cpt.za.honeyguide.net] [1/1] Fetching consul-template-0.37.4_1.pkg: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/1] Installing consul-template-0.37.4_1...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/1] Extracting consul-template-0.37.4_1: ..... 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_6
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.vsf00002.cpt.za.honeyguide.net] [1/1] Fetching node_exporter-1.6.1_6.pkg: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/1] Installing node_exporter-1.6.1_6...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/1] Extracting node_exporter-1.6.1_6: .......... done
=====
Message from node_exporter-1.6.1_6:
--
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.80.3,2
ivykis: 0.43_1
json-c: 0.17
libffi: 3.4.4_1
mpdecimal: 4.0.0
py39-packaging: 23.2
python39: 3.9.18_2
syslog-ng: 4.6.0_2
Number of packages to be installed: 9
The process will require 151 MiB more space.
24 MiB to be downloaded.
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/9] Fetching ivykis-0.43_1.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [2/9] Fetching mpdecimal-4.0.0.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [3/9] Fetching python39-3.9.18_2.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [4/9] Fetching glib-2.80.3,2.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [5/9] Fetching syslog-ng-4.6.0_2.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [6/9] Fetching libffi-3.4.4_1.pkg: ........ done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [7/9] Fetching py39-packaging-23.2.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [8/9] Fetching json-c-0.17.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [9/9] Fetching e2fsprogs-libuuid-1.47.0.pkg: ....... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/9] Installing mpdecimal-4.0.0...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/9] Extracting mpdecimal-4.0.0: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [2/9] Installing libffi-3.4.4_1...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [2/9] Extracting libffi-3.4.4_1: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [3/9] Installing python39-3.9.18_2...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [3/9] Extracting python39-3.9.18_2: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [4/9] Installing py39-packaging-23.2...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [4/9] Extracting py39-packaging-23.2: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [5/9] Installing ivykis-0.43_1...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [5/9] Extracting ivykis-0.43_1: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [6/9] Installing glib-2.80.3,2...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [6/9] Extracting glib-2.80.3,2: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [7/9] Installing json-c-0.17...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [7/9] Extracting json-c-0.17: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [8/9] Installing e2fsprogs-libuuid-1.47.0...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [8/9] Extracting e2fsprogs-libuuid-1.47.0: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [9/9] Installing syslog-ng-4.6.0_2...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [9/9] Extracting syslog-ng-4.6.0_2: .......... done
==> Running trigger: gio-modules.ucl
Generating GIO modules cache
==> Running trigger: glib-schemas.ucl
Compiling glib schemas
No schema files found: doing nothing.
=====
Message from python39-3.9.18_2:
--
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.6.0_2:
--
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,1
libedit: 3.1.20230828_1,1
llvm15: 15.0.7_10
lua53: 5.3.6_1
perl5: 5.36.3_1
postgresql13-client: 13.14
postgresql13-server: 13.14
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.vsf00002.cpt.za.honeyguide.net] [1/7] Fetching postgresql13-client-13.14.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [2/7] Fetching libedit-3.1.20230828_1,1.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [3/7] Fetching postgresql13-server-13.14.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [4/7] Fetching lua53-5.3.6_1.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [5/7] Fetching icu-74.2_1,1.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [6/7] Fetching llvm15-15.0.7_10.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [7/7] Fetching perl5-5.36.3_1.pkg: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/7] Installing libedit-3.1.20230828_1,1...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/7] Extracting libedit-3.1.20230828_1,1: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [2/7] Installing lua53-5.3.6_1...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [2/7] Extracting lua53-5.3.6_1: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [3/7] Installing perl5-5.36.3_1...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [3/7] Extracting perl5-5.36.3_1: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [4/7] Installing postgresql13-client-13.14...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [4/7] Extracting postgresql13-client-13.14: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [5/7] Installing icu-74.2_1,1...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [5/7] Extracting icu-74.2_1,1: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [6/7] Installing llvm15-15.0.7_10...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [6/7] Extracting llvm15-15.0.7_10: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [7/7] Installing postgresql13-server-13.14...
===> 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.vsf00002.cpt.za.honeyguide.net] [7/7] Extracting postgresql13-server-13.14: .......... done
=====
Message from postgresql13-client-13.14:
--
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.14:
--
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, or
set it as the postgres user's login class in /etc/passwd.
======================================================================
To use PostgreSQL, enable it in rc.conf using
sysrc postgresql_enable=yes
To initialize the database, run
service postgresql initdb
You can then start PostgreSQL by running:
service 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.
======================================================================
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_1
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.vsf00002.cpt.za.honeyguide.net] [1/2] Fetching py39-pip-23.3.2_1.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.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.vsf00002.cpt.za.honeyguide.net] [1/2] Installing py39-setuptools-63.1.0_1...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/2] Extracting py39-setuptools-63.1.0_1: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [2/2] Installing py39-pip-23.3.2_1...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [2/2] Extracting py39-pip-23.3.2_1: .......... done
=====
Message from py39-pip-23.3.2_1:
--
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: 2024.2.2
py39-charset-normalizer: 3.3.2
py39-idna: 3.7
py39-pysocks: 1.7.1
py39-python-consul2: 0.1.5
py39-requests: 2.32.2
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.
685 KiB to be downloaded.
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/8] Fetching py39-python-consul2-0.1.5.pkg: ......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [2/8] Fetching py39-six-1.16.0.pkg: ..... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [3/8] Fetching py39-urllib3-1.26.18,1.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [4/8] Fetching py39-charset-normalizer-3.3.2.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [5/8] Fetching py39-certifi-2024.2.2.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [6/8] Fetching py39-requests-2.32.2.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [7/8] Fetching py39-pysocks-1.7.1.pkg: ..... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [8/8] Fetching py39-idna-3.7.pkg: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/8] Installing py39-pysocks-1.7.1...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/8] Extracting py39-pysocks-1.7.1: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [2/8] Installing py39-urllib3-1.26.18,1...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [2/8] Extracting py39-urllib3-1.26.18,1: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [3/8] Installing py39-charset-normalizer-3.3.2...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [3/8] Extracting py39-charset-normalizer-3.3.2: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [4/8] Installing py39-certifi-2024.2.2...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [4/8] Extracting py39-certifi-2024.2.2: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [5/8] Installing py39-idna-3.7...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [5/8] Extracting py39-idna-3.7: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [6/8] Installing py39-six-1.16.0...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [6/8] Extracting py39-six-1.16.0: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [7/8] Installing py39-requests-2.32.2...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [7/8] Extracting py39-requests-2.32.2: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [8/8] Installing py39-python-consul2-0.1.5...
[postgresql-patroni-amd64-14_0.vsf00002.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 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'
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_p8_amd64.whl size=157174 sha256=4b15a1b0f2af5bfff2defe5f4e20806128daa10ffabbaf357efe81472cf6b2c4
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.3.1-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 2.6 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-6.0.0.tar.gz (508 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 508.1/508.1 kB 7.4 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.3.tar.gz (74 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 74.1/74.1 kB 984.7 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'
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.3.1-py3-none-any.whl (340 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 340.2/340.2 kB 7.9 MB/s eta 0:00:00
Downloading click-8.1.7-py3-none-any.whl (97 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.9/97.9 kB 2.6 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 7.7 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-6.0.0-cp39-cp39-freebsd_14_0_release_p8_amd64.whl size=259322 sha256=53a27cffdbcad475237194a60d9a9cdc85989d4c2c76e57c0f7e341d0eba2a75
Stored in directory: /root/.cache/pip/wheels/76/1f/ff/be2a91abd34fa0da2843e59a2de5255e493387e6eaa214fa25
Building wheel for ydiff (pyproject.toml): started
Building wheel for ydiff (pyproject.toml): finished with status 'done'
Created wheel for ydiff: filename=ydiff-1.3-py3-none-any.whl size=15431 sha256=ab7a91b4176d40788b7e8351224923cee280da41e127a2ac795623b0e4274623
Stored in directory: /root/.cache/pip/wheels/30/05/ba/dd7a2a35dbce3f2390cf362b1dddfd7d0a66ec92b95dcc5747
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_p8_amd64.whl size=45374 sha256=b3ee6b0d039c081965b98cdcccd0030e763009de5bb273d9ddefd20946e4c38e
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.3.1 prettytable-3.10.0 psutil-6.0.0 python-dateutil-2.9.0.post0 wcwidth-0.2.13 ydiff-1.3
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.6.2
git-lite: 2.45.2_1
Number of packages to be installed: 2
The process will require 35 MiB more space.
6 MiB to be downloaded.
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/2] Fetching expat-2.6.2.pkg: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [2/2] Fetching git-lite-2.45.2_1.pkg: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/2] Installing expat-2.6.2...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/2] Extracting expat-2.6.2: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [2/2] Installing git-lite-2.45.2_1...
===> Creating groups.
Creating group 'git_daemon' with gid '964'.
===> Creating users
Creating user 'git_daemon' with uid '964'.
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [2/2] Extracting git-lite-2.45.2_1: .......... done
=====
Message from git-lite-2.45.2_1:
--
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.21_3,2
go121: 1.21.11
Number of packages to be installed: 2
The process will require 206 MiB more space.
42 MiB to be downloaded.
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/2] Fetching go-1.21_3,2.pkg: . done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [2/2] Fetching go121-1.21.11.pkg: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/2] Installing go121-1.21.11...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/2] Extracting go121-1.21.11: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [2/2] Installing go-1.21_3,2...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [2/2] Extracting go-1.21_3,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.4.1
Number of packages to be installed: 1
The process will require 2 MiB more space.
486 KiB to be downloaded.
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/1] Fetching gmake-4.4.1.pkg: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/1] Installing gmake-4.4.1...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/1] Extracting gmake-4.4.1: .......... 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.kzTEFrQsyY
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.kzTEFrQsyY/promu-0.13.0.freebsd-amd64/promu /root/go/bin/promu
rm -r /tmp/tmp.kzTEFrQsyY
>> 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 golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e
go: downloading github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
go: downloading github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d
go: downloading google.golang.org/protobuf v1.26.0-rc.1
go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.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.45.2_1
gmake: 4.4.1
go: 1.21_3,2
Number of packages to be removed: 3
The operation will free 37 MiB.
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/3] Deinstalling go-1.21_3,2...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [1/3] Deleting files for go-1.21_3,2: .. done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [2/3] Deinstalling gmake-4.4.1...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [2/3] Deleting files for gmake-4.4.1: .......... done
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [3/3] Deinstalling git-lite-2.45.2_1...
[postgresql-patroni-amd64-14_0.vsf00002.cpt.za.honeyguide.net] [3/3] Deleting files for git-lite-2.45.2_1: .......... 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 p46684340214ba2 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 @ 1719940381 to /tmp/postgresql-patroni-amd64-14_0_2.4.1.xz