Skip to content

Add get-postgresql-primary command to gitlab-ctl

Hossein Pursultani requested to merge 5466-get-postgresql-primary-cmd into master

What does this MR do?

get-postgresql-primary command prints out the connection information (IP address and port) of primary PostgreSQL node. This is useful to identify the primary node in a clustered deployment, for example with repmgr or Patroni.

This command requires a Consul agent on the same node that it is running. It uses Consul DNS interface to lookup the SRV record for PostgreSQL service.

Related issues

Closes #5466 (closed)

Checklist

See Definition of done.

  • Changelog entry created. Not applicable for Documentation changes and minor changes.
  • Documentation created/updated
  • Tests added
  • Integration tests added to GitLab QA, if applicable
  • MR targeting master branch
  • MR has a green pipeline on GitLab.com
  • Equivalent MR/issue for CNG opened if applicable
  • trigger-package has a green pipeline running against latest commit

Reviewer Checklist

In addition to above, reviewer must:

  • Pipeline is green on dev.gitlab.org if the change is not touching documentation or internal cookbooks
Edited by Hossein Pursultani

Merge request reports