public inbox for [email protected]
help / color / mirror / Atom feedFrom: Simon Oxwell <[email protected]>
To: Devrim GÜNDÜZ <[email protected]>
To: [email protected]
Cc: saas <[email protected]>
Subject: Re: Issues with systemd unit file for repmgr
Date: Tue, 14 Jul 2015 16:04:17 +1000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgsql-pkg-yum>
On 6/07/2015 12:56 am, Devrim GÜNDÜZ wrote:
>> After a bit of hacking, I've got a version that's working and is a
>> little more flexible with some some of the extra command line options
>> of repmgrd. What's the best way of sharing it back to team? As a
>> patch file or as a pull request?
> You can do both, I personally prefer the patch in the mailing list.
>
>
Hi Devrim,
I also ran into problems with repmgrd running as the repmgr user that
gets created in the specfile. It was unable to promote the standby
database to a master, because it wasn't running at the postgres user.
All the of the examples that are part of the documentation for repmgr
specify running them as the postgres user.
As a result my unit file runs repmgrd as postgres. I did have to chown
/var/log/repmgr to be owned by postgres:postgres as the specfile creates
it as repmgr:repmgr.
Other changes:
* moved most of the environment variables out to a sysconfig file
(/etc/sysconfig/repmgr94). This let me change options as well,
rather than having to edit the unit file. Much easier to be able to
manipulate with something like puppet, and can be sourced by the
SysV init script as well.
* used a PIDFile directive. This unfortunately required hardcoding the
location of the PID file twice in the unit file, as PIDFile only
takes an absolute pathname or it throws an error. Without this,
systemd can't seem to guess the PID correctly when it comes to
shutting down.
Hope this is of use.
The other issue I have is that repmgr can't actually parse the sample
config file that the package makes the default config file, but I'm
working on a patch to submit to 2nd Quadrant for that.
(Just for reference, I'm using the repmgr94 package with Postgresql94)
Thanks,
Simon
# Configuration file for repmgrd
# Location of the repmgr config file
REPMGRDCONF=/etc/repmgr/9.4/repmgr.conf
# Location of the rempgrd log file
REPMGRDLOG=/var/log/repmgr/repmgrd-9.4.log
# repmgrd options (eg --monitoring-history, --verbose)
REPMGROPTS=""
# It's not recommended to modify this file in-place, because it will be
# overwritten during package upgrades. If you want to customize, the
# best way is to create a file "/etc/systemd/system/repmgr.service",
# containing
# .include /lib/systemd/system/repmgr.service
# ...make your changes here...
# For more info about custom unit files, see
# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
[Unit]
Description=A replication manager, and failover management tool for PostgreSQL
After=syslog.target
After=network.target
[Service]
Type=forking
User=postgres
Group=postgres
EnvironmentFile=/etc/sysconfig/repmgr94
PIDFile=/var/run/repmgr/repmgrd-9.4.pid
# Where to send early-startup messages from the server
# This is normally controlled by the global default set by systemd
# StandardOutput=syslog
ExecStart=/usr/pgsql-9.4/bin/repmgrd -f ${REPMGRDCONF} -p /var/run/repmgr/repmgrd-9.4.pid ${REPMGROPTS} -d > ${REPMGRDLOG} 2>&1
ExecStop=/usr/bin/kill -TERM ${MAINPID}
ExecReload=/usr/bin/kill -HUP ${MAINPID}
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=300
[Install]
WantedBy=multi-user.target
--
Sent via pgsql-pkg-yum mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-pkg-yum
Attachments:
[text/plain] repmgr94 (260B, 3-repmgr94)
download | inline:
# Configuration file for repmgrd
# Location of the repmgr config file
REPMGRDCONF=/etc/repmgr/9.4/repmgr.conf
# Location of the rempgrd log file
REPMGRDLOG=/var/log/repmgr/repmgrd-9.4.log
# repmgrd options (eg --monitoring-history, --verbose)
REPMGROPTS=""
[text/plain] repmgr94.service (1.2K, 4-repmgr94.service)
download | inline:
# It's not recommended to modify this file in-place, because it will be
# overwritten during package upgrades. If you want to customize, the
# best way is to create a file "/etc/systemd/system/repmgr.service",
# containing
# .include /lib/systemd/system/repmgr.service
# ...make your changes here...
# For more info about custom unit files, see
# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
[Unit]
Description=A replication manager, and failover management tool for PostgreSQL
After=syslog.target
After=network.target
[Service]
Type=forking
User=postgres
Group=postgres
EnvironmentFile=/etc/sysconfig/repmgr94
PIDFile=/var/run/repmgr/repmgrd-9.4.pid
# Where to send early-startup messages from the server
# This is normally controlled by the global default set by systemd
# StandardOutput=syslog
ExecStart=/usr/pgsql-9.4/bin/repmgrd -f ${REPMGRDCONF} -p /var/run/repmgr/repmgrd-9.4.pid ${REPMGROPTS} -d > ${REPMGRDLOG} 2>&1
ExecStop=/usr/bin/kill -TERM ${MAINPID}
ExecReload=/usr/bin/kill -HUP ${MAINPID}
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=300
[Install]
WantedBy=multi-user.target
view thread (3+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Issues with systemd unit file for repmgr
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox