Advertisement
Guest User

Untitled

a guest
Jul 6th, 2016
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.59 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. #------------------------------------------------------------------------------
  22. # CONNECTIONS
  23. #------------------------------------------------------------------------------
  24.  
  25. # - pgpool Connection Settings -
  26.  
  27. listen_addresses = 'localhost'
  28. # Host name or IP address to listen on:
  29. # '*' for all, '' for no TCP/IP connections
  30. # (change requires restart)
  31. port = 5434
  32. # Port number
  33. # (change requires restart)
  34. socket_dir = '/var/run/postgresql'
  35. # Unix domain socket path
  36. # The Debian package defaults to
  37. # /var/run/postgresql
  38. # (change requires restart)
  39. listen_backlog_multiplier = 2
  40. # Set the backlog parameter of listen(2) to
  41. # num_init_children * listen_backlog_multiplier.
  42. # (change requires restart)
  43.  
  44. # - pgpool Communication Manager Connection Settings -
  45.  
  46. pcp_listen_addresses = '*'
  47. # Host name or IP address for pcp process to listen on:
  48. # '*' for all, '' for no TCP/IP connections
  49. # (change requires restart)
  50. pcp_port = 9898
  51. # Port number for pcp
  52. # (change requires restart)
  53. pcp_socket_dir = '/var/run/postgresql'
  54. # Unix domain socket path for pcp
  55. # The Debian package defaults to
  56. # /var/run/postgresql
  57. # (change requires restart)
  58.  
  59. # - Backend Connection Settings -
  60.  
  61. backend_hostname0 = 'localhost'
  62. # Host name or IP address to connect to for backend 0
  63. backend_port0 = 5432
  64. # Port number for backend 0
  65. backend_weight0 = 1
  66. # Weight for backend 0 (only in load balancing mode)
  67. backend_data_directory0 = '/var/lib/pgsql/data'
  68. # Data directory for backend 0
  69. backend_flag0 = 'ALLOW_TO_FAILOVER'
  70. # Controls various backend behavior
  71. # ALLOW_TO_FAILOVER or DISALLOW_TO_FAILOVER
  72. #backend_hostname1 = 'host2'
  73. #backend_port1 = 5433
  74. #backend_weight1 = 1
  75. #backend_data_directory1 = '/data1'
  76. #backend_flag1 = 'ALLOW_TO_FAILOVER'
  77.  
  78. # - Authentication -
  79.  
  80. enable_pool_hba = off
  81. # Use pool_hba.conf for client authentication
  82. pool_passwd = 'pool_passwd'
  83. # File name of pool_passwd for md5 authentication.
  84. # "" disables pool_passwd.
  85. # (change requires restart)
  86. authentication_timeout = 60
  87. # Delay in seconds to complete client authentication
  88. # 0 means no timeout.
  89.  
  90. # - SSL Connections -
  91.  
  92. ssl = off
  93. # Enable SSL support
  94. # (change requires restart)
  95. #ssl_key = './server.key'
  96. # Path to the SSL private key file
  97. # (change requires restart)
  98. #ssl_cert = './server.cert'
  99. # Path to the SSL public certificate file
  100. # (change requires restart)
  101. #ssl_ca_cert = ''
  102. # Path to a single PEM format file
  103. # containing CA root certificate(s)
  104. # (change requires restart)
  105. #ssl_ca_cert_dir = ''
  106. # Directory containing CA root certificate(s)
  107. # (change requires restart)
  108.  
  109.  
  110. #------------------------------------------------------------------------------
  111. # POOLS
  112. #------------------------------------------------------------------------------
  113.  
  114. # - Pool size -
  115.  
  116. num_init_children = 32
  117. # Number of pools
  118. # (change requires restart)
  119. max_pool = 4
  120. # Number of connections per pool
  121. # (change requires restart)
  122.  
  123. # - Life time -
  124.  
  125. child_life_time = 300
  126. # Pool exits after being idle for this many seconds
  127. child_max_connections = 0
  128. # Pool exits after receiving that many connections
  129. # 0 means no exit
  130. connection_life_time = 0
  131. # Connection to backend closes after being idle for this many seconds
  132. # 0 means no close
  133. client_idle_limit = 0
  134. # Client is disconnected after being idle for that many seconds
  135. # (even inside an explicit transactions!)
  136. # 0 means no disconnection
  137.  
  138.  
  139. #------------------------------------------------------------------------------
  140. # LOGS
  141. #------------------------------------------------------------------------------
  142.  
  143. # - Where to log -
  144.  
  145. log_destination = 'stderr'
  146. # Where to log
  147. # Valid values are combinations of stderr,
  148. # and syslog. Default to stderr.
  149.  
  150. # - What to log -
  151.  
  152. log_line_prefix = '%t: pid %p: ' # printf-style string to output at beginning of each log line.
  153.  
  154. log_connections = off
  155. # Log connections
  156. log_hostname = off
  157. # Hostname will be shown in ps status
  158. # and in logs if connections are logged
  159. log_statement = off
  160. # Log all statements
  161. log_per_node_statement = off
  162. # Log all statements
  163. # with node and backend informations
  164. log_standby_delay = 'none'
  165. # Log standby delay
  166. # Valid values are combinations of always,
  167. # if_over_threshold, none
  168.  
  169. # - Syslog specific -
  170.  
  171. syslog_facility = 'LOCAL0'
  172. # Syslog local facility. Default to LOCAL0
  173. syslog_ident = 'pgpool'
  174. # Syslog program identification string
  175. # Default to 'pgpool'
  176.  
  177. # - Debug -
  178.  
  179. debug_level = 0
  180. # Debug message verbosity level
  181. # 0 means no message, 1 or more mean verbose
  182.  
  183. #log_error_verbosity = default # terse, default, or verbose messages
  184.  
  185. #client_min_messages = notice # values in order of decreasing detail:
  186. # debug5
  187. # debug4
  188. # debug3
  189. # debug2
  190. # debug1
  191. # log
  192. # notice
  193. # warning
  194. # error
  195.  
  196. #log_min_messages = warning # values in order of decreasing detail:
  197. # debug5
  198. # debug4
  199. # debug3
  200. # debug2
  201. # debug1
  202. # info
  203. # notice
  204. # warning
  205. # error
  206. # log
  207. # fatal
  208. # panic
  209.  
  210. #------------------------------------------------------------------------------
  211. # FILE LOCATIONS
  212. #------------------------------------------------------------------------------
  213.  
  214. pid_file_name = '/var/run/postgresql/pgpool.pid'
  215. # PID file name
  216. # (change requires restart)
  217. logdir = '/var/log/postgresql'
  218. # Directory of pgPool status file
  219. # (change requires restart)
  220.  
  221.  
  222. #------------------------------------------------------------------------------
  223. # CONNECTION POOLING
  224. #------------------------------------------------------------------------------
  225.  
  226. connection_cache = on
  227. # Activate connection pools
  228. # (change requires restart)
  229.  
  230. # Semicolon separated list of queries
  231. # to be issued at the end of a session
  232. # The default is for 8.3 and later
  233. reset_query_list = 'ABORT; DISCARD ALL'
  234. # The following one is for 8.2 and before
  235. #reset_query_list = 'ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT'
  236.  
  237.  
  238. #------------------------------------------------------------------------------
  239. # REPLICATION MODE
  240. #------------------------------------------------------------------------------
  241.  
  242. replication_mode = off
  243. # Activate replication mode
  244. # (change requires restart)
  245. replicate_select = off
  246. # Replicate SELECT statements
  247. # when in replication mode
  248. # replicate_select is higher priority than
  249. # load_balance_mode.
  250.  
  251. insert_lock = on
  252. # Automatically locks a dummy row or a table
  253. # with INSERT statements to keep SERIAL data
  254. # consistency
  255. # Without SERIAL, no lock will be issued
  256. lobj_lock_table = ''
  257. # When rewriting lo_creat command in
  258. # replication mode, specify table name to
  259. # lock
  260.  
  261. # - Degenerate handling -
  262.  
  263. replication_stop_on_mismatch = off
  264. # On disagreement with the packet kind
  265. # sent from backend, degenerate the node
  266. # which is most likely "minority"
  267. # If off, just force to exit this session
  268.  
  269. failover_if_affected_tuples_mismatch = off
  270. # On disagreement with the number of affected
  271. # tuples in UPDATE/DELETE queries, then
  272. # degenerate the node which is most likely
  273. # "minority".
  274. # If off, just abort the transaction to
  275. # keep the consistency
  276.  
  277.  
  278. #------------------------------------------------------------------------------
  279. # LOAD BALANCING MODE
  280. #------------------------------------------------------------------------------
  281.  
  282. load_balance_mode = off
  283. # Activate load balancing mode
  284. # (change requires restart)
  285. ignore_leading_white_space = on
  286. # Ignore leading white spaces of each query
  287. white_function_list = ''
  288. # Comma separated list of function names
  289. # that don't write to database
  290. # Regexp are accepted
  291. black_function_list = 'nextval,setval,nextval,setval'
  292. # Comma separated list of function names
  293. # that write to database
  294. # Regexp are accepted
  295.  
  296. database_redirect_preference_list = ''
  297. # comma separated list of pairs of database and node id.
  298. # example: postgres:primary,mydb[0-4]:1,mydb[5-9]:2'
  299. # valid for streaming replicaton mode only.
  300.  
  301. app_name_redirect_preference_list = ''
  302. # comma separated list of pairs of app name and node id.
  303. # example: 'psql:primary,myapp[0-4]:1,myapp[5-9]:standby'
  304. # valid for streaming replicaton mode only.
  305. allow_sql_comments = off
  306. # if on, ignore SQL comments when judging if load balance or
  307. # query cache is possible.
  308. # If off, SQL comments effectively prevent the judgment
  309. # (pre 3.4 behavior).
  310.  
  311. #------------------------------------------------------------------------------
  312. # MASTER/SLAVE MODE
  313. #------------------------------------------------------------------------------
  314.  
  315. master_slave_mode = off
  316. # Activate master/slave mode
  317. # (change requires restart)
  318. master_slave_sub_mode = 'slony'
  319. # Master/slave sub mode
  320. # Valid values are combinations slony or
  321. # stream. Default is slony.
  322. # (change requires restart)
  323.  
  324. # - Streaming -
  325.  
  326. sr_check_period = 0
  327. # Streaming replication check period
  328. # Disabled (0) by default
  329. sr_check_user = 'nobody'
  330. # Streaming replication check user
  331. # This is necessary even if you disable
  332. # streaming replication delay check with
  333. # sr_check_period = 0
  334. sr_check_password = ''
  335. # Password for streaming replication check user
  336. delay_threshold = 0
  337. # Threshold before not dispatching query to standby node
  338. # Unit is in bytes
  339. # Disabled (0) by default
  340.  
  341. # - Special commands -
  342.  
  343. follow_master_command = ''
  344. # Executes this command after master failover
  345. # Special values:
  346. # %d = node id
  347. # %h = host name
  348. # %p = port number
  349. # %D = database cluster path
  350. # %m = new master node id
  351. # %H = hostname of the new master node
  352. # %M = old master node id
  353. # %P = old primary node id
  354. # %r = new master port number
  355. # %R = new master database cluster path
  356. # %% = '%' character
  357.  
  358. #------------------------------------------------------------------------------
  359. # HEALTH CHECK
  360. #------------------------------------------------------------------------------
  361.  
  362. health_check_period = 0
  363. # Health check period
  364. # Disabled (0) by default
  365. health_check_timeout = 20
  366. # Health check timeout
  367. # 0 means no timeout
  368. health_check_user = 'nobody'
  369. # Health check user
  370. health_check_password = ''
  371. # Password for health check user
  372. health_check_max_retries = 0
  373. # Maximum number of times to retry a failed health check before giving up.
  374. health_check_retry_delay = 1
  375. # Amount of time to wait (in seconds) between retries.
  376. connect_timeout = 10000
  377. # Timeout value in milliseconds before giving up to connect to backend.
  378. # Default is 10000 ms (10 second). Flaky network user may want to increase
  379. # the value. 0 means no timeout.
  380. # Note that this value is not only used for health check,
  381. # but also for ordinary conection to backend.
  382.  
  383. #------------------------------------------------------------------------------
  384. # FAILOVER AND FAILBACK
  385. #------------------------------------------------------------------------------
  386.  
  387. failover_command = ''
  388. # Executes this command at failover
  389. # Special values:
  390. # %d = node id
  391. # %h = host name
  392. # %p = port number
  393. # %D = database cluster path
  394. # %m = new master node id
  395. # %H = hostname of the new master node
  396. # %M = old master node id
  397. # %P = old primary node id
  398. # %r = new master port number
  399. # %R = new master database cluster path
  400. # %% = '%' character
  401. failback_command = ''
  402. # Executes this command at failback.
  403. # Special values:
  404. # %d = node id
  405. # %h = host name
  406. # %p = port number
  407. # %D = database cluster path
  408. # %m = new master node id
  409. # %H = hostname of the new master node
  410. # %M = old master node id
  411. # %P = old primary node id
  412. # %r = new master port number
  413. # %R = new master database cluster path
  414. # %% = '%' character
  415.  
  416. fail_over_on_backend_error = on
  417. # Initiates failover when reading/writing to the
  418. # backend communication socket fails
  419. # If set to off, pgpool will report an
  420. # error and disconnect the session.
  421.  
  422. search_primary_node_timeout = 10
  423. # Timeout in seconds to search for the
  424. # primary node when a failover occurs.
  425. # 0 means no timeout, keep searching
  426. # for a primary node forever.
  427.  
  428. #------------------------------------------------------------------------------
  429. # ONLINE RECOVERY
  430. #------------------------------------------------------------------------------
  431.  
  432. recovery_user = 'nobody'
  433. # Online recovery user
  434. recovery_password = ''
  435. # Online recovery password
  436. recovery_1st_stage_command = ''
  437. # Executes a command in first stage
  438. recovery_2nd_stage_command = ''
  439. # Executes a command in second stage
  440. recovery_timeout = 90
  441. # Timeout in seconds to wait for the
  442. # recovering node's postmaster to start up
  443. # 0 means no wait
  444. client_idle_limit_in_recovery = 0
  445. # Client is disconnected after being idle
  446. # for that many seconds in the second stage
  447. # of online recovery
  448. # 0 means no disconnection
  449. # -1 means immediate disconnection
  450.  
  451.  
  452. #------------------------------------------------------------------------------
  453. # WATCHDOG
  454. #------------------------------------------------------------------------------
  455.  
  456. # - Enabling -
  457.  
  458. use_watchdog = off
  459. # Activates watchdog
  460. # (change requires restart)
  461.  
  462. # -Connection to up stream servers -
  463.  
  464. trusted_servers = ''
  465. # trusted server list which are used
  466. # to confirm network connection
  467. # (hostA,hostB,hostC,...)
  468. # (change requires restart)
  469. ping_path = '/bin'
  470. # ping command path
  471. # (change requires restart)
  472.  
  473. # - Watchdog communication Settings -
  474.  
  475. wd_hostname = ''
  476. # Host name or IP address of this watchdog
  477. # (change requires restart)
  478. wd_port = 9000
  479. # port number for watchdog service
  480. # (change requires restart)
  481. wd_authkey = ''
  482. # Authentication key for watchdog communication
  483. # (change requires restart)
  484.  
  485. # - Virtual IP control Setting -
  486.  
  487. delegate_IP = ''
  488. # delegate IP address
  489. # If this is empty, virtual IP never bring up.
  490. # (change requires restart)
  491. ifconfig_path = '/sbin'
  492. # ifconfig command path
  493. # (change requires restart)
  494. if_up_cmd = 'ifconfig eth0:0 inet $_IP_$ netmask 255.255.255.0'
  495. # startup delegate IP command
  496. # (change requires restart)
  497. if_down_cmd = 'ifconfig eth0:0 down'
  498. # shutdown delegate IP command
  499. # (change requires restart)
  500.  
  501. arping_path = '/usr/sbin' # arping command path
  502. # (change requires restart)
  503.  
  504. arping_cmd = 'arping -U $_IP_$ -w 1'
  505. # arping command
  506. # (change requires restart)
  507.  
  508. # - Behaivor on escalation Setting -
  509.  
  510. clear_memqcache_on_escalation = on
  511. # Clear all the query cache on shared memory
  512. # when standby pgpool escalate to active pgpool
  513. # (= virtual IP holder).
  514. # This should be off if client connects to pgpool
  515. # not using virtual IP.
  516. # (change requires restart)
  517. wd_escalation_command = ''
  518. # Executes this command at escalation on new active pgpool.
  519. # (change requires restart)
  520.  
  521. # - Lifecheck Setting -
  522.  
  523. # -- common --
  524.  
  525. wd_lifecheck_method = 'heartbeat'
  526. # Method of watchdog lifecheck ('heartbeat' or 'query')
  527. # (change requires restart)
  528. wd_interval = 10
  529. # lifecheck interval (sec) > 0
  530. # (change requires restart)
  531.  
  532. # -- heartbeat mode --
  533.  
  534. wd_heartbeat_port = 9694
  535. # Port number for receiving heartbeat signal
  536. # (change requires restart)
  537. wd_heartbeat_keepalive = 2
  538. # Interval time of sending heartbeat signal (sec)
  539. # (change requires restart)
  540. wd_heartbeat_deadtime = 30
  541. # Deadtime interval for heartbeat signal (sec)
  542. # (change requires restart)
  543. heartbeat_destination0 = 'host0_ip1'
  544. # Host name or IP address of destination 0
  545. # for sending heartbeat signal.
  546. # (change requires restart)
  547. heartbeat_destination_port0 = 9694
  548. # Port number of destination 0 for sending
  549. # heartbeat signal. Usually this is the
  550. # same as wd_heartbeat_port.
  551. # (change requires restart)
  552. heartbeat_device0 = ''
  553. # Name of NIC device (such like 'eth0')
  554. # used for sending/receiving heartbeat
  555. # signal to/from destination 0.
  556. # This works only when this is not empty
  557. # and pgpool has root privilege.
  558. # (change requires restart)
  559.  
  560. #heartbeat_destination1 = 'host0_ip2'
  561. #heartbeat_destination_port1 = 9694
  562. #heartbeat_device1 = ''
  563.  
  564. # -- query mode --
  565.  
  566. wd_life_point = 3
  567. # lifecheck retry times
  568. # (change requires restart)
  569. wd_lifecheck_query = 'SELECT 1'
  570. # lifecheck query to pgpool from watchdog
  571. # (change requires restart)
  572. wd_lifecheck_dbname = 'template1'
  573. # Database name connected for lifecheck
  574. # (change requires restart)
  575. wd_lifecheck_user = 'nobody'
  576. # watchdog user monitoring pgpools in lifecheck
  577. # (change requires restart)
  578. wd_lifecheck_password = ''
  579. # Password for watchdog user in lifecheck
  580. # (change requires restart)
  581.  
  582. # - Other pgpool Connection Settings -
  583.  
  584. #other_pgpool_hostname0 = 'host0'
  585. # Host name or IP address to connect to for other pgpool 0
  586. # (change requires restart)
  587. #other_pgpool_port0 = 5432
  588. # Port number for othet pgpool 0
  589. # (change requires restart)
  590. #other_wd_port0 = 9000
  591. # Port number for othet watchdog 0
  592. # (change requires restart)
  593. #other_pgpool_hostname1 = 'host1'
  594. #other_pgpool_port1 = 5432
  595. #other_wd_port1 = 9000
  596.  
  597.  
  598. #------------------------------------------------------------------------------
  599. # OTHERS
  600. #------------------------------------------------------------------------------
  601. relcache_expire = 0
  602. # Life time of relation cache in seconds.
  603. # 0 means no cache expiration(the default).
  604. # The relation cache is used for cache the
  605. # query result against PostgreSQL system
  606. # catalog to obtain various information
  607. # including table structures or if it's a
  608. # temporary table or not. The cache is
  609. # maintained in a pgpool child local memory
  610. # and being kept as long as it survives.
  611. # If someone modify the table by using
  612. # ALTER TABLE or some such, the relcache is
  613. # not consistent anymore.
  614. # For this purpose, cache_expiration
  615. # controls the life time of the cache.
  616.  
  617. relcache_size = 256
  618. # Number of relation cache
  619. # entry. If you see frequently:
  620. # "pool_search_relcache: cache replacement happend"
  621. # in the pgpool log, you might want to increate this number.
  622.  
  623. check_temp_table = on
  624. # If on, enable temporary table check in SELECT statements.
  625. # This initiates queries against system catalog of primary/master
  626. # thus increases load of master.
  627. # If you are absolutely sure that your system never uses temporary tables
  628. # and you want to save access to primary/master, you could turn this off.
  629. # Default is on.
  630.  
  631. check_unlogged_table = on
  632. # If on, enable unlogged table check in SELECT statements.
  633. # This initiates queries against system catalog of primary/master
  634. # thus increases load of master.
  635. # If you are absolutely sure that your system never uses unlogged tables
  636. # and you want to save access to primary/master, you could turn this off.
  637. # Default is on.
  638.  
  639. #------------------------------------------------------------------------------
  640. # IN MEMORY QUERY MEMORY CACHE
  641. #------------------------------------------------------------------------------
  642. memory_cache_enabled = off
  643. # If on, use the memory cache functionality, off by default
  644. memqcache_method = 'shmem'
  645. # Cache storage method. either 'shmem'(shared memory) or
  646. # 'memcached'. 'shmem' by default
  647. # (change requires restart)
  648. memqcache_memcached_host = 'localhost'
  649. # Memcached host name or IP address. Mandatory if
  650. # memqcache_method = 'memcached'.
  651. # Defaults to localhost.
  652. # (change requires restart)
  653. memqcache_memcached_port = 11211
  654. # Memcached port number. Mondatory if memqcache_method = 'memcached'.
  655. # Defaults to 11211.
  656. # (change requires restart)
  657. memqcache_total_size = 67108864
  658. # Total memory size in bytes for storing memory cache.
  659. # Mandatory if memqcache_method = 'shmem'.
  660. # Defaults to 64MB.
  661. # (change requires restart)
  662. memqcache_max_num_cache = 1000000
  663. # Total number of cache entries. Mandatory
  664. # if memqcache_method = 'shmem'.
  665. # Each cache entry consumes 48 bytes on shared memory.
  666. # Defaults to 1,000,000(45.8MB).
  667. # (change requires restart)
  668. memqcache_expire = 0
  669. # Memory cache entry life time specified in seconds.
  670. # 0 means infinite life time. 0 by default.
  671. # (change requires restart)
  672. memqcache_auto_cache_invalidation = on
  673. # If on, invalidation of query cache is triggered by corresponding
  674. # DDL/DML/DCL(and memqcache_expire). If off, it is only triggered
  675. # by memqcache_expire. on by default.
  676. # (change requires restart)
  677. memqcache_maxcache = 409600
  678. # Maximum SELECT result size in bytes.
  679. # Must be smaller than memqcache_cache_block_size. Defaults to 400KB.
  680. # (change requires restart)
  681. memqcache_cache_block_size = 1048576
  682. # Cache block size in bytes. Mandatory if memqcache_method = 'shmem'.
  683. # Defaults to 1MB.
  684. # (change requires restart)
  685. memqcache_oiddir = '/var/log/pgpool/oiddir'
  686. # Temporary work directory to record table oids
  687. # (change requires restart)
  688. white_memqcache_table_list = ''
  689. # Comma separated list of table names to memcache
  690. # that don't write to database
  691. # Regexp are accepted
  692. black_memqcache_table_list = ''
  693. # Comma separated list of table names not to memcache
  694. # that don't write to database
  695. # Regexp are accepted
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement