for Fedora 40
dnf install postgresql-server
for Fedora 40, this will install PostgreSQL 15
dnf install git gcc cmake make postgresql-server-devel
This process is optional. If you choose not to generate the PDF and HTML files, you can opt out of downloading these dependencies, and the process will automatically skip the generation.
-
Download dependencies
dnf install pandoc texlive-scheme-basic
-
Download Eisvogel
Use the command
pandoc --version
to locate the user data directory. On Fedora systems, this directory is typically located at/root/.local/share/pandoc
.Download the
Eisvogel
template forpandoc
, please visit the pandoc-latex-template repository. For a standard installation, you can follow the steps outlined below.wget https://github.com/Wandmalfarbe/pandoc-latex-template/releases/download/2.4.2/Eisvogel-2.4.2.tar.gz tar -xzf Eisvogel-2.4.2.tar.gz mkdir /root/.local/share/pandoc # user data directory mkdir /root/.local/share/pandoc/templates mv eisvogel.latex /root/.local/share/pandoc/templates/
-
Add package for latex
Download the additional packages required for generating PDF and HTML files.
dnf install 'tex(footnote.sty)' 'tex(footnotebackref.sty)' 'tex(pagecolor.sty)' 'tex(hardwrap.sty)' 'tex(mdframed.sty)' 'tex(sourcesanspro.sty)' 'tex(ly1enc.def)' 'tex(sourcecodepro.sty)' 'tex(titling.sty)' 'tex(csquotes.sty)' 'tex(zref-abspage.sty)' 'tex(needspace.sty)'
Open a new window, switch to the postgres
user.
sudo su -
su - postgres
For Fedora, if you use dnf
to install your postgresql, chances are the binary file is in /usr/bin/
export PATH=/usr/bin:$PATH
initdb /tmp/pgsql
Since we initialized the database in /tmp
, the data in this directory might be removed after you go offline, depending on your OS configuration. If you want to make it permanent, choose a different directory.
git clone https://github.com/pgmoneta/pgmoneta_ext
cd pgmoneta_ext
mkdir build
cd build
cmake ..
make
sudo make install
Our project, pgmoneta_ext
, is primarily designed for pgmoneta
to perform delta backups. To ensure pgmoneta_ext
functions properly, we should use repl
to test all extension functions and verify they work correctly with pgmoneta
.
If you have already set up the repl
role, you can skip this section.
Remove last lines from /tmp/pgsql/pg_hba.conf
. The path mentioned can be found using the SQL command SHOW hba_file;
.
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
host replication all 127.0.0.1/32 trust
host replication all ::1/128 trust
Add new lines to /tmp/pgsql/pg_hba.conf
host postgres repl 127.0.0.1/32 scram-sha-256
host postgres repl ::1/128 scram-sha-256
host replication repl 127.0.0.1/32 scram-sha-256
host replication repl ::1/128 scram-sha-256
Set password_encryption
value in /tmp/pgsql/postgresql.conf
to be scram-sha-256
password_encryption = scram-sha-256
For version 13, the default is md5
, while for version 14 and above, it is scram-sha-256
. Therefore, you should ensure that the value in /tmp/pgsql/postgresql.conf
matches the value in /tmp/pgsql/pg_hba.conf
.
Set wal_level value in /tmp/pgsql/postgresql.conf
to be replica
wal_level = replica
pg_ctl -D /tmp/pgsql/ start
Here, you may encounter issues such as the port being occupied or permission being denied. If you experience a failure, you can go to /tmp/pgsql/log
to check the reason.
You can use
pg_isready
to test
psql postgres
CREATE ROLE repl WITH LOGIN REPLICATION PASSWORD 'secretpassword';
\q
Add the required replication slot
psql postgres
SELECT pg_create_physical_replication_slot('repl', true, false);
\q
Here, the command in the context of pgmoneta
is used to create a replication slot to manage and retain WAL segments necessary for replication and backup operations, ensuring data consistency and reliability.
For more details, please check the pgmoneta.
For the role repl
(pgmoneta) use secretpassword
psql -h localhost -p 5432 -U repl postgres
\q
Since some functions require the role to have superuser privileges, you can grant these privileges to the repl
role using the following SQL command. Please proceed with caution: granting superuser privileges bypasses all permission checks, allowing unrestricted access to the database, which can pose security risks. We are committed to enhancing privilege security in future updates.
ALTER ROLE repl WITH SUPERUSER;
The following SQL command can revoke the superuser privileges:
ALTER USER repl WITH NOSUPERUSER;
If you just want to verify if pgmoneta_ext was installed successfully, you can use the postgres
role to test.
-
Log into PostgreSQL
psql
-
Create a new test database
CREATE DATABASE testdb;
-
Enter the database
\c testdb
-
Follow the SQL commands below to check the function
DROP EXTENSION IF EXISTS pgmoneta_ext; CREATE EXTENSION pgmoneta_ext; SELECT pgmoneta_ext_version();
You should see
pgmoneta_ext_version
----------------------
0.1.0
(1 row)
If you encounter any errors, you can check the log to find the reason. The log's location can be found in the postgresql.conf
file.
# These are only used if logging_collector is on:
log_directory = 'log' # directory where log files are written,
# can be absolute or relative to PGDATA
log_filename = 'postgresql-%a.log' # log file name pattern,
# can include strftime() escapes