wip
This commit is contained in:
@@ -58,47 +58,71 @@ chmod 600 /etc/pgpool2/pcp.conf ~/.pcppass
|
|||||||
# pg_enc -m -k ~/.pgpoolkey -u $POSTGRES_PGPOOL_USERNAME $POSTGRES_PGPOOL_PASSWORD
|
# pg_enc -m -k ~/.pgpoolkey -u $POSTGRES_PGPOOL_USERNAME $POSTGRES_PGPOOL_PASSWORD
|
||||||
|
|
||||||
{
|
{
|
||||||
printf "listen_addresses = '*'\n"
|
printf "# Backend Clustering Mode\n\n"
|
||||||
printf "port = 5432\n"
|
|
||||||
printf "enable_pool_hba = off\n"
|
|
||||||
printf "allow_clear_text_frontend_auth = on\n"
|
|
||||||
printf "process_management_mode = 'dynamic'\n"
|
|
||||||
printf "backend_clustering_mode = 'streaming_replication'\n"
|
printf "backend_clustering_mode = 'streaming_replication'\n"
|
||||||
printf "sr_check_period = 10\n"
|
|
||||||
printf "sr_check_user = %s\n" "$POSTGRES_REPLICATOR_USERNAME"
|
|
||||||
# printf "sr_check_password = %s\n" "$POSTGRES_REPLICATOR_PASSWORD"
|
|
||||||
printf "sr_check_password = ''\n"
|
|
||||||
printf "follow_primary_command = '/etc/pgpool2/follow_primary.sh %%d %%h %%p %%D %%m %%H %%M %%P %%r %%R'\n"
|
|
||||||
printf "replication_mode = off\n"
|
|
||||||
printf "master_slave_mode = on\n"
|
|
||||||
printf "load_balance_mode = on\n"
|
|
||||||
printf "reset_query_on_pool_release = on\n"
|
|
||||||
printf "replicate_on_reset = on\n"
|
|
||||||
printf "online_recovery = on\n"
|
|
||||||
printf "detach_false_primary = on\n"
|
|
||||||
printf "failover_command = '/etc/pgpool2/failover.sh %%d %%h %%p %%D %%m %%H %%M %%P %%r %%R %%N %%S'\n"
|
|
||||||
printf "recovery_user = postgres\n"
|
|
||||||
printf "recovery_password = ''\n"
|
|
||||||
printf "recovery_1st_stage_command = recovery_1st_stage\n"
|
|
||||||
printf "recovery_timeout = 60\n"
|
|
||||||
printf "client_idle_limit_in_recovery = -1\n"
|
|
||||||
printf "health_check_timeout = 5\n"
|
|
||||||
printf "health_check_period = 5\n"
|
|
||||||
printf "health_check_user = %s\n" "$POSTGRES_PGPOOL_USERNAME"
|
|
||||||
# printf "health_check_password = '%s'\n" "$PGPOOL_PASSWORD"
|
|
||||||
printf "health_check_password = ''\n"
|
|
||||||
printf "statement_cache_mode = off\n"
|
|
||||||
printf "query_cache_mode = off\n"
|
|
||||||
|
|
||||||
|
printf "\n# Connections\n\n"
|
||||||
|
printf "listen_addresses = '*'\n"
|
||||||
|
printf "port = 5432\n"
|
||||||
|
printf "unix_socket_directories = '/var/run/postgresql'\n"
|
||||||
|
printf "unix_socket_group = 'postgres'\n"
|
||||||
|
printf "unix_socket_permissions = 0777\n"
|
||||||
|
printf "pcp_port = 9898\n"
|
||||||
|
printf "pcp_socket_dir = '/var/run/postgresql'\n"
|
||||||
|
|
||||||
|
printf "\n# Backend Connections\n\n"
|
||||||
IFS=':'
|
IFS=':'
|
||||||
n=0
|
n=0
|
||||||
for backend in $PGPOOL_BACKEND
|
for backend in $PGPOOL_BACKEND
|
||||||
do
|
do
|
||||||
printf "backend_hostname%d = '%s'\n" $n $backend
|
printf "\nbackend_hostname%d = '%s'\n" $n $backend
|
||||||
printf "backend_port%d = 5432\n" $n
|
printf "backend_port%d = 5432\n" $n
|
||||||
printf "backend_data_directory%d = '/var/lib/postgresql/data'\n" $n
|
printf "backend_data_directory%d = '/var/lib/postgresql/data'\n" $n
|
||||||
((n+=1))
|
((n+=1))
|
||||||
done
|
done
|
||||||
|
unset IFS
|
||||||
|
|
||||||
|
printf "\n# Authentication\n\n"
|
||||||
|
printf "enable_pool_hba = off\n"
|
||||||
|
printf "pool_passwd = ''\n"
|
||||||
|
printf "allow_clear_text_frontend_auth = on\n"
|
||||||
|
|
||||||
|
printf "\n# Pools\n\n"
|
||||||
|
printf "process_management_mode = 'dynamic'\n"
|
||||||
|
|
||||||
|
printf "\n# Logs\n\n"
|
||||||
|
printf "log_line_prefix = '%m: %a pid %p: '\n"
|
||||||
|
printf "log_per_node_statement = on\n"
|
||||||
|
printf "logging_collector = off\n"
|
||||||
|
|
||||||
|
printf "\n# Replication Mode\n\n"
|
||||||
|
|
||||||
|
printf "sr_check_period = 10\n"
|
||||||
|
printf "sr_check_user = %s\n" "$POSTGRES_REPLICATOR_USERNAME"
|
||||||
|
# printf "sr_check_password = %s\n" "$POSTGRES_REPLICATOR_PASSWORD"
|
||||||
|
printf "sr_check_password = ''\n"
|
||||||
|
printf "follow_primary_command = '/etc/pgpool2/follow_primary.sh %%d %%h %%p %%D %%m %%H %%M %%P %%r %%R'\n"
|
||||||
|
printf "replication_mode = off\n"
|
||||||
|
printf "master_slave_mode = on\n"
|
||||||
|
printf "load_balance_mode = on\n"
|
||||||
|
printf "reset_query_on_pool_release = on\n"
|
||||||
|
printf "replicate_on_reset = on\n"
|
||||||
|
printf "online_recovery = on\n"
|
||||||
|
printf "detach_false_primary = on\n"
|
||||||
|
printf "failover_command = '/etc/pgpool2/failover.sh %%d %%h %%p %%D %%m %%H %%M %%P %%r %%R %%N %%S'\n"
|
||||||
|
printf "recovery_user = postgres\n"
|
||||||
|
printf "recovery_password = ''\n"
|
||||||
|
printf "recovery_1st_stage_command = recovery_1st_stage\n"
|
||||||
|
printf "recovery_timeout = 60\n"
|
||||||
|
printf "client_idle_limit_in_recovery = -1\n"
|
||||||
|
printf "health_check_timeout = 5\n"
|
||||||
|
printf "health_check_period = 5\n"
|
||||||
|
printf "health_check_user = %s\n" "$POSTGRES_PGPOOL_USERNAME"
|
||||||
|
# printf "health_check_password = '%s'\n" "$PGPOOL_PASSWORD"
|
||||||
|
printf "health_check_password = ''\n"
|
||||||
|
printf "statement_cache_mode = off\n"
|
||||||
|
printf "query_cache_mode = off\n"
|
||||||
|
|
||||||
} > /etc/pgpool2/pgpool.conf
|
} > /etc/pgpool2/pgpool.conf
|
||||||
|
|
||||||
/usr/sbin/pgpool
|
/usr/sbin/pgpool
|
||||||
|
|||||||
Reference in New Issue
Block a user