Skip to content

Commit 85c3dc1

Browse files
authored
Merge pull request #2 from fidanf/add-systemd-start
Add systemd start
2 parents 7486c34 + e38d6ec commit 85c3dc1

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ PgPool
55

66
Installs and configures PgPool-II for Debian/Ubuntu. The default _running mode_ is **streaming replication mode**.
77

8+
- [PgPool](#pgpool)
9+
- [Requirements](#requirements)
10+
- [Role Variables](#role-variables)
11+
- [Dependencies](#dependencies)
12+
- [Example Playbook](#example-playbook)
13+
- [Configuration checking commands](#configuration-checking-commands)
14+
- [PCP commands](#pcp-commands)
15+
- [Handling server reboots](#handling-server-reboots)
16+
- [License](#license)
17+
818
Requirements
919
------------
1020

@@ -110,6 +120,20 @@ Display PgPool's cluster status
110120
pcp_watchdog_info -h 127.0.0.1 -U pgpool -w -v
111121
```
112122

123+
Handling server reboots
124+
-----------------------
125+
126+
Although using the recommended paths from the official documentation, socket directories seems to have unsufficient privileges to be able to recreate PIDs upon server reboots.
127+
128+
If you're running PgPool and PostgreSQL on the same servers, you may use the following configuration instead which solves the problem :
129+
130+
```yaml
131+
pgpool_pid_file_name: /var/run/postgresql/pgpool.pid
132+
pgpool_socket_dir: /var/run/postgresql
133+
pgpool_pcp_socket_dir: /var/run/postgresql
134+
pgpool_wd_ipc_socket_dir: /var/run/postgresql
135+
```
136+
113137
More details at : https://www.pgpool.net/docs/latest/en/html/pcp-commands.html
114138
115139
License

defaults/main.yml

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ pgpool_postgresql_service_group: postgres
1919
pgpool_postgres_password_cleartext: postgres
2020
pgpool_postgresql_home_directory: /var/lib/postgresql
2121
pgpool_postgresql_data_directory: "{{ pgpool_postgresql_home_directory }}/{{ pgpool_postgresql_version }}/{{ pgpool_postgresql_cluster_name }}"
22+
# systemd
23+
pgpool_systemd_state: started
24+
pgpool_systemd_enabled: yes
2225

2326
# pgpool user
2427
pgpool_home_directory: /etc/pgpool2

tasks/_systemd.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
- name: Start Pg-Pool II
3+
systemd:
4+
name: pgpool2
5+
state: "{{ pgpool_systemd_state }}"
6+
enabled: "{{ pgpool_systemd_enabled }}"

tasks/main.yml

+3
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@
2626

2727
- import_tasks: _scripts.yml
2828
tags: ['scripts']
29+
30+
- import_tasks: _systemd.yml
31+
tags: ['systemd']

0 commit comments

Comments
 (0)