File Hierarchy
CA FHS
Pigsty’s self-signed CA is located on directory under pigsty home.
YOU HAVE TO SECURE THE CA KEY PROPERLY: files/pki/ca/ca.key
, which is generated by the ca role during install.yml
or infra.yml
.
# pigsty/files/pki
# ^-----@ca # self-signed CA key & cert
# ^-----@ca.key # VERY IMPORTANT: keep it secret
# ^-----@ca.crt # VERY IMPORTANT: trusted everywhere
# ^-----@csr # signing request csr
# ^-----@misc # misc certs, issued certs
# ^-----@etcd # etcd server certs
# ^-----@minio # minio server certs
# ^-----@nginx # nginx SSL certs
# ^-----@infra # infra client certs
# ^-----@pgsql # pgsql server certs
The prometheus bin / rules are located on files/prometheus/ directory under pigsty home.
While the main config file is located on and rendered to /etc/prometheus/prometheus.yml
on infra nodes.
#------------------------------------------------------------------------------
# Config FHS
#------------------------------------------------------------------------------
# /etc/prometheus/
# ^-----prometheus.yml # prometheus main config file
# ^-----@bin # util scripts: check,reload,status,new
# ^-----@rules # record & alerting rules definition
# ^-----infra.yml # infra rules & alert
# ^-----node.yml # node rules & alert
# ^-----pgsql.yml # pgsql rules & alert
# ^-----redis.yml # redis rules & alert
# ^-----etcd.yml # etcd rules & alert
# ^-----@targets # file based service discovery targets definition
# ^-----@node # nodes static targets definition
# ^-----@etcd # etcd static targets definition
# ^-----@minio # minio static targets definition
# ^-----@ping # blackbox ping targets definition
# ^-----@pgsql # pgsql static targets definition
# ^-----@redis # redis static targets definition
# ^-----@..... # other targets
# /etc/alertmanager.yml # alertmanager main config file
# /etc/blackbox.yml # blackbox exporter main config file
#------------------------------------------------------------------------------
Postgres FHS
- : Postgres default user’s home dir, default is
/var/lib/pgsql
. - pg_bin_dir: Postgres binary dir, defaults to
/usr/pgsql/bin/
. - : Postgres database dir, default is
/pg/data
. - pg_fs_main: Postgres main data disk mount point, default is
/data
. - : Postgres backup disk mount point, default is
/data/backups
(used when using local backup repo).
Data FHS
# basic
{{ pg_fs_main }} /data # top level data directory, usually a SSD mountpoint
{{ pg_dir_main }} /data/postgres # contains postgres data
{{ pg_cluster_dir }} /data/postgres/pg-test-15 # contains cluster `pg-test` data (of version 13)
/data/postgres/pg-test-15/bin # bin scripts
/data/postgres/pg-test-15/log # logs: postgres/pgbouncer/patroni/pgbackrest
/data/postgres/pg-test-15/tmp # tmp, sql files, rendered results
/data/postgres/pg-test-15/cert # postgres server certificates
/data/postgres/pg-test-15/conf # patroni config, links to related config
/data/postgres/pg-test-15/data # main data directory
/data/postgres/pg-test-15/stat # stats information, summary, log report
/data/postgres/pg-test-15/change # changing records
/data/postgres/pg-test-15/backup # soft link to backup dir
{{ pg_fs_bkup }} /data/backups # could be a cheap & large HDD mountpoint
/var/backups/postgres/pg-test-15/backup # local backup repo path
# links
/pg -> /data/postgres/pg-test-15 # pg root link
/pg/data -> /data/postgres/pg-test-15/data # real data dir
/pg/backup -> /var/backups/postgres/pg-test-15/backup # base backup
Binary FHS
On EL releases, the default path for PostgreSQL bin is:
/usr/pgsql-${pg_version}/
Pigsty will create a softlink /usr/pgsql
to the currently installed version specified by pg_version.
export PATH="/usr/pgsql/bin:/pg/bin:$PATH"
export PGHOME=/usr/pgsql
export PGDATA=/pg/data
Pgbouncer is run using the Postgres user, and the config file is located in /etc/pgbouncer
. The config file includes.
pgbouncer.ini
: pgbouncer main configdatabase.txt
: pgbouncer database listuserlist.txt
: pgbouncer user listuseropts.txt
: pgbouncer user options (user-level parameter overrides)pgb_hba.conf
: lists the access privileges of the connection pool users
Redis FHS
Pigsty provides essential support for Redis deployment and monitoring.
Redis binaries are installed in /bin/
using RPM-packages or copied binaries, including:
redis-server
redis-server
redis-cli
redis-sentinel
redis-check-rdb
redis-check-aof
redis-benchmark
For a Redis instance named redis-test-1-6379
, the resources associated with it are shown below: