Advertisement
Guest User

pgpool.conf

a guest
Oct 25th, 2021
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 43.35 KB | None | 0 0
  1. # ----------------------------
  2. # pgPool-II configuration file
  3. # ----------------------------
  4. #
  5. # This file consists of lines of the form:
  6. #
  7. # name = value
  8. #
  9. # Whitespace may be used. Comments are introduced with "#" anywhere on a line.
  10. # The complete list of parameter names and allowed values can be found in the
  11. # pgPool-II documentation.
  12. #
  13. # This file is read on server startup and when the server receives a SIGHUP
  14. # signal. If you edit the file on a running system, you have to SIGHUP the
  15. # server for the changes to take effect, or use "pgpool reload". Some
  16. # parameters, which are marked below, require a server shutdown and restart to
  17. # take effect.
  18. #
  19.  
  20. #------------------------------------------------------------------------------
  21. # BACKEND CLUSTERING MODE
  22. # Choose one of: 'streaming_replication', 'native_replication',
  23. # 'logical_replication', 'slony', 'raw' or 'snapshot_isolation'
  24. # (change requires restart)
  25. #------------------------------------------------------------------------------
  26.  
  27. backend_clustering_mode = 'streaming_replication'
  28.  
  29. #------------------------------------------------------------------------------
  30. # CONNECTIONS
  31. #------------------------------------------------------------------------------
  32.  
  33. # - pgpool Connection Settings -
  34.  
  35. listen_addresses = '*'
  36. # Host name or IP address to listen on:
  37. # '*' for all, '' for no TCP/IP connections
  38. # (change requires restart)
  39. port = 5432
  40. # Port number
  41. # (change requires restart)
  42. socket_dir = '/tmp'
  43. # Unix domain socket path
  44. # The Debian package defaults to
  45. # /var/run/postgresql
  46. # (change requires restart)
  47. listen_backlog_multiplier = 2
  48. # Set the backlog parameter of listen(2) to
  49. # num_init_children * listen_backlog_multiplier.
  50. # (change requires restart)
  51. serialize_accept = off
  52. # whether to serialize accept() call to avoid thundering herd problem
  53. # (change requires restart)
  54. reserved_connections = 0
  55. # Number of reserved connections.
  56. # Pgpool-II does not accept connections if over
  57. # num_init_chidlren - reserved_connections.
  58.  
  59. # - pgpool Communication Manager Connection Settings -
  60.  
  61. pcp_listen_addresses = '*'
  62. # Host name or IP address for pcp process to listen on:
  63. # '*' for all, '' for no TCP/IP connections
  64. # (change requires restart)
  65. pcp_port = 9898
  66. # Port number for pcp
  67. # (change requires restart)
  68. pcp_socket_dir = '/tmp'
  69. # Unix domain socket path for pcp
  70. # The Debian package defaults to
  71. # /var/run/postgresql
  72. # (change requires restart)
  73.  
  74. # - Backend Connection Settings -
  75.  
  76. backend_hostname0 = '{{ pgpool_primary }}'
  77. # Host name or IP address to connect to for backend 0
  78. backend_port0 = 5432
  79. # Port number for backend 0
  80. backend_weight0 = 1
  81. # Weight for backend 0 (only in load balancing mode)
  82. backend_data_directory0 = '{{ pgpool_postgres_data_directory }}'
  83. # Data directory for backend 0
  84. backend_flag0 = 'ALLOW_TO_FAILOVER'
  85. # Controls various backend behavior
  86. # ALLOW_TO_FAILOVER, DISALLOW_TO_FAILOVER
  87. # or ALWAYS_MASTER
  88. # walsender's application_name, used for "show pool_nodes" command
  89. backend_application_name0 = 'postgres01'
  90.  
  91. {% for replica in pgpool_replicas %}
  92. backend_hostname{{ loop.index }} = '{{ replica }}'
  93. backend_port{{ loop.index }} = 5432
  94. backend_weight{{ loop.index }} = 1
  95. backend_data_directory{{ loop.index }} = '{{ pgpool_postgres_data_directory }}'
  96. backend_flag{{ loop.index }} = 'ALLOW_TO_FAILOVER'
  97. backend_application_name{{ loop.index }} = 'postgres0{{ loop.index +1}}'
  98. {% endfor %}
  99.  
  100. # - Authentication -
  101.  
  102. enable_pool_hba = on
  103. # Use pool_hba.conf for client authentication
  104. pool_passwd = 'auth.conf'
  105. # File name of pool_passwd for md5 authentication.
  106. # "" disables pool_passwd.
  107. # (change requires restart)
  108. authentication_timeout = 60
  109. # Delay in seconds to complete client authentication
  110. # 0 means no timeout.
  111.  
  112. allow_clear_text_frontend_auth = off
  113. # Allow Pgpool-II to use clear text password authentication
  114. # with clients, when pool_passwd does not
  115. # contain the user password
  116.  
  117.  
  118. # - SSL Connections -
  119.  
  120. ssl = off
  121. # Enable SSL support
  122. # (change requires restart)
  123. #ssl_key = './server.key'
  124. # Path to the SSL private key file
  125. # (change requires restart)
  126. #ssl_cert = './server.cert'
  127. # Path to the SSL public certificate file
  128. # (change requires restart)
  129. #ssl_ca_cert = ''
  130. # Path to a single PEM format file
  131. # containing CA root certificate(s)
  132. # (change requires restart)
  133. #ssl_ca_cert_dir = ''
  134. # Directory containing CA root certificate(s)
  135. # (change requires restart)
  136.  
  137. ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL'
  138. # Allowed SSL ciphers
  139. # (change requires restart)
  140. ssl_prefer_server_ciphers = off
  141. # Use server's SSL cipher preferences,
  142. # rather than the client's
  143. # (change requires restart)
  144. ssl_ecdh_curve = 'prime256v1'
  145. # Name of the curve to use in ECDH key exchange
  146. ssl_dh_params_file = ''
  147. # Name of the file containing Diffie-Hellman parameters used
  148. # for so-called ephemeral DH family of SSL cipher.
  149.  
  150. #------------------------------------------------------------------------------
  151. # POOLS
  152. #------------------------------------------------------------------------------
  153.  
  154. # - Concurrent session and pool size -
  155.  
  156. num_init_children = {{ pgpool_max_processes }}
  157. # Number of concurrent sessions allowed
  158. # (change requires restart)
  159. max_pool = 1
  160. # Number of connection pool caches per connection
  161. # (change requires restart)
  162.  
  163. # - Life time -
  164.  
  165. child_life_time = 1800
  166. # Pool exits after being idle for this many seconds
  167. child_max_connections = 0
  168. # Pool exits after receiving that many connections
  169. # 0 means no exit
  170. connection_life_time = 3600
  171. # Connection to backend closes after being idle for this many seconds
  172. # 0 means no close
  173. client_idle_limit = 1800
  174. # Client is disconnected after being idle for that many seconds
  175. # (even inside an explicit transactions!)
  176. # 0 means no disconnection
  177.  
  178.  
  179. #------------------------------------------------------------------------------
  180. # LOGS
  181. #------------------------------------------------------------------------------
  182.  
  183. # - Where to log -
  184.  
  185. log_destination = 'stderr'
  186. # Where to log
  187. # Valid values are combinations of stderr,
  188. # and syslog. Default to stderr.
  189.  
  190. # - What to log -
  191.  
  192. log_line_prefix = '%t: pid %p: ' # printf-style string to output at beginning of each log line.
  193.  
  194. log_connections = off
  195. # Log connections
  196. log_hostname = off
  197. # Hostname will be shown in ps status
  198. # and in logs if connections are logged
  199. log_statement = off
  200. # Log all statements
  201. log_per_node_statement = off
  202. # Log all statements
  203. # with node and backend informations
  204. log_client_messages = off
  205. # Log any client messages
  206. log_standby_delay = 'none'
  207. # Log standby delay
  208. # Valid values are combinations of always,
  209. # if_over_threshold, none
  210.  
  211. # - Syslog specific -
  212.  
  213. syslog_facility = 'LOCAL0'
  214. # Syslog local facility. Default to LOCAL0
  215. syslog_ident = 'pgpool'
  216. # Syslog program identification string
  217. # Default to 'pgpool'
  218.  
  219. # - Debug -
  220.  
  221. #log_error_verbosity = default # terse, default, or verbose messages
  222.  
  223. #client_min_messages = notice # values in order of decreasing detail:
  224. # debug5
  225. # debug4
  226. # debug3
  227. # debug2
  228. # debug1
  229. # log
  230. # notice
  231. # warning
  232. # error
  233.  
  234. log_min_messages = info # values in order of decreasing detail:
  235. # debug5
  236. # debug4
  237. # debug3
  238. # debug2
  239. # debug1
  240. # info
  241. # notice
  242. # warning
  243. # error
  244. # log
  245. # fatal
  246. # panic
  247.  
  248. #------------------------------------------------------------------------------
  249. # FILE LOCATIONS
  250. #------------------------------------------------------------------------------
  251.  
  252. pid_file_name = '/tmp/pgpool.pid'
  253. # PID file name
  254. # Can be specified as relative to the"
  255. # location of pgpool.conf file or
  256. # as an absolute path
  257. # (change requires restart)
  258. logdir = '/var/log/pgpool'
  259. # Directory of pgPool status file
  260. # (change requires restart)
  261.  
  262.  
  263. #------------------------------------------------------------------------------
  264. # CONNECTION POOLING
  265. #------------------------------------------------------------------------------
  266.  
  267. connection_cache = on
  268. # Activate connection pools
  269. # (change requires restart)
  270.  
  271. # Semicolon separated list of queries
  272. # to be issued at the end of a session
  273. # The default is for 8.3 and later
  274. reset_query_list = 'ABORT; DISCARD ALL'
  275. # The following one is for 8.2 and before
  276. #reset_query_list = 'ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT'
  277.  
  278.  
  279. #------------------------------------------------------------------------------
  280. # REPLICATION MODE
  281. #------------------------------------------------------------------------------
  282.  
  283. replication_mode = off
  284. # Activate replication mode
  285. # (change requires restart)
  286. replicate_select = off
  287. # Replicate SELECT statements
  288. # when in replication mode
  289. # replicate_select is higher priority than
  290. # load_balance_mode.
  291.  
  292. insert_lock = off
  293. # Automatically locks a dummy row or a table
  294. # with INSERT statements to keep SERIAL data
  295. # consistency
  296. # Without SERIAL, no lock will be issued
  297. lobj_lock_table = ''
  298. # When rewriting lo_creat command in
  299. # replication mode, specify table name to
  300. # lock
  301.  
  302. # - Degenerate handling -
  303.  
  304. replication_stop_on_mismatch = off
  305. # On disagreement with the packet kind
  306. # sent from backend, degenerate the node
  307. # which is most likely "minority"
  308. # If off, just force to exit this session
  309.  
  310. failover_if_affected_tuples_mismatch = off
  311. # On disagreement with the number of affected
  312. # tuples in UPDATE/DELETE queries, then
  313. # degenerate the node which is most likely
  314. # "minority".
  315. # If off, just abort the transaction to
  316. # keep the consistency
  317.  
  318.  
  319. #------------------------------------------------------------------------------
  320. # LOAD BALANCING MODE
  321. #------------------------------------------------------------------------------
  322.  
  323. load_balance_mode = on
  324. # Activate load balancing mode
  325. # (change requires restart)
  326. ignore_leading_white_space = on
  327. # Ignore leading white spaces of each query
  328. read_only_function_list = ''
  329. # Comma separated list of function names
  330. # that don't write to database
  331. # Regexp are accepted
  332. write_function_list = 'currval,lastval,nextval,setval'
  333. # Comma separated list of function names
  334. # that write to database
  335. # Regexp are accepted
  336.  
  337. database_redirect_preference_list = ''
  338. # comma separated list of pairs of database and node id.
  339. # example: postgres:primary,mydb[0-4]:1,mydb[5-9]:2'
  340. # valid for streaming replicaton mode only.
  341. app_name_redirect_preference_list = ''
  342. # comma separated list of pairs of app name and node id.
  343. # example: 'psql:primary,myapp[0-4]:1,myapp[5-9]:standby'
  344. # valid for streaming replicaton mode only.
  345. allow_sql_comments = off
  346. # if on, ignore SQL comments when judging if load balance or
  347. # query cache is possible.
  348. # If off, SQL comments effectively prevent the judgment
  349. # (pre 3.4 behavior).
  350.  
  351. disable_load_balance_on_write = 'transaction'
  352. # Load balance behavior when write query is issued
  353. # in an explicit transaction.
  354. # Note that any query not in an explicit transaction
  355. # is not affected by the parameter.
  356. # 'transaction' (the default): if a write query is issued,
  357. # subsequent read queries will not be load balanced
  358. # until the transaction ends.
  359. # 'trans_transaction': if a write query is issued,
  360. # subsequent read queries in an explicit transaction
  361. # will not be load balanced until the session ends.
  362. # 'always': if a write query is issued, read queries will
  363. # not be load balanced until the session ends.
  364.  
  365. statement_level_load_balance = off
  366. # Enables statement level load balancing
  367.  
  368. #------------------------------------------------------------------------------
  369. # NATIVE REPLICATION MODE
  370. #------------------------------------------------------------------------------
  371.  
  372. # - Streaming -
  373.  
  374. sr_check_period = 10
  375. # Streaming replication check period
  376. # Disabled (0) by default
  377. sr_check_user = 'pgpool'
  378. # Streaming replication check user
  379. # This is necessary even if you disable
  380. # streaming replication delay check with
  381. # sr_check_period = 0
  382.  
  383. sr_check_password = '{{ pgpool_password }}'
  384. # Password for streaming replication check user.
  385. # Leaving it empty will make Pgpool-II to first look for the
  386. # Password in pool_passwd file before using the empty password
  387.  
  388. sr_check_database = 'postgres'
  389. # Database name for streaming replication check
  390. delay_threshold = 256000
  391. # Threshold before not dispatching query to standby node
  392. # Unit is in bytes
  393. # Disabled (0) by default
  394.  
  395. # - Special commands -
  396.  
  397. follow_primary_command = ''
  398. # Executes this command after master failover
  399. # Special values:
  400. # %d = failed node id
  401. # %h = failed node host name
  402. # %p = failed node port number
  403. # %D = failed node database cluster path
  404. # %m = new master node id
  405. # %H = new master node hostname
  406. # %M = old master node id
  407. # %P = old primary node id
  408. # %r = new master port number
  409. # %R = new master database cluster path
  410. # %N = old primary node hostname
  411. # %S = old primary node port number
  412. # %% = '%' character
  413.  
  414. #------------------------------------------------------------------------------
  415. # HEALTH CHECK GLOBAL PARAMETERS
  416. #------------------------------------------------------------------------------
  417.  
  418. health_check_period = 15
  419. # Health check period
  420. # Disabled (0) by default
  421. health_check_timeout = 10
  422. # Health check timeout
  423. # 0 means no timeout
  424. health_check_user = 'core_app'
  425. # Health check user
  426. health_check_password = 'md5{{ (core_app_password + "core_app") | hash("md5") }}'
  427. # Password for health check user
  428. # Leaving it empty will make Pgpool-II to first look for the
  429. # Password in pool_passwd file before using the empty password
  430.  
  431. health_check_database = 'core_app_{{ app_env }}'
  432. # Database name for health check. If '', tries 'postgres' frist, then 'template1'
  433.  
  434. health_check_max_retries = 3
  435. # Maximum number of times to retry a failed health check before giving up.
  436. health_check_retry_delay = 5
  437. # Amount of time to wait (in seconds) between retries.
  438. connect_timeout = 10000
  439. # Timeout value in milliseconds before giving up to connect to backend.
  440. # Default is 10000 ms (10 second). Flaky network user may want to increase
  441. # the value. 0 means no timeout.
  442. # Note that this value is not only used for health check,
  443. # but also for ordinary conection to backend.
  444.  
  445. #------------------------------------------------------------------------------
  446. # HEALTH CHECK PER NODE PARAMETERS (OPTIONAL)
  447. #------------------------------------------------------------------------------
  448. #health_check_period0 = 0
  449. #health_check_timeout0 = 20
  450. #health_check_user0 = 'nobody'
  451. #health_check_password0 = ''
  452. #health_check_database0 = ''
  453. #health_check_max_retries0 = 0
  454. #health_check_retry_delay0 = 1
  455. #connect_timeout0 = 10000
  456.  
  457. #------------------------------------------------------------------------------
  458. # FAILOVER AND FAILBACK
  459. #------------------------------------------------------------------------------
  460.  
  461. failover_command = '/etc/pgpool-II/failover.sh %d %h %p %D %m %H %M %P %r %R %N %S'
  462. # Executes this command at failover
  463. # Special values:
  464. # %d = failed node id
  465. # %h = failed node host name
  466. # %p = failed node port number
  467. # %D = failed node database cluster path
  468. # %m = new master node id
  469. # %H = new master node hostname
  470. # %M = old master node id
  471. # %P = old primary node id
  472. # %r = new master port number
  473. # %R = new master database cluster path
  474. # %N = old primary node hostname
  475. # %S = old primary node port number
  476. # %% = '%' character
  477. failback_command = ''
  478. # Executes this command at failback.
  479. # Special values:
  480. # %d = failed node id
  481. # %h = failed node host name
  482. # %p = failed node port number
  483. # %D = failed node database cluster path
  484. # %m = new master node id
  485. # %H = new master node hostname
  486. # %M = old master node id
  487. # %P = old primary node id
  488. # %r = new master port number
  489. # %R = new master database cluster path
  490. # %N = old primary node hostname
  491. # %S = old primary node port number
  492. # %% = '%' character
  493.  
  494. failover_on_backend_error = on
  495. # Initiates failover when reading/writing to the
  496. # backend communication socket fails
  497. # If set to off, pgpool will report an
  498. # error and disconnect the session.
  499.  
  500. detach_false_primary = off
  501. # Detach false primary if on. Only
  502. # valid in streaming replicaton
  503. # mode and with PostgreSQL 9.6 or
  504. # after.
  505.  
  506. search_primary_node_timeout = 0
  507. # Timeout in seconds to search for the
  508. # primary node when a failover occurs.
  509. # 0 means no timeout, keep searching
  510. # for a primary node forever.
  511.  
  512. auto_failback = on
  513. # Dettached backend node reattach automatically
  514. # if replication_state is 'streaming'.
  515. auto_failback_interval = 60
  516. # Min interval of executing auto_failback in
  517. # seconds.
  518.  
  519. #------------------------------------------------------------------------------
  520. # ONLINE RECOVERY
  521. #------------------------------------------------------------------------------
  522.  
  523. recovery_user = 'nobody'
  524. # Online recovery user
  525. recovery_password = ''
  526. # Online recovery password
  527. # Leaving it empty will make Pgpool-II to first look for the
  528. # Password in pool_passwd file before using the empty password
  529.  
  530. recovery_1st_stage_command = ''
  531. # Executes a command in first stage
  532. recovery_2nd_stage_command = ''
  533. # Executes a command in second stage
  534. recovery_timeout = 90
  535. # Timeout in seconds to wait for the
  536. # recovering node's postmaster to start up
  537. # 0 means no wait
  538. client_idle_limit_in_recovery = 0
  539. # Client is disconnected after being idle
  540. # for that many seconds in the second stage
  541. # of online recovery
  542. # 0 means no disconnection
  543. # -1 means immediate disconnection
  544.  
  545.  
  546. #------------------------------------------------------------------------------
  547. # WATCHDOG
  548. #------------------------------------------------------------------------------
  549.  
  550. # - Enabling -
  551.  
  552. use_watchdog = off
  553. # Activates watchdog
  554. # (change requires restart)
  555.  
  556. # -Connection to up stream servers -
  557.  
  558. trusted_servers = ''
  559. # trusted server list which are used
  560. # to confirm network connection
  561. # (hostA,hostB,hostC,...)
  562. # (change requires restart)
  563. ping_path = '/bin'
  564. # ping command path
  565. # (change requires restart)
  566.  
  567. # - Watchdog communication Settings -
  568.  
  569. hostname0 = ''
  570. # Host name or IP address of this watchdog
  571. # (change requires restart)
  572. wd_port0 = 9000
  573. # port number for watchdog service
  574. # (change requires restart)
  575. wd_priority = 1
  576. # priority of this watchdog in leader election
  577. # (change requires restart)
  578.  
  579. wd_authkey = ''
  580. # Authentication key for watchdog communication
  581. # (change requires restart)
  582.  
  583. wd_ipc_socket_dir = '/var/run/postgresql'
  584. # Unix domain socket path for watchdog IPC socket
  585. # The Debian package defaults to
  586. # /var/run/postgresql
  587. # (change requires restart)
  588.  
  589.  
  590. # - Virtual IP control Setting -
  591.  
  592. delegate_IP = ''
  593. # delegate IP address
  594. # If this is empty, virtual IP never bring up.
  595. # (change requires restart)
  596. if_cmd_path = '/sbin'
  597. # path to the directory where if_up/down_cmd exists
  598. # If if_up/down_cmd starts with "/", if_cmd_path will be ignored.
  599. # (change requires restart)
  600. if_up_cmd = '/usr/bin/sudo /sbin/ip addr add $_IP_$/24 dev eth0 label eth0:0'
  601. # startup delegate IP command
  602. # (change requires restart)
  603. if_down_cmd = '/usr/bin/sudo /sbin/ip addr del $_IP_$/24 dev eth0'
  604. # shutdown delegate IP command
  605. # (change requires restart)
  606. arping_path = '/usr/sbin'
  607. # arping command path
  608. # If arping_cmd starts with "/", if_cmd_path will be ignored.
  609. # (change requires restart)
  610. arping_cmd = '/usr/bin/sudo /usr/sbin/arping -U $_IP_$ -w 1 -I eth0'
  611. # arping command
  612. # (change requires restart)
  613.  
  614. # - Behaivor on escalation Setting -
  615.  
  616. clear_memqcache_on_escalation = on
  617. # Clear all the query cache on shared memory
  618. # when standby pgpool escalate to active pgpool
  619. # (= virtual IP holder).
  620. # This should be off if client connects to pgpool
  621. # not using virtual IP.
  622. # (change requires restart)
  623. wd_escalation_command = ''
  624. # Executes this command at escalation on new active pgpool.
  625. # (change requires restart)
  626. wd_de_escalation_command = ''
  627. # Executes this command when master pgpool resigns from being master.
  628. # (change requires restart)
  629.  
  630. # - Watchdog consensus settings for failover -
  631.  
  632. failover_when_quorum_exists = on
  633. # Only perform backend node failover
  634. # when the watchdog cluster holds the quorum
  635. # (change requires restart)
  636.  
  637. failover_require_consensus = on
  638. # Perform failover when majority of Pgpool-II nodes
  639. # aggrees on the backend node status change
  640. # (change requires restart)
  641.  
  642. allow_multiple_failover_requests_from_node = off
  643. # A Pgpool-II node can cast multiple votes
  644. # for building the consensus on failover
  645. # (change requires restart)
  646.  
  647. enable_consensus_with_half_votes = off
  648. # apply majority rule for consensus and quorum computation
  649. # at 50% of votes in a cluster with even number of nodes.
  650. # when enabled the existence of quorum and consensus
  651. # on failover is resolved after receiving half of the
  652. # total votes in the cluster, otherwise both these
  653. # decisions require at least one more vote than
  654. # half of the total votes.
  655. # (change requires restart)
  656.  
  657. # - Lifecheck Setting -
  658.  
  659. # -- common --
  660.  
  661. wd_monitoring_interfaces_list = '' # Comma separated list of interfaces names to monitor.
  662. # if any interface from the list is active the watchdog will
  663. # consider the network is fine
  664. # 'any' to enable monitoring on all interfaces except loopback
  665. # '' to disable monitoring
  666. # (change requires restart)
  667.  
  668.  
  669. wd_lifecheck_method = 'heartbeat'
  670. # Method of watchdog lifecheck ('heartbeat' or 'query' or 'external')
  671. # (change requires restart)
  672. wd_interval = 10
  673. # lifecheck interval (sec) > 0
  674. # (change requires restart)
  675.  
  676. # -- heartbeat mode --
  677.  
  678. wd_heartbeat_port = 9694
  679. # Port number for receiving heartbeat signal
  680. # (change requires restart)
  681. wd_heartbeat_keepalive = 2
  682. # Interval time of sending heartbeat signal (sec)
  683. # (change requires restart)
  684. wd_heartbeat_deadtime = 30
  685. # Deadtime interval for heartbeat signal (sec)
  686. # (change requires restart)
  687. heartbeat_destination0 = 'host0_ip1'
  688. # Host name or IP address of destination 0
  689. # for sending heartbeat signal.
  690. # (change requires restart)
  691. heartbeat_destination_port0 = 9694
  692. # Port number of destination 0 for sending
  693. # heartbeat signal. Usually this is the
  694. # same as wd_heartbeat_port.
  695. # (change requires restart)
  696. heartbeat_device0 = ''
  697. # Name of NIC device (such like 'eth0')
  698. # used for sending/receiving heartbeat
  699. # signal to/from destination 0.
  700. # This works only when this is not empty
  701. # and pgpool has root privilege.
  702. # (change requires restart)
  703.  
  704. #heartbeat_destination1 = 'host0_ip2'
  705. #heartbeat_destination_port1 = 9694
  706. #heartbeat_device1 = ''
  707.  
  708. # -- query mode --
  709.  
  710. wd_life_point = 3
  711. # lifecheck retry times
  712. # (change requires restart)
  713. wd_lifecheck_query = 'SELECT 1'
  714. # lifecheck query to pgpool from watchdog
  715. # (change requires restart)
  716. wd_lifecheck_dbname = 'template1'
  717. # Database name connected for lifecheck
  718. # (change requires restart)
  719. wd_lifecheck_user = 'nobody'
  720. # watchdog user monitoring pgpools in lifecheck
  721. # (change requires restart)
  722. wd_lifecheck_password = ''
  723. # Password for watchdog user in lifecheck
  724. # Leaving it empty will make Pgpool-II to first look for the
  725. # Password in pool_passwd file before using the empty password
  726. # (change requires restart)
  727.  
  728. # - Other pgpool Connection Settings -
  729.  
  730. #other_pgpool_hostname0 = 'host0'
  731. # Host name or IP address to connect to for other pgpool 0
  732. # (change requires restart)
  733. #other_pgpool_port0 = 5432
  734. # Port number for other pgpool 0
  735. # (change requires restart)
  736. #other_wd_port0 = 9000
  737. # Port number for other watchdog 0
  738. # (change requires restart)
  739. #other_pgpool_hostname1 = 'host1'
  740. #other_pgpool_port1 = 5432
  741. #other_wd_port1 = 9000
  742.  
  743.  
  744. #------------------------------------------------------------------------------
  745. # OTHERS
  746. #------------------------------------------------------------------------------
  747. relcache_expire = 0
  748. # Life time of relation cache in seconds.
  749. # 0 means no cache expiration(the default).
  750. # The relation cache is used for cache the
  751. # query result against PostgreSQL system
  752. # catalog to obtain various information
  753. # including table structures or if it's a
  754. # temporary table or not. The cache is
  755. # maintained in a pgpool child local memory
  756. # and being kept as long as it survives.
  757. # If someone modify the table by using
  758. # ALTER TABLE or some such, the relcache is
  759. # not consistent anymore.
  760. # For this purpose, cache_expiration
  761. # controls the life time of the cache.
  762.  
  763. relcache_size = 256
  764. # Number of relation cache
  765. # entry. If you see frequently:
  766. # "pool_search_relcache: cache replacement happend"
  767. # in the pgpool log, you might want to increate this number.
  768.  
  769. check_temp_table = catalog
  770. # Temporary table check method. catalog, trace or none.
  771. # Default is catalog.
  772.  
  773. check_unlogged_table = on
  774. # If on, enable unlogged table check in SELECT statements.
  775. # This initiates queries against system catalog of primary/master
  776. # thus increases load of master.
  777. # If you are absolutely sure that your system never uses unlogged tables
  778. # and you want to save access to primary/master, you could turn this off.
  779. # Default is on.
  780. enable_shared_relcache = on
  781. # If on, relation cache stored in memory cache,
  782. # the cache is shared among child process.
  783. # Default is on.
  784. # (change requires restart)
  785.  
  786. relcache_query_target = primary # Target node to send relcache queries. Default is master (primary) node.
  787. # If load_balance_node is specified, queries will be sent to load balance node.
  788. #------------------------------------------------------------------------------
  789. # IN MEMORY QUERY MEMORY CACHE
  790. #------------------------------------------------------------------------------
  791. memory_cache_enabled = off
  792. # If on, use the memory cache functionality, off by default
  793. # (change requires restart)
  794. memqcache_method = 'shmem'
  795. # Cache storage method. either 'shmem'(shared memory) or
  796. # 'memcached'. 'shmem' by default
  797. # (change requires restart)
  798. memqcache_memcached_host = 'localhost'
  799. # Memcached host name or IP address. Mandatory if
  800. # memqcache_method = 'memcached'.
  801. # Defaults to localhost.
  802. # (change requires restart)
  803. memqcache_memcached_port = 11211
  804. # Memcached port number. Mondatory if memqcache_method = 'memcached'.
  805. # Defaults to 11211.
  806. # (change requires restart)
  807. memqcache_total_size = 67108864
  808. # Total memory size in bytes for storing memory cache.
  809. # Mandatory if memqcache_method = 'shmem'.
  810. # Defaults to 64MB.
  811. # (change requires restart)
  812. memqcache_max_num_cache = 1000000
  813. # Total number of cache entries. Mandatory
  814. # if memqcache_method = 'shmem'.
  815. # Each cache entry consumes 48 bytes on shared memory.
  816. # Defaults to 1,000,000(45.8MB).
  817. # (change requires restart)
  818. memqcache_expire = 0
  819. # Memory cache entry life time specified in seconds.
  820. # 0 means infinite life time. 0 by default.
  821. # (change requires restart)
  822. memqcache_auto_cache_invalidation = on
  823. # If on, invalidation of query cache is triggered by corresponding
  824. # DDL/DML/DCL(and memqcache_expire). If off, it is only triggered
  825. # by memqcache_expire. on by default.
  826. # (change requires restart)
  827. memqcache_maxcache = 409600
  828. # Maximum SELECT result size in bytes.
  829. # Must be smaller than memqcache_cache_block_size. Defaults to 400KB.
  830. # (change requires restart)
  831. memqcache_cache_block_size = 1048576
  832. # Cache block size in bytes. Mandatory if memqcache_method = 'shmem'.
  833. # Defaults to 1MB.
  834. # (change requires restart)
  835. memqcache_oiddir = '/var/log/pgpool/oiddir'
  836. # Temporary work directory to record table oids
  837. # (change requires restart)
  838. white_memqcache_table_list = ''
  839. # Comma separated list of table names to memcache
  840. # that don't write to database
  841. # Regexp are accepted
  842. black_memqcache_table_list = ''
  843. # Comma separated list of table names not to memcache
  844. # that don't write to database
  845. # Regexp are accepted
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement