pgpool-II 4.0.6 Documentation | |||
---|---|---|---|
Prev | Up | Chapter 5. Server Configuration | Next |
backend_hostname specifies the PostgreSQL backend to be connected to. It is used by Pgpool-II to communicate with the server.
For TCP/IP communication, this parameter can take a hostname or an IP address. If this begins with a slash(/), it specifies Unix-domain communication rather than TCP/IP; the value is the name of the directory in which the socket file is stored. The default behavior when backend_hostname is empty ('') is to connect to a Unix-domain socket in /tmp.
Multiple backends can be specified by adding a number at the end of the parameter name (e.g.backend_hostname0). This number is referred to as "DB node ID", and it starts from 0. The backend which was given the DB node ID of 0 will be called "master node". When multiple backends are defined, the service can be continued even if the master node is down (not true in some modes). In this case, the youngest DB node ID alive will be the new master node.
Please note that the DB node which has id 0 has no special meaning if operated in streaming replication mode. Rather, you should care about if the DB node is the "primary node" or not. See Section 5.7, Section 5.9, Section 5.11 for more details.
If you plan to use only one PostgreSQL server, specify it by backend_hostname0.
New nodes can be added by adding parameter rows and reloading a configuration file. However, the existing values cannot be updated, so you must restart Pgpool-II in that case.
backend_port specifies the port number of the backends. Multiple backends can be specified by adding a number at the end of the parameter name (e.g. backend_port0). If you plan to use only one PostgreSQL server, specify it by backend_port0.
New backend ports can be added by adding parameter rows and reloading a configuration file. However, the existing values cannot be updated, so you must restart Pgpool-II in that case.
backend_weight specifies the load balance ratio of the backends. It may be set to any integer or floating point value greater than or equal to zero. Multiple backends can be specified by adding a number at the end of the parameter name (e.g. backend_weight0). If you plan to use only one PostgreSQL server, specify it by backend_weight0.
New backend_weight can be added in this parameter by reloading a configuration file. However, this will take effect only for new established client sessions. Pgpool-II V2.2.6, V2.3 or later allows updating the values by reloading a configuration file. This is useful if you want to prevent any query sent to slaves to perform some administrative work in master/slave mode.
backend_data_directory specifies the database cluster directory of the backend. Multiple backends can be specified by adding a number at the end of the parameter name (e.g. backend_data_directory0). If you plan to use only one PostgreSQL server, specify it by backend_data_directory0.
New backend data_directory can be added by adding parameter rows and reloading a configuration file. However, the existing values cannot be updated, so you must restart Pgpool-II in that case.
backend_flag controls various backend behavior. Multiple backends can be specified by adding a number at the end of the parameter name (e.g. backend_flag0). If you plan to use only one PostgreSQL server, specify it by backend_flag0.
New backend flags can be added by adding parameter rows and reloading a configuration file. Currently followings are allowed. Multiple flags can be specified by using "|".
Table 5-3. Backend flags
Flag | Description |
---|---|
ALLOW_TO_FAILOVER | Allow to failover or detaching backend. This is the default. You cannot specify with DISALLOW_TO_FAILOVER at a same time. |
DISALLOW_TO_FAILOVER | Disallow to failover or detaching backend This is useful when you protect backend by using HA (High Availability) softwares such as Heartbeat or Pacemaker. You cannot specify with ALLOW_TO_FAILOVER at a same time. |
ALWAYS_MASTER | This is only useful in streaming replication mode. See Section 4.3.2 about streaming replication mode. If this flag is set to one of backends, Pgpool-II will not find the primary node by inspecting backend. Instead, always regard the node which the flag is set as the primary node. This is useful for systems including Amazon Aurora for PostgreSQL Compatibility which has fixed master server name. See Section 7.5 for an example settings. |
This parameter can be changed by reloading the Pgpool-II configurations.