Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-docs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nicolas Dandrimont
swh-docs
Commits
2d18b26b
Commit
2d18b26b
authored
7 months ago
by
Nicolas Dandrimont
Browse files
Options
Downloads
Patches
Plain Diff
Update winery frontend documentation
parent
476583b7
Branches
mr/winery-frontend
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/sysadm/data-silos/winery/procedures/frontends.rst
+11
-117
11 additions, 117 deletions
docs/sysadm/data-silos/winery/procedures/frontends.rst
with
11 additions
and
117 deletions
docs/sysadm/data-silos/winery/procedures/frontends.rst
+
11
−
117
View file @
2d18b26b
.. _winery-proc-frontends:
Frontend
s
procedures
===================
=
Frontend procedures
===================
.. admonition:: Intended audience
:class: important
sysadm staff members
P
acemaker maintenance mode
---------------------
-----
P
ostgreSQL management
---------------------
In maintenance mode, pacemaker will not attempt to manage the service or switch the ips from one
node to another
.
PostgreSQL is handled using the `patroni`_ high-availability template, with
`consul`_ as a distributed configuration store
.
.. _winery-pacemaker-maintenance:
.. _patroni: https://patroni.readthedocs.io/en/latest/
.. _consul: https://developer.hashicorp.com/consul/docs
- Force the maintenance mode
.. code-block:: shell
crm_attribute --name maintenance-mode --update true
- Go back to the nominal mode
.. code-block:: shell
crm_attribute --name maintenance-mode --delete
- check the status
Nominal mode:
.. code-block:: shell
root@gloin001:~# crm status
Status of pacemakerd: 'Pacemaker is running' (last updated 2024-03-06 18:45:31 +01:00)
Cluster Summary:
* Stack: corosync
* Current DC: gloin001 (version 2.1.5-a3f44794f94) - MIXED-VERSION partition with quorum
* Last updated: Wed Mar 6 18:45:31 2024
* Last change: Wed Mar 6 18:45:27 2024 by root via crm_attribute on gloin001
* 2 nodes configured
* 4 resource instances configured
Node List:
* Online: [ gloin001 gloin002 ]
Full List of Resources:
* r_vip_pub (ocf:heartbeat:IPaddr2): Started gloin001
* r_vip_ha (ocf:heartbeat:IPaddr2): Started gloin001
* Clone Set: ha_postgresql [r_postgresql] (promotable):
* Promoted: [ gloin001 ]
* Unpromoted: [ gloin002 ]
..
In maintenance:
.. code-block:: shell
root@gloin001:~# crm status
Status of pacemakerd: 'Pacemaker is running' (last updated 2024-03-06 18:43:58 +01:00)
Cluster Summary:
* Stack: corosync
* Current DC: gloin001 (version 2.1.5-a3f44794f94) - MIXED-VERSION partition with quorum
* Last updated: Wed Mar 6 18:43:58 2024
* Last change: Wed Mar 6 18:41:47 2024 by root via crm_attribute on gloin001
* 2 nodes configured
* 4 resource instances configured
*** Resource management is DISABLED ***
The cluster will not attempt to start, stop or recover services
Node List:
* Online: [ gloin001 gloin002 ]
Full List of Resources:
* r_vip_pub (ocf:heartbeat:IPaddr2): Started gloin001 (unmanaged)
* r_vip_ha (ocf:heartbeat:IPaddr2): Started gloin001 (unmanaged)
* Clone Set: ha_postgresql [r_postgresql] (promotable, unmanaged):
* r_postgresql (ocf:heartbeat:pgsqlms): Unpromoted gloin002 (unmanaged)
* r_postgresql (ocf:heartbeat:pgsqlms): Promoted gloin001 (unmanaged)
Clear the pacemaker error status of a resource
----------------------------------------------
For example:
.. code-block:: shell
crm_resource -r r_postgresql -H gloin002 -C
Restore a postgresql secondary from the primary
-----------------------------------------------
- Activate the :ref:`pacemaker maintenance mode <winery-pacemaker-maintenance>`
- Stop postgresql via pacemaker (here the postgresql on gloin002)
.. code-block:: shell
crm --wait resource ban r_postgresql gloin002
Check the postgresql logs to check the status
If the postgresql doesn't stop, it can be force with:
.. code-block:: shell
export VERSION=<version>
sudo -u postgres /usr/lib/postgresql/$VERSION/bin/pg_ctl -D /var/lib/postgresql/$VERSION/main stop
- Delete or move the content of the postgresql data directory in ``/var/lib/postgresql/<version>/main``
- Launch the restoration from the master
.. code-block:: shell
sudo -u postgres pg_basebackup -h 10.25.1.1 -D /var/lib/postgresql/16/main/ -P -U replicator --wal-method=fetch
- Restore the :ref:`nominal pacemaker mode <winery-pacemaker-maintenance>`
Postgresql should restart and recover its lag.
- Check the pacemaker after the secondary is up to date
The PostgreSQL configuration is fully managed inside the patroni configuration,
either through the main ``/etc/patroni/16-main.yml`` config file for static, host-specific
configuration, or in patroni's dynamic configuration store
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment