Advertisement
Guest User

Untitled

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