tpaexec deploy v23
Deployment is the process of installing and configuring Postgres and other software on the cluster's servers. This includes setting up replication, backups, and so on.
At the end of the deployment stage, Postgres will be up and running along with other components like repmgr, Barman, pgbouncer, etc. (depending on the architecture selected).
Prerequisites
Before you can run tpaexec deploy
, you must have already run
tpaexec configure
to generate the cluster
configuration and then provisioned the servers with
tpaexec provision
.
Before deployment, you must
export TPA_2Q_SUBSCRIPTION_TOKEN=xxx
to enable any 2ndQuadrant
repositories that require subscription. You can use the subscription
token that you used to install TPA itself. If you
forget to do this, an error message will soon remind you.
Quickstart
This command produces a great deal of output and may take a long time
(depending primarily on the latency between the host running tpaexec and
the hosts in the cluster, as well as how long it takes the instances to
download the packages they need to install). We recommend that you use
at least one -v
during deployment. The output is also logged to
ansible.log
in the cluster directory.
The exact number of hosts, tasks, and changed tasks may of course vary.
The deploy command takes no options itself—any options you provide after
the cluster name are passed on unmodified to Ansible (e.g., -v
).
Those who are familiar with Ansible may be concerned by the occasional red "failed" task output scrolling by. Rest assured that if the process does not stop soon afterwards, the error is of no consequence, and the code will recover from it automatically.
When the deployment is complete, you can run
tpaexec test
to verify the installation.
Selective deployment
You can limit the deployment to a subset of your hosts by setting
deploy_hosts
to a comma-separated list of instance names:
This will run the deployment on the given instances, though it will also initially execute some tasks on other hosts to collect information about the state of the cluster.
(Setting deploy_hosts
is the recommended alternative to using
Ansible's --limit
option, which TPA does not support.)
deploy.yml
The deployment process is architecture-specific. Here's an overview of the various configuration settings that affect the deployment. If you are familiar with Ansible playbooks, you can follow along as tpaexec applies various roles to the cluster's instances.
Unlike config.yml, deploy.yml is not designed to be edited (and is usually a link into the architectures directory). Even if you want to extend the deployment process to run your own Ansible tasks, you should do so by creating hooks. This protects you from future implementation changes within a particular architecture.