public inbox for [email protected]
help / color / mirror / Atom feedIssues with systemd unit file for repmgr
3+ messages / 2 participants
[nested] [flat]
* Issues with systemd unit file for repmgr
@ 2015-06-29 04:00 Simon Oxwell <[email protected]>
2015-07-05 14:56 ` Re: Issues with systemd unit file for repmgr Devrim GÜNDÜZ <[email protected]>
0 siblings, 1 reply; 3+ messages in thread
From: Simon Oxwell @ 2015-06-29 04:00 UTC (permalink / raw)
To: pgsql-pkg-yum; +Cc: saas <[email protected]>
Hi,
Firstly, I'd like to thank the team for the hard work done in packaging
Postgresql and all the associated ecosystem. It's great stuff and had
saved me heaps of time in the last couple of weeks.
That said, I am having trouble with the systemd unit file for repmgrd
[1]. I'm using the repmgr94 package, version 3.0.1-1 on CentOS7 (so the
RHEL7 flavour). It basically doesn't work, due to a misplaced quote mark
and a kill command that seems to have an issue.
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?
Thanks,
Simon
[1]
http://git.postgresql.org/gitweb/?p=pgrpms.git;a=blob;f=rpm/redhat/9.4/repmgr/EL-7/repmgr-9.4.servic...
--
Simon Oxwell | Hosting Team
Funnelback
P: +61 2 6176 3170 | F: +61 2 6230 7313
[email protected] | www.funnelback.com
A: Ground Floor, 51 Allara Street, Civic, Canberra 2601
--
Sent via pgsql-pkg-yum mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-pkg-yum
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Issues with systemd unit file for repmgr
2015-06-29 04:00 Issues with systemd unit file for repmgr Simon Oxwell <[email protected]>
@ 2015-07-05 14:56 ` Devrim GÜNDÜZ <[email protected]>
2015-07-14 06:04 ` Re: Issues with systemd unit file for repmgr Simon Oxwell <[email protected]>
0 siblings, 1 reply; 3+ messages in thread
From: Devrim GÜNDÜZ @ 2015-07-05 14:56 UTC (permalink / raw)
To: Simon Oxwell <[email protected]>; pgsql-pkg-yum; +Cc: saas <[email protected]>
Hi,
On Mon, 2015-06-29 at 14:00 +1000, Simon Oxwell wrote:
> Firstly, I'd like to thank the team for the hard work done in
> packaging
> Postgresql and all the associated ecosystem. It's great stuff and had
> saved me heaps of time in the last couple of weeks.
You are welcome!
> That said, I am having trouble with the systemd unit file for repmgrd
> [1]. I'm using the repmgr94 package, version 3.0.1-1 on CentOS7 (so
> the RHEL7 flavour). It basically doesn't work, due to a misplaced
> quote mark and a kill command that seems to have an issue.
:-(
> 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.
Regards,
--
Devrim GÜNDÜZ
Principal Systems Engineer @ EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR
--
Sent via pgsql-pkg-yum mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-pkg-yum
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Issues with systemd unit file for repmgr
2015-06-29 04:00 Issues with systemd unit file for repmgr Simon Oxwell <[email protected]>
2015-07-05 14:56 ` Re: Issues with systemd unit file for repmgr Devrim GÜNDÜZ <[email protected]>
@ 2015-07-14 06:04 ` Simon Oxwell <[email protected]>
0 siblings, 0 replies; 3+ messages in thread
From: Simon Oxwell @ 2015-07-14 06:04 UTC (permalink / raw)
To: Devrim GÜNDÜZ <[email protected]>; pgsql-pkg-yum; +Cc: saas <[email protected]>
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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2015-07-14 06:04 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-06-29 04:00 Issues with systemd unit file for repmgr Simon Oxwell <[email protected]>
2015-07-05 14:56 ` Devrim GÜNDÜZ <[email protected]>
2015-07-14 06:04 ` Simon Oxwell <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox