Playbook: INFRA
Install pigsty & Add new optional to meta node with
INFRAseries playbooks.
| Playbook | Function | Link |
|---|---|---|
infra |
Install pigsty on meta nodes | src |
infra-demo |
Special version of infra, pull up the 4-node sandbox in one-pass |
src |
infra-remove |
Uninstall pigsty from the meta node. | src |
infra-jupyter |
Install optional JupyterLab on meta node | src |
infra
The infra.yml playbook will install Pigsty on the meta nodes.
When using Pigsty as a battery-included Postgres, infra.yml is sufficient for the installation.
What
The following tasks will be executed:
- Configure dir and environment variables of meta nodes.
- Download and create a LocalYum repo. (If offline packages
/tmp/pkg.tgzexists, skip the download phase) - Init the current meta node as a common node in Pigsty management.
- Deploy infra, including Prometheus, Grafana, Loki, Alertmanager, Consul Server, etc…
- Init a common PostgreSQL singleton on the current node as CMDB.
Where
This playbook works on meta nodes.
- Pigsty will use the node currently executing this playbook as Pigsty’s meta node by default.
- Pigsty will mark the current node as the meta node by default during
configureand replace the placeholder IP10.10.10.10in the config template with the current node’s primary IP. - Meta node can initiate management and deploy infra. It is not different from a regularly managed pgsql node.
- Pigsty uses meta nodes by default to deploy DCS Servers for PostgreSQL HA. But you can use external DCS Servers, too.
- Using multiple meta nodes is possible. Refer to the
pigsty-dcs3template: 3 meta x 3 nodes, allowing one failure.
How
Some special notes:
- This playbook is idempotent. Play again will erase Consul Server and CMDB (when protection is disabled)
- The complete execution of this playbook takes about 5-8 minutes with offline pkgs, depending on your machine spec.
- Depending on your network conditions, downloading packages directly from the Internet may take 10-20 minutes.
- This playbook treats the meta node as a common node to manage and deploy the PGSQL database. If it can be executed successfully, you could be confident that
nodes.ymlandpgsql.ymlwill work on nodes with the same state. - The default
pg-metaon the meta node will be used as the Pigsty CMDB and supporting advanced features.
Tasks
The playbook.
Nodes within the meta group will be marked with the meta_node flag in Pigsty inventory.
infra-demo
The infra-demo.yml is a special playbook for the demo env, which can be used to initialize a 4-node sandbox in one go by interweaving meta node & other nodes initialization. It’s useful when trying to deploy multiple meta nodes.
It’s equivalent to following commands in the standard 4-node demo.
USE THIS WITH CAUTION! You could just destroy the entire env with a fat finger & wrong config.
infra-remove
The infra-remove.yml playbook will uninstall pigsty from the meta node.
Following services will be stopped & removed from meta nodes.
- grafana-server
- prometheus
- alertmanager
- node_exporter
- consul
- loki
- promtail
infra-jupyter
Playbook infra-jupyter.yml will install JupyterLab on the meta node.
Check Tutorial: Jupyter Lab for more details.