Advertisement
Guest User

Untitled

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