Configure

How to configure pigsty according to your needs

Users can use the following configuration items to configure the infrastructure and database cluster.

In general, most parameters can be used directly with default values.

The infrastructure section requires very little modification, and the only modification usually involved is a textual substitution of the IP address of the meta-node.

In contrast, users need to focus on the definition and configuration of database clusters. The database cluster will be deployed on database nodes and the user must provide the [identity information](identity/#identity parameter) of the database cluster with the [connection information](identity/#connection information) of the database nodes. The identity information (e.g., cluster name, instance number) is used to describe the entities in the database cluster, while the connection information (e.g., IP address) is used to access the database node. Also, the user should define the default business user and business database together with the cluster creation.

In addition, users can also customize the default access control model, template database, external exposed services by modifying the parameters. /../concept/provision/service/# service definition).

Database customization

In Pigsty, database initialization is divided into five parts.

1. [Install database software](. /../config/6-pg-install/)

What version to install, which plugins to install, what user to use

Usually the parameters in this section can be used directly without modifying anything (adjustments need to be made when the PG version is upgraded).

2. [provisioning database cluster] (../../config/7-pg-provision/)

Where to create the directory, what purpose to create the cluster, which IP ports to listen on, what connection pooling mode to use

In this section, identity information is a mandatory parameter, other than that there are very few default parameters to change.

The default parameters are rarely changed other than by pg_conf you can use the default database cluster templates (Normal Transactional OLTP / Normal Analytical OLAP / Core Financial CRIT / Micro Virtual Machine TINY). If you wish to create custom templates, you can clone the default configuration in roles/postgres/templates and adopt it with your own modifications, see [Patroni template customization](. /../reference/patroni).

3. Customization of database templates

Which roles, users, databases, schemas to create, which extensions to enable, how to set permissions and whitelist

Needs to be focused, as this is where the business declares its desired database. Users can customize through database templates at.

4. [pull up database monitoring](. /../config/9-monitor)

Deploy Pigsty monitoring system components

Normally no adjustment is needed, but in monitor deployment only mode it needs to be focused on. /monly) mode needs to be focused on and tuned.

5. [Expose database services](. /../config/10-services)

Expose database services externally via HAproxy/VIP

The configuration here does not need to be adjusted unless the user wishes to define additional services.

Configuration item reference

Most parameters are provided with reasonable default values, please refer to [configuration items](. /../config) manual to modify as needed.

| No | English | major class | function | | :–: | :—————————————–: | :———: | ——————— —————– | | 1 | connect | Infrastructure | Proxy server configuration, connection information for managed objects | | 2 | repo | Infrastructure | Customize local Yum sources, install packages offline | | 3 | node | Infrastructure | Configuring infrastructure on a normal node | | 4 | meta | meta | Infrastructure | | 5 | dcs | Infrastructure | Configure DCS services (consul/etcd) on all nodes | | 6 | [pg-install](. /../config/6-pg-install) | Database-clustering | Installing PostgreSQL database | | 7 | pg-provision | database-clustering | pulling up a PostgreSQL database cluster | | 8 | [pg-template](. /../config/8-pg-template) | Database-template | Customize PostgreSQL database content | | 9 | monitor | monitor | Database-Affiliate | | 10 | service | service | Database-affiliated |


Assign Identity

How to configure and assign identity to pgsql clusters and instances

Customize business users

Cusomize business users and roles in pigsty

Customize database

Configure business database

Customize Template

Customize template and other content in database clusters

Customize ACL

Configure access control in Pigsty

Last modified 2021-03-28: update en docs (f994b54)