doc.zh-cn is not actually translated, it's just a copy of doc.
+++ /dev/null
-# suggested by libtoolize
-ACLOCAL_AMFLAGS = -I m4
-DEFS = @DEFS@ \
- -DDEFAULT_CONFIGDIR=\"$(sysconfdir)\"
-
-SUBDIRS = src
+++ /dev/null
-# Makefile.in generated by automake 1.13.4 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = doc.zh-cn
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/mkinstalldirs
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/docbook.m4 \
- $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
- $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
- $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/c-compiler.m4 \
- $(top_srcdir)/c-library.m4 $(top_srcdir)/general.m4 \
- $(top_srcdir)/ac_func_accept_argtypes.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/src/include/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-depcomp =
-am__depfiles_maybe =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
- ctags-recursive dvi-recursive html-recursive info-recursive \
- install-data-recursive install-dvi-recursive \
- install-exec-recursive install-html-recursive \
- install-info-recursive install-pdf-recursive \
- install-ps-recursive install-recursive installcheck-recursive \
- installdirs-recursive pdf-recursive ps-recursive \
- tags-recursive uninstall-recursive
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
- distclean-recursive maintainer-clean-recursive
-am__recursive_targets = \
- $(RECURSIVE_TARGETS) \
- $(RECURSIVE_CLEAN_TARGETS) \
- $(am__extra_recursive_targets)
-AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
- distdir
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
- dir0=`pwd`; \
- sed_first='s,^\([^/]*\)/.*$$,\1,'; \
- sed_rest='s,^[^/]*/*,,'; \
- sed_last='s,^.*/\([^/]*\)$$,\1,'; \
- sed_butlast='s,/*[^/]*$$,,'; \
- while test -n "$$dir1"; do \
- first=`echo "$$dir1" | sed -e "$$sed_first"`; \
- if test "$$first" != "."; then \
- if test "$$first" = ".."; then \
- dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
- dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
- else \
- first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
- if test "$$first2" = "$$first"; then \
- dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
- else \
- dir2="../$$dir2"; \
- fi; \
- dir0="$$dir0"/"$$first"; \
- fi; \
- fi; \
- dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
- done; \
- reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AR_FLAGS = @AR_FLAGS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CATALOG = @CATALOG@
-CC = @CC@
-CFLAGS = @CFLAGS@
-COLLATEINDEX = @COLLATEINDEX@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@ \
- -DDEFAULT_CONFIGDIR=\"$(sysconfdir)\"
-
-DLLTOOL = @DLLTOOL@
-DOCBOOKSTYLE = @DOCBOOKSTYLE@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-JADE = @JADE@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LEX = @LEX@
-LEXLIB = @LEXLIB@
-LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LYNX = @LYNX@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MEMCACHED_DIR = @MEMCACHED_DIR@
-MEMCACHED_INCLUDE_OPT = @MEMCACHED_INCLUDE_OPT@
-MEMCACHED_LINK_OPT = @MEMCACHED_LINK_OPT@
-MEMCACHED_RPATH_OPT = @MEMCACHED_RPATH_OPT@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-NSGMLS = @NSGMLS@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OSX = @OSX@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PERL = @PERL@
-PGCONFIG = @PGCONFIG@
-PGSQL_BIN_DIR = @PGSQL_BIN_DIR@
-PGSQL_INCLUDE_DIR = @PGSQL_INCLUDE_DIR@
-PGSQL_LIB_DIR = @PGSQL_LIB_DIR@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-STYLE = @STYLE@
-SUNIFDEF = @SUNIFDEF@
-VERSION = @VERSION@
-XMLLINT = @XMLLINT@
-XSLTPROC = @XSLTPROC@
-XSLTPROC_HTML_FLAGS = @XSLTPROC_HTML_FLAGS@
-YACC = @YACC@
-YFLAGS = @YFLAGS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__leading_dot = @am__leading_dot@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-have_docbook = @have_docbook@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-# suggested by libtoolize
-ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = src
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps doc.zh-cn/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign --ignore-deps doc.zh-cn/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run 'make' without going through this Makefile.
-# To change the values of 'make' variables: instead of editing Makefiles,
-# (1) if the variable is set in 'config.status', edit 'config.status'
-# (which will cause the Makefiles to be regenerated when you run 'make');
-# (2) otherwise, pass the desired values on the 'make' command line.
-$(am__recursive_targets):
- @fail=; \
- if $(am__make_keepgoing); then \
- failcom='fail=yes'; \
- else \
- failcom='exit 1'; \
- fi; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-recursive
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-recursive
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-recursive
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- $(am__make_dryrun) \
- || test -d "$(distdir)/$$subdir" \
- || $(MKDIR_P) "$(distdir)/$$subdir" \
- || exit 1; \
- dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
- $(am__relativize); \
- new_distdir=$$reldir; \
- dir1=$$subdir; dir2="$(top_distdir)"; \
- $(am__relativize); \
- new_top_distdir=$$reldir; \
- echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
- echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
- ($(am__cd) $$subdir && \
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$new_top_distdir" \
- distdir="$$new_distdir" \
- am__remove_distdir=: \
- am__skip_length_check=: \
- am__skip_mode_fix=: \
- distdir) \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
- -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(am__recursive_targets) install-am install-strip
-
-.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
- check-am clean clean-generic clean-libtool cscopelist-am ctags \
- ctags-am distclean distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- installdirs-am maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
- ps ps-am tags tags-am uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
+++ /dev/null
-# suggested by libtoolize
-ACLOCAL_AMFLAGS = -I m4
-DEFS = @DEFS@ \
- -DDEFAULT_CONFIGDIR=\"$(sysconfdir)\"
-
-EXTRA_DIST = figures/process-diagram.gif \
- figures/process-diagram.odp \
- figures/cluster.gif \
- figures/cluster.odp
-
-SUBDIRS = sgml
-
+++ /dev/null
-# Makefile.in generated by automake 1.13.4 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = doc.zh-cn/src
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/mkinstalldirs
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/docbook.m4 \
- $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
- $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
- $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/c-compiler.m4 \
- $(top_srcdir)/c-library.m4 $(top_srcdir)/general.m4 \
- $(top_srcdir)/ac_func_accept_argtypes.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/src/include/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-depcomp =
-am__depfiles_maybe =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
- ctags-recursive dvi-recursive html-recursive info-recursive \
- install-data-recursive install-dvi-recursive \
- install-exec-recursive install-html-recursive \
- install-info-recursive install-pdf-recursive \
- install-ps-recursive install-recursive installcheck-recursive \
- installdirs-recursive pdf-recursive ps-recursive \
- tags-recursive uninstall-recursive
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
- distclean-recursive maintainer-clean-recursive
-am__recursive_targets = \
- $(RECURSIVE_TARGETS) \
- $(RECURSIVE_CLEAN_TARGETS) \
- $(am__extra_recursive_targets)
-AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
- distdir
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
- dir0=`pwd`; \
- sed_first='s,^\([^/]*\)/.*$$,\1,'; \
- sed_rest='s,^[^/]*/*,,'; \
- sed_last='s,^.*/\([^/]*\)$$,\1,'; \
- sed_butlast='s,/*[^/]*$$,,'; \
- while test -n "$$dir1"; do \
- first=`echo "$$dir1" | sed -e "$$sed_first"`; \
- if test "$$first" != "."; then \
- if test "$$first" = ".."; then \
- dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
- dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
- else \
- first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
- if test "$$first2" = "$$first"; then \
- dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
- else \
- dir2="../$$dir2"; \
- fi; \
- dir0="$$dir0"/"$$first"; \
- fi; \
- fi; \
- dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
- done; \
- reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AR_FLAGS = @AR_FLAGS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CATALOG = @CATALOG@
-CC = @CC@
-CFLAGS = @CFLAGS@
-COLLATEINDEX = @COLLATEINDEX@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@ \
- -DDEFAULT_CONFIGDIR=\"$(sysconfdir)\"
-
-DLLTOOL = @DLLTOOL@
-DOCBOOKSTYLE = @DOCBOOKSTYLE@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-JADE = @JADE@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LEX = @LEX@
-LEXLIB = @LEXLIB@
-LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LYNX = @LYNX@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MEMCACHED_DIR = @MEMCACHED_DIR@
-MEMCACHED_INCLUDE_OPT = @MEMCACHED_INCLUDE_OPT@
-MEMCACHED_LINK_OPT = @MEMCACHED_LINK_OPT@
-MEMCACHED_RPATH_OPT = @MEMCACHED_RPATH_OPT@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-NSGMLS = @NSGMLS@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OSX = @OSX@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PERL = @PERL@
-PGCONFIG = @PGCONFIG@
-PGSQL_BIN_DIR = @PGSQL_BIN_DIR@
-PGSQL_INCLUDE_DIR = @PGSQL_INCLUDE_DIR@
-PGSQL_LIB_DIR = @PGSQL_LIB_DIR@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-STYLE = @STYLE@
-SUNIFDEF = @SUNIFDEF@
-VERSION = @VERSION@
-XMLLINT = @XMLLINT@
-XSLTPROC = @XSLTPROC@
-XSLTPROC_HTML_FLAGS = @XSLTPROC_HTML_FLAGS@
-YACC = @YACC@
-YFLAGS = @YFLAGS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__leading_dot = @am__leading_dot@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-have_docbook = @have_docbook@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-# suggested by libtoolize
-ACLOCAL_AMFLAGS = -I m4
-EXTRA_DIST = figures/process-diagram.gif \
- figures/process-diagram.odp \
- figures/cluster.gif \
- figures/cluster.odp
-
-SUBDIRS = sgml
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps doc.zh-cn/src/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign --ignore-deps doc.zh-cn/src/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run 'make' without going through this Makefile.
-# To change the values of 'make' variables: instead of editing Makefiles,
-# (1) if the variable is set in 'config.status', edit 'config.status'
-# (which will cause the Makefiles to be regenerated when you run 'make');
-# (2) otherwise, pass the desired values on the 'make' command line.
-$(am__recursive_targets):
- @fail=; \
- if $(am__make_keepgoing); then \
- failcom='fail=yes'; \
- else \
- failcom='exit 1'; \
- fi; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-recursive
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-recursive
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-recursive
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- $(am__make_dryrun) \
- || test -d "$(distdir)/$$subdir" \
- || $(MKDIR_P) "$(distdir)/$$subdir" \
- || exit 1; \
- dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
- $(am__relativize); \
- new_distdir=$$reldir; \
- dir1=$$subdir; dir2="$(top_distdir)"; \
- $(am__relativize); \
- new_top_distdir=$$reldir; \
- echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
- echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
- ($(am__cd) $$subdir && \
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$new_top_distdir" \
- distdir="$$new_distdir" \
- am__remove_distdir=: \
- am__skip_length_check=: \
- am__skip_mode_fix=: \
- distdir) \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
- -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(am__recursive_targets) install-am install-strip
-
-.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
- check-am clean clean-generic clean-libtool cscopelist-am ctags \
- ctags-am distclean distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- installdirs-am maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
- ps ps-am tags tags-am uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
+++ /dev/null
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.2//EN"[
- <!ENTITY % version SYSTEM "version.sgml">
- %version;
-]>
-
-<book id="pgpool-II-en"><title>pgpool-II english documentation</title>
- <bookinfo>
- <productname>pgpool-doc-en</productname>
- <productnumber>&version;</productnumber>
- <abstract>
- <para>
- Hello pgpool-II!
- </para>
- </abstract>
-</bookinfo>
-</book>
-
+++ /dev/null
-HTML.index
-bookindex.sgml
-html/
-man-stamp
-man1/
-man3/
-pgpool.xml
+++ /dev/null
-# suggested by libtoolize
-ACLOCAL_AMFLAGS = -I m4
-DEFS = @DEFS@ \
- -DDEFAULT_CONFIGDIR=\"$(sysconfdir)\"
-
-all: html man1 man8
-
-GENERATED_SGML = bookindex.sgml version.sgml
-
-ALLSGML := $(wildcard $(srcdir)/*.sgml $(srcdir)/ref/*.sgml) $(GENERATED_SGML)
-
-# Sometimes we don't want this one.
-ALMOSTALLSGML := $(filter-out %bookindex.sgml,$(ALLSGML))
-
-SPFLAGS = -wall -wno-unused-param -wno-empty -wfully-tagged
-
-OUTDIR = html
-
-#if DOCBOOKSTYLE
-#CATALOG = -c $(DOCBOOKSTYLE)/catalog
-#endif
-
-#override XSLTPROCFLAGS += --stringparam pgpool.version '$(VERSION)'
-override XSLTPROCFLAGS += --stringparam pg.version '$(VERSION)'
-
-#jade -G -t sgml -i html -d stylesheet.dsl#html -o abas pgpool-en.sgm
-#JADE.html.call = $(JADE) $(JADEFLAGS) $(SPFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t sgml -i output-html
-JADE.html.call = SP_CHARSET_FIXED=1 SP_ENCODING=UTF-8 $(JADE) $(JADEFLAGS) $(SPFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t sgml -i output-html
-if STYLE_ENV_SET
-JADE.html.call += -V website-stylesheet
-XSLTPROC_HTML_FLAGS += --param website.stylesheet 1
-endif
-
-JADE.tex.call = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t tex -V tex-backend -i output-print -i include-index
-JADE.rtf.call = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t rtf -V rtf-backend -i output-print -i include-index
-
-JADE_html = $(JADE) $(SPFLAGS) -d stylesheet.dsl\#html -t sgml -i html -V website-stylesheet
-
-
-EXTRA_DIST = $(ALLSGML) html man1 man8 stylesheet.dsl stylesheet.css stylesheet-man.xsl stylesheet-common.xsl
-
-##
-## Man pages
-##
-
-man1 man8 distprep-man: man-stamp
-
-man-stamp: stylesheet-man.xsl pgpool.xml
- $(XMLLINT) --noout --valid pgpool.xml
- $(XSLTPROC) $(XSLTPROCFLAGS) $(XSLTPROC_MAN_FLAGS) $^
- touch $@
-
-# The draft target creates HTML output in draft mode, without index (for faster build).
-draft: pgpool.sgml $(ALMOSTALLSGML) stylesheet.dsl
- $(MKDIR_P) html
- $(JADE.html.call) -V draft-mode $<
- cp $(srcdir)/stylesheet.css html/
-
-html: html-stamp
-
-html-stamp: pgpool.sgml $(ALLSGML) stylesheet.dsl
- $(MKDIR_P) html
- $(JADE.html.call) -i include-index $<
- cp $(srcdir)/stylesheet.css html/
- cp ../figures/*.gif html
-
-# single-page HTML
-pgpool.html: pgpool.sgml $(ALLSGML) stylesheet.dsl
- $(JADE.html.call) -V nochunks -V rootchunk -V '(define %root-filename% #f)' -V '(define use-output-dir #f)' -i include-index $<
-
-# single-page text
-pgpool.txt: pgpool.html
- $(LYNX) -force_html -dump -nolist $< > $@
-
-HTML.index: pgpool.sgml $(ALMOSTALLSGML) stylesheet.dsl
- $(MKDIR_P) html
- $(JADE.html.call) -V html-index $<
-
-bookindex.sgml: HTML.index
- LC_ALL=C $(PERL) $(COLLATEINDEX) -f -g -i 'bookindex' -o $@ $<
-
-# single-page text
-#pgpool-en.txt: pgpool-en.html
-# $(LYNX) -force_html -dump -nolist $< > $@
-
-# single-page HTML
-#pgpool-en.html: pgpool-en.sgml $(ALLSGML) stylesheet.dsl
-# $(JADE.html.call) -V nochunks -V rootchunk -i include-index $< >$@
-
-%.rtf: %.sgml $(ALLSGML)
- $(JADE.rtf.call) $<
-
-%-A4.tex-ps: %.sgml $(ALLSGML)
- $(JADE.tex.call) -V texdvi-output -V '%paper-type%'=A4 -o $@ $<
-
-%-US.tex-ps: %.sgml $(ALLSGML)
- $(JADE.tex.call) -V texdvi-output -V '%paper-type%'=USletter -o $@ $<
-
-%-A4.tex-pdf: %.sgml $(ALLSGML)
- $(JADE.tex.call) -V texpdf-output -V '%paper-type%'=A4 -o $@ $<
-
-%-US.tex-pdf: %.sgml $(ALLSGML)
- $(JADE.tex.call) -V texpdf-output -V '%paper-type%'=USletter -o $@ $<
-
-
-%.pdf: %.tex-pdf
- @rm -f $*.aux $*.log $*.out
-# multiple runs are necessary to create proper intra-document links
- pdfjadetex $<
- pdfjadetex $<
- pdfjadetex $<
-
-#pgpool-en.pdf: pgpool-en-A4.tex-pdf pgpool-en-US.tex-pdf
-
-# This generates an XML version of the flow-object tree. It's useful
-# # for debugging DSSSL code, and possibly to interface to some other
-# # tools that can make use of this.
-%.fot: %.sgml $(ALLSGML)
- $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t fot -i output-print -i include-index -o $@ $<
-
-%.ps: %.dvi
- dvips -o $@ $<
-
-##
-## XSLT processing
-##
-
-pgpool-en.xml: $(ALLSGML)
- $(OSX) -D. -x lower -i include-xslt-index $< >pgpool-en.xmltmp
- $(PERL) -p -e 's/\[(aacute|acirc|aelig|agrave|amp|aring|atilde|auml|bull|copy|eacute|egrave|gt|iacute|lt|mdash|nbsp|ntilde|oacute|ocirc|oslash|ouml|pi|quot|scaron|uuml) *\]/\&\1;/gi;' \
- -e '$$_ .= qq{<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">\n} if $$. == 1;' \
- <pgpool-en.xmltmp > $@
- rm pgpool-en.xmltmp
-
-
-pgpool.xml: $(srcdir)/pgpool.sgml $(ALMOSTALLSGML)
- SP_CHARSET_FIXED=1 SP_ENCODING=UTF-8 \
- $(OSX) -D. -x lower -i include-xslt-index $< >pgpool.xmltmp
- $(PERL) -p -e 's/\[(aacute|acirc|aelig|agrave|amp|aring|atilde|auml|bull|copy|eacute|egrave|gt|iacute|lt|mdash|nbsp|ntilde|oacute|ocirc|oslash|ouml|pi|quot|scaron|uuml) *\]/\&\1;/gi;' \
- -e '$$_ .= qq{<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">\n} if $$. == 1;' \
- <pgpool.xmltmp > $@
- rm pgpool.xmltmp
-
-.PHONY: xslthtml-stamp
-
-xslthtml: xslthtml-stamp
-
-xslthtml: xslthtml-stamp
-
-xslthtml-stamp: stylesheet.xsl pgpool.xml
- $(XMLLINT) --noout --valid pgpool.xml
- $(XSLTPROC) $(XSLTPROCFLAGS) $(XSLTPROC_HTML_FLAGS) $^
- cp $(srcdir)/stylesheet.css html/
-
-htmlhelp: stylesheet-hh.xsl pgpool.xml
- $(XMLLINT) --noout --valid pgpool.xml
- $(XSLTPROC) $(XSLTPROCFLAGS) $^
-
-%-A4.fo.tmp: stylesheet-fo.xsl %.xml
- $(XMLLINT) --noout --valid $*.xml
- $(XSLTPROC) $(XSLTPROCFLAGS) --stringparam paper.type A4 -o $@ $^
-
-%-US.fo.tmp: stylesheet-fo.xsl %.xml
- $(XMLLINT) --noout --valid $*.xml
- $(XSLTPROC) $(XSLTPROCFLAGS) --stringparam paper.type USletter -o $@ $^
-
-FOP = fop
-
-#xslthtml-stamp: stylesheet.xsl pgpool-en.xml
-# $(XSLTPROC) $(XSLTPROCFLAGS) $(XSLTPROC_HTML_FLAGS) $^
-# cp $(srcdir)/stylesheet.css html/
-
-# reformat FO output so that locations of errors are easier to find
-%.fo: %.fo.tmp
- $(XMLLINT) --format --output $@ $^
-
-epub: pgpool.epub
- pgpool.epub: pgpool.xml
- $(XMLLINT) --noout --valid $<
- $(DBTOEPUB) $<
-
-version.sgml: $(top_srcdir)/configure
- { \
- echo "<!ENTITY version \"$(PACKAGE_VERSION)\">"; \
- } > $@
-
-# tabs are harmless, but it is best to avoid them in SGML files
-check-tabs:
- @( ! grep ' ' $(wildcard $(srcdir)/*.sgml $(srcdir)/ref/*.sgml $(srcdir)/*.dsl $(srcdir)/*.xsl) ) || (echo "Tabs appear in SGML/XML files" 1>&2; exit 1)
-
-CLEANFILES = *.html *.tex-pdf pgpool-en.rtf pgpool-en.txt html/* HTML.index bookindex.sgml man-stamp man1/* man3/* pgpool.xml
+++ /dev/null
-# Makefile.in generated by automake 1.13.4 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-@STYLE_ENV_SET_TRUE@am__append_1 = -V website-stylesheet
-@STYLE_ENV_SET_TRUE@am__append_2 = --param website.stylesheet 1
-subdir = doc.zh-cn/src/sgml
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/mkinstalldirs
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/docbook.m4 \
- $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
- $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
- $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/c-compiler.m4 \
- $(top_srcdir)/c-library.m4 $(top_srcdir)/general.m4 \
- $(top_srcdir)/ac_func_accept_argtypes.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/src/include/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-depcomp =
-am__depfiles_maybe =
-SOURCES =
-DIST_SOURCES =
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AR_FLAGS = @AR_FLAGS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CATALOG = @CATALOG@
-CC = @CC@
-CFLAGS = @CFLAGS@
-COLLATEINDEX = @COLLATEINDEX@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@ \
- -DDEFAULT_CONFIGDIR=\"$(sysconfdir)\"
-
-DLLTOOL = @DLLTOOL@
-DOCBOOKSTYLE = @DOCBOOKSTYLE@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-JADE = @JADE@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LEX = @LEX@
-LEXLIB = @LEXLIB@
-LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LYNX = @LYNX@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MEMCACHED_DIR = @MEMCACHED_DIR@
-MEMCACHED_INCLUDE_OPT = @MEMCACHED_INCLUDE_OPT@
-MEMCACHED_LINK_OPT = @MEMCACHED_LINK_OPT@
-MEMCACHED_RPATH_OPT = @MEMCACHED_RPATH_OPT@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-NSGMLS = @NSGMLS@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OSX = @OSX@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PERL = @PERL@
-PGCONFIG = @PGCONFIG@
-PGSQL_BIN_DIR = @PGSQL_BIN_DIR@
-PGSQL_INCLUDE_DIR = @PGSQL_INCLUDE_DIR@
-PGSQL_LIB_DIR = @PGSQL_LIB_DIR@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-STYLE = @STYLE@
-SUNIFDEF = @SUNIFDEF@
-VERSION = @VERSION@
-XMLLINT = @XMLLINT@
-XSLTPROC = @XSLTPROC@
-XSLTPROC_HTML_FLAGS = @XSLTPROC_HTML_FLAGS@ $(am__append_2)
-YACC = @YACC@
-YFLAGS = @YFLAGS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__leading_dot = @am__leading_dot@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-have_docbook = @have_docbook@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-# suggested by libtoolize
-ACLOCAL_AMFLAGS = -I m4
-GENERATED_SGML = bookindex.sgml version.sgml
-ALLSGML := $(wildcard $(srcdir)/*.sgml $(srcdir)/ref/*.sgml) $(GENERATED_SGML)
-
-# Sometimes we don't want this one.
-ALMOSTALLSGML := $(filter-out %bookindex.sgml,$(ALLSGML))
-SPFLAGS = -wall -wno-unused-param -wno-empty -wfully-tagged
-OUTDIR = html
-
-#jade -G -t sgml -i html -d stylesheet.dsl#html -o abas pgpool-en.sgm
-#JADE.html.call = $(JADE) $(JADEFLAGS) $(SPFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t sgml -i output-html
-JADE.html.call = SP_CHARSET_FIXED=1 SP_ENCODING=UTF-8 $(JADE) \
- $(JADEFLAGS) $(SPFLAGS) $(SGMLINCLUDE) $(CATALOG) -d \
- stylesheet.dsl -t sgml -i output-html $(am__append_1)
-JADE.tex.call = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t tex -V tex-backend -i output-print -i include-index
-JADE.rtf.call = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t rtf -V rtf-backend -i output-print -i include-index
-JADE_html = $(JADE) $(SPFLAGS) -d stylesheet.dsl\#html -t sgml -i html -V website-stylesheet
-EXTRA_DIST = $(ALLSGML) html man1 man8 stylesheet.dsl stylesheet.css stylesheet-man.xsl stylesheet-common.xsl
-FOP = fop
-CLEANFILES = *.html *.tex-pdf pgpool-en.rtf pgpool-en.txt html/* HTML.index bookindex.sgml man-stamp man1/* man3/* pgpool.xml
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps doc.zh-cn/src/sgml/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign --ignore-deps doc.zh-cn/src/sgml/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-tags TAGS:
-
-ctags CTAGS:
-
-cscope cscopelist:
-
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
- cscopelist-am ctags-am distclean distclean-generic \
- distclean-libtool distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags-am uninstall uninstall-am
-
-
-all: html man1 man8
-
-#if DOCBOOKSTYLE
-#CATALOG = -c $(DOCBOOKSTYLE)/catalog
-#endif
-
-#override XSLTPROCFLAGS += --stringparam pgpool.version '$(VERSION)'
-override XSLTPROCFLAGS += --stringparam pg.version '$(VERSION)'
-
-man1 man8 distprep-man: man-stamp
-
-man-stamp: stylesheet-man.xsl pgpool.xml
- $(XMLLINT) --noout --valid pgpool.xml
- $(XSLTPROC) $(XSLTPROCFLAGS) $(XSLTPROC_MAN_FLAGS) $^
- touch $@
-
-# The draft target creates HTML output in draft mode, without index (for faster build).
-draft: pgpool.sgml $(ALMOSTALLSGML) stylesheet.dsl
- $(MKDIR_P) html
- $(JADE.html.call) -V draft-mode $<
- cp $(srcdir)/stylesheet.css html/
-
-html: html-stamp
-
-html-stamp: pgpool.sgml $(ALLSGML) stylesheet.dsl
- $(MKDIR_P) html
- $(JADE.html.call) -i include-index $<
- cp $(srcdir)/stylesheet.css html/
- cp ../figures/*.gif html
-
-# single-page HTML
-pgpool.html: pgpool.sgml $(ALLSGML) stylesheet.dsl
- $(JADE.html.call) -V nochunks -V rootchunk -V '(define %root-filename% #f)' -V '(define use-output-dir #f)' -i include-index $<
-
-# single-page text
-pgpool.txt: pgpool.html
- $(LYNX) -force_html -dump -nolist $< > $@
-
-HTML.index: pgpool.sgml $(ALMOSTALLSGML) stylesheet.dsl
- $(MKDIR_P) html
- $(JADE.html.call) -V html-index $<
-
-bookindex.sgml: HTML.index
- LC_ALL=C $(PERL) $(COLLATEINDEX) -f -g -i 'bookindex' -o $@ $<
-
-# single-page text
-#pgpool-en.txt: pgpool-en.html
-# $(LYNX) -force_html -dump -nolist $< > $@
-
-# single-page HTML
-#pgpool-en.html: pgpool-en.sgml $(ALLSGML) stylesheet.dsl
-# $(JADE.html.call) -V nochunks -V rootchunk -i include-index $< >$@
-
-%.rtf: %.sgml $(ALLSGML)
- $(JADE.rtf.call) $<
-
-%-A4.tex-ps: %.sgml $(ALLSGML)
- $(JADE.tex.call) -V texdvi-output -V '%paper-type%'=A4 -o $@ $<
-
-%-US.tex-ps: %.sgml $(ALLSGML)
- $(JADE.tex.call) -V texdvi-output -V '%paper-type%'=USletter -o $@ $<
-
-%-A4.tex-pdf: %.sgml $(ALLSGML)
- $(JADE.tex.call) -V texpdf-output -V '%paper-type%'=A4 -o $@ $<
-
-%-US.tex-pdf: %.sgml $(ALLSGML)
- $(JADE.tex.call) -V texpdf-output -V '%paper-type%'=USletter -o $@ $<
-
-%.pdf: %.tex-pdf
- @rm -f $*.aux $*.log $*.out
-# multiple runs are necessary to create proper intra-document links
- pdfjadetex $<
- pdfjadetex $<
- pdfjadetex $<
-
-#pgpool-en.pdf: pgpool-en-A4.tex-pdf pgpool-en-US.tex-pdf
-
-# This generates an XML version of the flow-object tree. It's useful
-# # for debugging DSSSL code, and possibly to interface to some other
-# # tools that can make use of this.
-%.fot: %.sgml $(ALLSGML)
- $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t fot -i output-print -i include-index -o $@ $<
-
-%.ps: %.dvi
- dvips -o $@ $<
-
-pgpool-en.xml: $(ALLSGML)
- $(OSX) -D. -x lower -i include-xslt-index $< >pgpool-en.xmltmp
- $(PERL) -p -e 's/\[(aacute|acirc|aelig|agrave|amp|aring|atilde|auml|bull|copy|eacute|egrave|gt|iacute|lt|mdash|nbsp|ntilde|oacute|ocirc|oslash|ouml|pi|quot|scaron|uuml) *\]/\&\1;/gi;' \
- -e '$$_ .= qq{<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">\n} if $$. == 1;' \
- <pgpool-en.xmltmp > $@
- rm pgpool-en.xmltmp
-
-pgpool.xml: $(srcdir)/pgpool.sgml $(ALMOSTALLSGML)
- SP_CHARSET_FIXED=1 SP_ENCODING=UTF-8 \
- $(OSX) -D. -x lower -i include-xslt-index $< >pgpool.xmltmp
- $(PERL) -p -e 's/\[(aacute|acirc|aelig|agrave|amp|aring|atilde|auml|bull|copy|eacute|egrave|gt|iacute|lt|mdash|nbsp|ntilde|oacute|ocirc|oslash|ouml|pi|quot|scaron|uuml) *\]/\&\1;/gi;' \
- -e '$$_ .= qq{<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">\n} if $$. == 1;' \
- <pgpool.xmltmp > $@
- rm pgpool.xmltmp
-
-.PHONY: xslthtml-stamp
-
-xslthtml: xslthtml-stamp
-
-xslthtml: xslthtml-stamp
-
-xslthtml-stamp: stylesheet.xsl pgpool.xml
- $(XMLLINT) --noout --valid pgpool.xml
- $(XSLTPROC) $(XSLTPROCFLAGS) $(XSLTPROC_HTML_FLAGS) $^
- cp $(srcdir)/stylesheet.css html/
-
-htmlhelp: stylesheet-hh.xsl pgpool.xml
- $(XMLLINT) --noout --valid pgpool.xml
- $(XSLTPROC) $(XSLTPROCFLAGS) $^
-
-%-A4.fo.tmp: stylesheet-fo.xsl %.xml
- $(XMLLINT) --noout --valid $*.xml
- $(XSLTPROC) $(XSLTPROCFLAGS) --stringparam paper.type A4 -o $@ $^
-
-%-US.fo.tmp: stylesheet-fo.xsl %.xml
- $(XMLLINT) --noout --valid $*.xml
- $(XSLTPROC) $(XSLTPROCFLAGS) --stringparam paper.type USletter -o $@ $^
-
-#xslthtml-stamp: stylesheet.xsl pgpool-en.xml
-# $(XSLTPROC) $(XSLTPROCFLAGS) $(XSLTPROC_HTML_FLAGS) $^
-# cp $(srcdir)/stylesheet.css html/
-
-# reformat FO output so that locations of errors are easier to find
-%.fo: %.fo.tmp
- $(XMLLINT) --format --output $@ $^
-
-epub: pgpool.epub
- pgpool.epub: pgpool.xml
- $(XMLLINT) --noout --valid $<
- $(DBTOEPUB) $<
-
-version.sgml: $(top_srcdir)/configure
- { \
- echo "<!ENTITY version \"$(PACKAGE_VERSION)\">"; \
- } > $@
-
-# tabs are harmless, but it is best to avoid them in SGML files
-check-tabs:
- @( ! grep ' ' $(wildcard $(srcdir)/*.sgml $(srcdir)/ref/*.sgml $(srcdir)/*.dsl $(srcdir)/*.xsl) ) || (echo "Tabs appear in SGML/XML files" 1>&2; exit 1)
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
+++ /dev/null
-<!-- doc/src/sgml/README.links -->
-
-Linking within SGML documents can be confusing, so here is a summary:
-
-
-Intra-document Linking
-----------------------
-
-<xref>
- use to get chapter/section number from the title of the target
- link, or xreflabel if defined at the target, or refentrytitle if target
- is a refentry; has no close tag
- http://www.oasis-open.org/docbook/documentation/reference/html/xref.html
-
-<link>
- use to supply text for the link, requires </link>
- http://www.oasis-open.org/docbook/documentation/reference/html/link.html
-
-linkend=
- controls the target of the link/xref, required
-
-endterm=
- for <xref>, allows the text of the link/xref to be taken from a
- different link target title
-
-
-External Linking
-----------------
-
-<ulink>
- like <link>, but uses a URL (not a document target); requires
- </ulink>; if no text is specified, the URL appears as the link
- text
- http://www.oasis-open.org/docbook/documentation/reference/html/ulink.html
-
-url=
- used by <ulink> to specify the URL, required
-
-
-Guidelines
-----------
-
-o If you want to supply text, use <link>, else <xref>
-o Do not use text with <ulink> so the URL appears in printed output
-o Specific nouns like GUC variables, SQL commands, and contrib modules
- usually have xreflabels
+++ /dev/null
-<!-- doc/src/sgml/advanced.sgml -->
-
-<chapter id="tutorial-watchdog">
- <title>Watchdog</title>
-
- <sect1 id="tutorial-watchdog-intro">
- <title>Introduction</title>
-
- <para>
- <firstterm>Watchdog</firstterm> is a sub process of
- <productname>Pgpool-II</productname> to add high
- availability. Watchdog is used to resolve the single point of
- failure by coordinating multiple
- <productname>Pgpool-II</productname> nodes. The watchdog was first
- introduced in <productname>pgpool-II</productname>
- <emphasis>V3.2</emphasis> and is significantly enhanced in
- <productname>Pgpool-II</productname> <emphasis>V3.5</emphasis>, to
- ensure the presence of a quorum at all time. This new addition to
- watchdog makes it more fault tolerant and robust in handling and
- guarding against the split-brain syndrome and network
- partitioning. In addition, <emphasis>V3.7</emphasis> introduced
- quorum failover (see <xref
- linkend="config-watchdog-failover-behavior">) to reduce the false
- positives of <productname>PostgreSQL</productname> server
- failures. <emphasis>To ensure the quorum mechanism properly works, the number
- of <productname>Pgpool-II</productname> nodes must be odd in number
- and greater than or equal to 3.</emphasis>
- </para>
-
- <sect2 id="tutorial-watchdog-coordinating-nodes">
- <title>Coordinating multiple <productname>Pgpool-II</productname> nodes</title>
-
- <indexterm zone="tutorial-watchdog-coordinating-nodes">
- <primary>WATCHDOG</primary>
- </indexterm>
- <para>
- Watchdog coordinates multiple <productname>Pgpool-II</productname> nodes
- by exchanging information with each other.
- </para>
- <para>
- At the startup, if the watchdog is enabled, <productname>Pgpool-II</productname> node
- sync the status of all configured backend nodes from the leader watchdog node.
- And if the node goes on to become a leader node itself it initializes the backend
- status locally. When a backend node status changes by failover etc..,
- watchdog notifies the information to other <productname>Pgpool-II</productname>
- nodes and synchronizes them. When online recovery occurs, watchdog restricts
- client connections to other <productname>Pgpool-II</productname>
- nodes for avoiding inconsistency between backends.
- </para>
-
- <para>
- Watchdog also coordinates with all connected <productname>Pgpool-II</productname> nodes to ensure
- that failback, failover and follow_primary commands must be executed only on one <productname>pgpool-II</productname> node.
- </para>
-
- </sect2>
-
- <sect2 id="tutorial-watchdog-lifechecking">
- <title>Life checking of other <productname>Pgpool-II</productname> nodes</title>
-
- <indexterm zone="tutorial-watchdog-lifechecking">
- <primary>WATCHDOG</primary>
- </indexterm>
- <para>
- Watchdog lifecheck is the sub-component of watchdog to monitor
- the health of <productname>Pgpool-II</productname> nodes participating
- in the watchdog cluster to provide the high availability.
- Traditionally <productname>Pgpool-II</productname> watchdog provides
- two methods of remote node health checking. <literal>"heartbeat"</literal>
- and <literal>"query"</literal> mode.
- The watchdog in <productname>Pgpool-II</productname> <emphasis>V3.5</emphasis>
- adds a new <literal>"external"</literal> to <xref linkend="guc-wd-lifecheck-method">,
- which enables to hook an external third party health checking
- system with <productname>Pgpool-II</productname> watchdog.
- </para>
- <para>
- Apart from remote node health checking watchdog lifecheck can also check
- the health of node it is installed on by monitoring the connection to upstream servers.
- If the monitoring fails, watchdog treats it as the local <productname>Pgpool-II</productname>
- node failure.
- </para>
-
- <para>
- In <literal>heartbeat</literal> mode, watchdog monitors other <productname>Pgpool-II</productname>
- processes by using <literal>heartbeat</literal> signal.
- Watchdog receives heartbeat signals sent by other <productname>Pgpool-II</productname>
- periodically. If there is no signal for a certain period,
- watchdog regards this as the failure of the <productname>Pgpool-II</productname>.
- For redundancy you can use multiple network connections for heartbeat
- exchange between <productname>Pgpool-II</productname> nodes.
- This is the default and recommended mode to be used for health checking.
- </para>
-
- <para>
- In <literal>query</literal> mode, watchdog monitors <productname>Pgpool-II</productname>
- service rather than process. In this mode watchdog sends queries to other
- <productname>Pgpool-II</productname> and checks the response.
- <note>
- <para>
- Note that this method requires connections from other <productname>Pgpool-II</productname>,
- so it would fail monitoring if the <xref linkend="guc-num-init-children"> parameter isn't large enough.
- This mode is deprecated and left for backward compatibility.
- </para>
- </note>
- </para>
-
- <para>
- <literal>external</literal> mode is introduced by <productname>Pgpool-II</productname>
- <emphasis>V3.5</emphasis>. This mode basically disables the built in lifecheck
- of <productname>Pgpool-II</productname> watchdog and expects that the external system
- will inform the watchdog about health of local and all remote nodes participating in the watchdog cluster.
- </para>
-
- </sect2>
-
- <sect2 id="tutorial-watchdog-consistency-of-config">
- <title>Consistency of configuration parameters on all <productname>Pgpool-II</productname> nodes</title>
-
- <indexterm zone="tutorial-watchdog-consistency-of-config">
- <primary>WATCHDOG</primary>
- </indexterm>
- <para>
- At startup watchdog verifies the <productname>Pgpool-II</productname>
- configuration of the local node for the consistency with the configurations
- on the leader watchdog node and warns the user of any differences.
- This eliminates the likelihood of undesired behavior that can happen
- because of different configuration on different <productname>Pgpool-II</productname> nodes.
- </para>
- </sect2>
-
- <sect2 id="tutorial-watchdog-changing-active">
- <title>Changing active/standby state when certain fault is detected</title>
-
- <indexterm zone="tutorial-watchdog-changing-active">
- <primary>WATCHDOG</primary>
- </indexterm>
- <para>
- When a fault of <productname>Pgpool-II</productname> is detected,
- watchdog notifies the other watchdogs of it.
- If this is the active <productname>Pgpool-II</productname>,
- watchdogs decide the new active <productname>Pgpool-II</productname>
- by voting and change active/standby state.
- </para>
- </sect2>
-
- <sect2 id="tutorial-watchdog-automatic-vip">
- <title>Automatic virtual IP switching</title>
-
- <indexterm zone="tutorial-watchdog-automatic-vip">
- <primary>WATCHDOG</primary>
- </indexterm>
- <para>
- When a standby <productname>Pgpool-II</productname> server promotes to active,
- the new active server brings up virtual IP interface. Meanwhile, the previous
- active server brings down the virtual IP interface. This enables the active
- <productname>Pgpool-II</productname> to work using the same
- IP address even when servers are switched.
- </para>
- </sect2>
-
- <sect2 id="tutorial-watchdog-changing-automatic-register-in-recovery">
- <title>Automatic registration of a server as a standby in recovery</title>
-
- <indexterm zone="tutorial-watchdog-changing-automatic-register-in-recovery">
- <primary>WATCHDOG</primary>
- </indexterm>
- <para>
- When the broken server recovers or new server is attached, the watchdog process
- notifies this to the other watchdogs in the cluster along with the information of the new server,
- and the watchdog process receives information on the active server and
- other servers. Then, the attached server is registered as a standby.
- </para>
- </sect2>
-
- <sect2 id="tutorial-watchdog-start-stop">
- <title>Starting/stopping watchdog</title>
-
- <indexterm zone="tutorial-watchdog-start-stop">
- <primary>WATCHDOG</primary>
- </indexterm>
- <para>
- The watchdog process starts and stops automatically as sub-processes
- of the <productname>Pgpool-II</productname>, therefore there is no
- dedicated command to start and stop watchdog.
- </para>
- <para>
- Watchdog controls the virtual IP interface, the commands executed by
- the watchdog for bringing up and bringing down the VIP require the
- root privileges. <productname>Pgpool-II</productname> requires the
- user running <productname>Pgpool-II</productname> to have root
- privileges when the watchdog is enabled along with virtual IP.
- This is however not good security practice to run the
- <productname>Pgpool-II</productname> as root user, the alternative
- and preferred way is to run the <productname>Pgpool-II</productname>
- as normal user and use either the custom commands for
- <xref linkend="guc-if-up-cmd">, <xref linkend="guc-if-down-cmd">,
- and <xref linkend="guc-arping-cmd"> using <command>sudo</command>
- or use <command>setuid</command> ("set user ID upon execution")
- on <literal>if_*</literal> commands
- </para>
- <para>
- Lifecheck process is a sub-component of watchdog, its job is to monitor the
- health of <productname>Pgpool-II</productname> nodes participating in
- the watchdog cluster. The Lifecheck process is started automatically
- when the watchdog is configured to use the built-in life-checking,
- it starts after the watchdog main process initialization is complete.
- However lifecheck process only kicks in when all configured watchdog
- nodes join the cluster and becomes active. If some remote node fails
- before the Lifecheck become active that failure will not get caught by the lifecheck.
- </para>
- </sect2>
- </sect1>
-
- <sect1 id="tutorial-watchdog-integrating-external-lifecheck">
- <title>Integrating external lifecheck with watchdog</title>
-
- <para>
- <productname>Pgpool-II</productname> watchdog process uses the
- <acronym>BSD</acronym> sockets for communicating with
- all the <productname>Pgpool-II</productname> processes and the
- same <acronym>BSD</acronym> socket can also be used by any third
- party system to provide the lifecheck function for local and remote
- <productname>Pgpool-II</productname> watchdog nodes.
- The <acronym>BSD</acronym> socket file name for IPC is constructed
- by appending <productname>Pgpool-II</productname> wd_port after
- <literal>"s.PGPOOLWD_CMD."</literal> string and the socket file is
- placed in the <xref linkend="guc-wd-ipc-socket-dir"> directory.
- </para>
-
- <sect2 id="tutorial-watchdog-ipc-command-packet">
- <title>Watchdog IPC command packet format</title>
-
- <indexterm zone="tutorial-watchdog-ipc-command-packet">
- <primary>WATCHDOG</primary>
- </indexterm>
- <para>
- The watchdog IPC command packet consists of three fields.
- Below table details the message fields and description.
- </para>
-
- <table id="wd-ipc-command-format-table">
- <title>Watchdog IPC command packet format</title>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Field</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>TYPE</entry>
- <entry>BYTE1</entry>
- <entry>Command Type</entry>
- </row>
- <row>
- <entry>LENGTH</entry>
- <entry>INT32 in network byte order</entry>
- <entry>The length of data to follow</entry>
- </row>
- <row>
- <entry>DATA</entry>
- <entry>DATA in <acronym>JSON</acronym> format</entry>
- <entry>Command data in <acronym>JSON</acronym> format</entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
- </sect2>
-
- <sect2 id="tutorial-watchdog-ipc-result-packet">
- <title>Watchdog IPC result packet format</title>
-
- <indexterm zone="tutorial-watchdog-ipc-result-packet">
- <primary>WATCHDOG</primary>
- </indexterm>
- <para>
- The watchdog IPC command result packet consists of three fields.
- Below table details the message fields and description.
- </para>
-
- <table id="wd-ipc-result-format-table">
- <title>Watchdog IPC result packet format</title>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Field</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>TYPE</entry>
- <entry>BYTE1</entry>
- <entry>Command Type</entry>
- </row>
- <row>
- <entry>LENGTH</entry>
- <entry>INT32 in network byte order</entry>
- <entry>The length of data to follow</entry>
- </row>
- <row>
- <entry>DATA</entry>
- <entry>DATA in <acronym>JSON</acronym> format</entry>
- <entry>Command result data in <acronym>JSON</acronym> format</entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
- </sect2>
-
- <sect2 id="tutorial-watchdog-ipc-command-packet-types">
- <title>Watchdog IPC command packet types</title>
-
- <indexterm zone="tutorial-watchdog-ipc-command-packet-types">
- <primary>WATCHDOG</primary>
- </indexterm>
- <para>
- The first byte of the IPC command packet sent to watchdog process
- and the result returned by watchdog process is identified as the
- command or command result type.
- The below table lists all valid types and their meanings
- </para>
-
- <table id="wd-ipc-command-packet--types-table">
- <title>Watchdog IPC command packet types</title>
- <tgroup cols="4">
- <thead>
- <row>
- <entry>Name</entry>
- <entry>Byte Value</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>REGISTER FOR NOTIFICATIONS</entry>
- <entry>'0'</entry>
- <entry>Command packet</entry>
- <entry>Command to register the current connection to receive watchdog notifications</entry>
- </row>
- <row>
- <entry>NODE STATUS CHANGE</entry>
- <entry>'2'</entry>
- <entry>Command packet</entry>
- <entry>Command to inform watchdog about node status change of watchdog node</entry>
- </row>
- <row>
- <entry>GET NODES LIST</entry>
- <entry>'3'</entry>
- <entry>Command packet</entry>
- <entry>Command to get the list of all configured watchdog nodes</entry>
- </row>
- <row>
- <entry>NODES LIST DATA</entry>
- <entry>'4'</entry>
- <entry>Result packet</entry>
- <entry>The <acronym>JSON</acronym> data in packet contains the list of all configured watchdog nodes</entry>
- </row>
- <row>
- <entry>CLUSTER IN TRANSITION</entry>
- <entry>'7'</entry>
- <entry>Result packet</entry>
- <entry>Watchdog returns this packet type when it is not possible to process the command because the cluster is transitioning.</entry>
- </row>
- <row>
- <entry>RESULT BAD</entry>
- <entry>'8'</entry>
- <entry>Result packet</entry>
- <entry>Watchdog returns this packet type when the IPC command fails</entry>
- </row>
- <row>
- <entry>RESULT OK</entry>
- <entry>'9'</entry>
- <entry>Result packet</entry>
- <entry>Watchdog returns this packet type when IPC command succeeds</entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
- </sect2>
-
- <sect2 id="tutorial-watchdog-external-lifecheck-ipc">
- <title>External lifecheck IPC packets and data</title>
-
- <indexterm zone="tutorial-watchdog-external-lifecheck-ipc">
- <primary>WATCHDOG</primary>
- </indexterm>
- <para>
- "GET NODES LIST" ,"NODES LIST DATA" and "NODE STATUS CHANGE"
- IPC messages of watchdog can be used to integration an external
- lifecheck systems. Note that the built-in lifecheck of pgpool
- also uses the same channel and technique.
- </para>
-
- <sect3 id="tutorial-watchdog-external-lifecheck-get-nodes">
- <title>Getting list of configured watchdog nodes</title>
-
- <indexterm zone="tutorial-watchdog-external-lifecheck-get-nodes">
- <primary>WATCHDOG</primary>
- </indexterm>
- <para>
- Any third party lifecheck system can send the "GET NODES LIST"
- packet on watchdog IPC socket with a <acronym>JSON</acronym>
- data containing the authorization key and value if
- <xref linkend="guc-wd-authkey"> is set or empty packet data
- when <xref linkend="guc-wd-authkey"> is not configured to get
- the "NODES LIST DATA" result packet.
- </para>
- <para>
- The result packet returned by watchdog for the "GET NODES LIST"
- will contains the list of all configured watchdog nodes to do
- health check on in the <acronym>JSON</acronym> format.
- The <acronym>JSON</acronym> of the watchdog nodes contains the
- <literal>"WatchdogNodes"</literal> Array of all watchdog nodes.
- Each watchdog <acronym>JSON</acronym> node contains the
- <literal>"ID"</literal>, <literal>"NodeName"</literal>,
- <literal>"HostName"</literal>, <literal>"DelegateIP"</literal>,
- <literal>"WdPort"</literal> and <literal>"PgpoolPort"</literal>
- for each node.
- </para>
- <para>
- <programlisting>
- -- The example JSON data contained in "NODES LIST DATA"
-
- {
- "NodeCount":3,
- "WatchdogNodes":
- [
- {
- "ID":0,
- "State":1,
- "NodeName":"Linux_ubuntu_9999",
- "HostName":"watchdog-host1",
- "DelegateIP":"172.16.5.133",
- "WdPort":9000,
- "PgpoolPort":9999
- },
- {
- "ID":1,
- "State":1,
- "NodeName":"Linux_ubuntu_9991",
- "HostName":"watchdog-host2",
- "DelegateIP":"172.16.5.133",
- "WdPort":9000,
- "PgpoolPort":9991
- },
- {
- "ID":2,
- "State":1,
- "NodeName":"Linux_ubuntu_9992",
- "HostName":"watchdog-host3",
- "DelegateIP":"172.16.5.133",
- "WdPort":9000,
- "PgpoolPort":9992
- }
- ]
- }
-
- -- Note that ID 0 is always reserved for local watchdog node
-
- </programlisting>
- </para>
- <para>
- After getting the configured watchdog nodes information from the
- watchdog the external lifecheck system can proceed with the
- health checking of watchdog nodes, and when it detects some status
- change of any node it can inform that to watchdog using the
- "NODE STATUS CHANGE" IPC messages of watchdog.
- The data in the message should contain the <acronym>JSON</acronym>
- with the node ID of the node whose status is changed
- (The node ID must be same as returned by watchdog for that node
- in WatchdogNodes list) and the new status of node.
- </para>
- <para>
- <programlisting>
- -- The example JSON to inform pgpool-II watchdog about health check
- failed on node with ID 1 will look like
-
- {
- "NodeID":1,
- "NodeStatus":1,
- "Message":"optional message string to log by watchdog for this event"
- "IPCAuthKey":"wd_authkey configuration parameter value"
- }
-
- -- NodeStatus values meanings are as follows
- NODE STATUS DEAD = 1
- NODE STATUS ALIVE = 2
-
- </programlisting>
- </para>
- </sect3>
- </sect2>
- </sect1>
- <sect1 id="tutorial-watchdog-restrictions">
- <title>Restrictions on watchdog</title>
-
- <indexterm zone="tutorial-watchdog-restrictions">
- <primary>WATCHDOG</primary>
- </indexterm>
-
- <sect2 id="tutorial-watchdog-restrictions-query-mode">
- <title>Watchdog restriction with query mode lifecheck</title>
- <indexterm zone="tutorial-watchdog-restrictions-query-mode">
- <primary>WATCHDOG</primary>
- </indexterm>
-
- <para>
- In query mode, when all the DB nodes are detached from a
- <productname>Pgpool-II</productname> due to PostgreSQL server
- failure or pcp_detach_node issued, watchdog regards that the
- <productname>Pgpool-II</productname> service is in the down
- status and brings the virtual IP assigned to watchdog down.
- Thus clients of <productname>Pgpool-II</productname> cannot
- connect to <productname>Pgpool-II</productname> using the
- virtual IP any more. This is necessary to avoid split-brain,
- that is, situations where there are multiple active
- <productname>Pgpool-II</productname>.
- </para>
- </sect2>
-
- <sect2 id="tutorial-watchdog-restrictions-down-watchdog-mode">
- <title>Connecting to <productname>Pgpool-II</productname> whose watchdog status is down</title>
- <indexterm zone="tutorial-watchdog-restrictions-down-watchdog-mode">
- <primary>WATCHDOG</primary>
- </indexterm>
- <para>
- Don't connect to <productname>Pgpool-II</productname> in down
- status using the real IP. Because a <productname>Pgpool-II</productname>
- in down status can't receive information from other
- <productname>Pgpool-II</productname> watchdogs so it's backend status
- may be different from other the <productname>Pgpool-II</productname>.
- </para>
- </sect2>
-
- <sect2 id="tutorial-watchdog-restrictions-down-watchdog-require-restart">
- <title><productname>Pgpool-II</productname> whose watchdog status is down requires restart</title>
- <indexterm zone="tutorial-watchdog-restrictions-down-watchdog-require-restart">
- <primary>WATCHDOG</primary>
- </indexterm>
- <para>
- <productname>Pgpool-II</productname> in down status can't become active
- nor the standby <productname>Pgpool-II</productname>.
- Recovery from down status requires the restart of <productname>Pgpool-II</productname>.
- </para>
- </sect2>
-
- <sect2 id="tutorial-watchdog-restrictions-active-take-time">
- <title>Watchdog promotion to active takes few seconds</title>
- <indexterm zone="tutorial-watchdog-restrictions-active-take-time">
- <primary>WATCHDOG</primary>
- </indexterm>
- <para>
- After the active <productname>Pgpool-II</productname> stops,
- it will take a few seconds until the standby <productname>Pgpool-II</productname>
- promote to new active, to make sure that the former virtual IP is
- brought down before a down notification packet is sent to other
- <productname>Pgpool-II</productname>.
- </para>
- </sect2>
- </sect1>
-
- <sect1 id="tutorial-advanced-arch">
- <title>Architecture of the watchdog</title>
-
- <para>
- Watchdog is a sub process of <productname>Pgpool-II</productname>,
- which adds the high availability and resolves the single point of
- failure by coordinating multiple <productname>Pgpool-II</productname>.
- The watchdog process automatically starts (if enabled) when the
- <productname>Pgpool-II</productname> starts up and consists of two
- main components, Watchdog core and the lifecheck system.
- </para>
-
- <sect2 id="tutorial-advanced-arch-wd-core">
- <title>Watchdog Core</title>
- <para>
- Watchdog core referred as a "watchdog" is a
- <productname>Pgpool-II</productname> child process that
- manages all the watchdog related communications with the
- <productname>Pgpool-II</productname> nodes present in the
- cluster and also communicates with the <productname>Pgpool-II</productname>
- parent and lifecheck processes.
- </para>
- <para>
- The heart of a watchdog process is a state machine that starts
- from its initial state (<literal>WD_LOADING</literal>) and transit
- towards either standby (<literal>WD_STANDBY</literal>) or
- leader/coordinator (<literal>WD_COORDINATOR</literal>) state.
- Both standby and leader/coordinator states are stable states of the
- watchdog state machine and the node stays in standby or
- leader/coordinator state until some problem in local
- <productname>Pgpool-II</productname> node is detected or a
- remote <productname>Pgpool-II</productname> disconnects from the cluster.
- </para>
- <para>
- The watchdog process performs the following tasks:
- </para>
- <itemizedlist>
- <listitem>
- <para>
- Manages and coordinates the local node watchdog state.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Interacts with built-in or external lifecheck system
- for the of local and remote <productname>Pgpool-II</productname>
- node health checking.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Interacts with <productname>Pgpool-II</productname> main
- process and provides the mechanism to
- <productname>Pgpool-II</productname> parent process for
- executing the cluster commands over the watchdog channel.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Communicates with all the participating <productname>Pgpool-II
- </productname> nodes to coordinate the selection of
- leader/coordinator node and to ensure the quorum in the cluster.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Manages the Virtual-IP on the active/coordinator node and
- allow the users to provide custom scripts for
- escalation and de-escalation.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Verifies the consistency of <productname>Pgpool-II</productname>
- configurations across the participating <productname>Pgpool-II
- </productname> nodes in the watchdog cluster.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Synchronize the status of all PostgreSQL backends at startup.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Provides the distributed locking facility to
- <productname>Pgpool-II</productname> main process
- for synchronizing the different failover commands.
- </para>
- </listitem>
-
- </itemizedlist>
-
- <sect3 id="tutorial-advanced-arch-wd-core-comm">
- <title>Communication with other nodes in the Cluster</title>
- <para>
- Watchdog uses TCP/IP sockets for all the communication with other nodes.
- Each watchdog node can have two sockets opened with each node. One is the
- outgoing (client) socket which this node creates and initiate the
- connection to the remote node and the second socket is the one which
- is listening socket for inbound connection initiated by remote
- watchdog node. As soon as the socket connection to remote node succeeds
- watchdog sends the ADD NODE (<literal>WD_ADD_NODE_MESSAGE</literal>)
- message on that socket. And upon receiving the ADD NODE message the
- watchdog node verifies the node information encapsulated in the message
- with the Pgpool-II configurations for that node, and if the node passes
- the verification test it is added to the cluster otherwise the connection
- is dropped.
- </para>
- </sect3>
-
- <sect3 id="tutorial-advanced-arch-wd-ipc-data">
- <title>IPC and data format</title>
- <para>
- Watchdog process exposes a <acronym>UNIX</acronym> domain socket
- for IPC communications, which accepts and provides the data in
- <acronym>JSON</acronym> format. All the internal <productname>Pgpool-II
- </productname> processes, including <productname>Pgpool-II's</productname>
- built-in lifecheck and <productname>Pgpool-II</productname> main process
- uses this IPC socket interface to interact with the watchdog.
- This IPC socket can also be used by any external/3rd party system
- to interact with watchdog.
- </para>
- <para>
- See <xref linkend="tutorial-watchdog-integrating-external-lifecheck"> for details
- on how to use watchdog IPC interface for integrating external/3rd party systems.
- </para>
- </sect3>
- </sect2>
-
- <sect2 id="tutorial-advanced-arch-wd-lifecheck">
- <title>Watchdog Lifecheck</title>
- <para>
- Watchdog lifecheck is the sub-component of watchdog that monitors the health
- of <productname>Pgpool-II</productname> nodes participating in the watchdog
- cluster. <productname>Pgpool-II</productname> watchdog provides three built-in
- methods of remote node health checking, "heartbeat", "query" and "external" mode.
- </para>
- <para>
- In "heartbeat" mode, The lifecheck process sends and receives the data over
- <acronym>UDP</acronym> socket to check the availability of remote nodes and
- for each node the parent lifecheck process spawns two child process one for
- sending the heartbeat signal and another for receiving the heartbeat.
- While in "query" mode, The lifecheck process uses the PostgreSQL libpq
- interface for querying the remote <productname>Pgpool-II</productname>.
- And in this mode the lifecheck process creates a new thread for each health
- check query which gets destroyed as soon as the query finishes.
- While in "external" mode, this mode disables the built in lifecheck of
- <productname>Pgpool-II</productname>, and expects that the external system
- will monitor local and remote node instead.
- </para>
- <para>
- Apart from remote node health checking watchdog lifecheck can also check the
- health of node it is installed on by monitoring the connection to upstream servers.
- For monitoring the connectivity to the upstream server <productname>Pgpool-II
- </productname> lifecheck uses <literal>execv()</literal> function to executes
- <command>'ping -q -c3 hostname'</command> command.
- So a new child process gets spawned for executing each ping command.
- This means for each health check cycle a child process gets created and
- destroyed for each configured upstream server.
- For example, if two upstream servers are configured in the lifecheck and it is
- asked to health check at ten second intervals, then after each ten second
- lifecheck will spawn two child processes, one for each upstream server,
- and each process will live until the ping command is finished.
- </para>
- </sect2>
-
- </sect1>
-
-</chapter>
+++ /dev/null
-<!-- doc/src/sgml/biblio.sgml -->
-
- <bibliography id="biblio">
- <title>Bibliography</title>
-
- <bibliodiv>
- <title>Proceedings and Articles</title>
-
- <biblioentry id="mishima2009">
- <biblioset relation="article">
- <title><ulink
- url="http://www.vldb.org/pvldb/vol2/vldb09-694.pdf">Pangea: An
- Eager Database Replication Middleware guaranteeing Snapshot
- Isolation without modification of Database Servers</ulink></title>
- <authorgroup>
- <author>
- <firstname>Takeshi</firstname>
- <surname>Mishima</surname>
- </author>
- <author>
- <firstname>Hiroshi</firstname>
- <surname>Nakamura</surname>
- </author>
- </authorgroup>
- </biblioset>
- <confgroup>
- <conftitle>VLDB Conference</conftitle>
- <confdates>Aug. 2009</confdates>
- <address>Lyon, France</address>
- </confgroup>
- </biblioentry>
-
- </bibliodiv>
- </bibliography>
+++ /dev/null
-<!-- doc/src/sgml/client-auth.sgml -->
-
-<chapter id="client-authentication">
- <title>Client Authentication</title>
-
- <indexterm zone="client-authentication">
- <primary>client authentication</primary>
- </indexterm>
-
- <para>
- Since <productname>Pgpool-II</productname> is a middleware that works between
- <productname>PostgreSQL</productname> servers and
- a <productname>PostgreSQL</productname> database client, so when a
- client application connects to
- the <productname>Pgpool-II</productname>, <productname>Pgpool-II</productname>
- in turn connects to the <productname>PostgreSQL</productname> servers
- using the same credentials to serve the incoming client
- connection. Thus, all the access privileges and restrictions defined
- for the user in <productname>PostgreSQL</productname> gets
- automatically applied to all <productname>Pgpool-II</productname>
- clients, with an exceptions of the authentications
- on <productname>PostgreSQL</productname> side that depends on the
- client's IP addresses or host names. Reason being the connections
- to the <productname>PostgreSQL</productname> server are made
- by <productname>Pgpool-II</productname> on behalf of the connecting
- clients and <productname>PostgreSQL</productname> server can only
- see the IP address of the
- <productname>Pgpool-II</productname> server and not that of the actual client.
- Therefore, for the client host based authentications <productname>Pgpool-II</productname> has the
- <literal>pool_hba</literal> mechanism similar to the <literal>pg_hba</literal> mechanism for
- authenticating the incoming client connections.
- </para>
-
- <sect1 id="auth-pool-hba-conf">
- <title>The <filename>pool_hba.conf</filename> File</title>
-
- <indexterm zone="auth-pool-hba-conf">
- <primary>pool_hba.conf</primary>
- </indexterm>
-
- <para>
- Just like the <filename>pg_hba.conf</filename> file for <productname>PostgreSQL</productname>,
- <productname>Pgpool-II</productname> supports a similar client authentication
- function using a configuration file called <filename>pool_hba.conf</filename>.
- If <productname>Pgpool-II</productname> is installed from source code, it also includes the sample
- <filename>pool_hba.conf.sample</filename> file in the default
- configuration directory (<literal>"/usr/local/etc"</literal>).
- By default, pool_hba authentication is disabled, and
- setting <varname>enable_pool_hba</varname>
- to <literal>on</literal> enables it. see
- the <xref linkend="guc-enable-pool-hba"> configuration
- parameter.
- </para>
-
- <note>
- <para>
- If number of <productname>PostgreSQL</productname> servers is
- only one, or when running in raw mode
- (see <xref linkend="running-mode">),
- <filename>pool_hba.conf</filename> is not necessary
- thus <varname>enable_pool_hba</varname> may be being set to off.
- In this case the client authentication method is completely
- managed by <productname>PostgreSQL</productname>. Also number
- of <productname>PostgreSQL</productname> servers is more than
- one, or not running in raw
- mode, <varname>enable_pool_hba</varname> may be being set to off
- as long as the authentication method defined
- by <productname>PostgreSQL</productname>
- is <literal>trust</literal>.
- </para>
- </note>
-
- <para>
- The format of the <filename>pool_hba.conf</filename> file
- follows very
- closely <productname>PostgreSQL</productname>'s <filename>pg_hba.conf</filename>
- format.
- </para>
- <para>
- The general format of the <filename>pool_hba.conf</filename> file is
- a set of records, one per line. Blank lines are ignored, as is any
- text after the <literal>#</literal> comment character.
- Records cannot be continued across lines.
- A record is made
- up of a number of fields which are separated by spaces and/or tabs.
- Fields can contain white space if the field value is double-quoted.
- Quoting one of the keywords in a database, user, or address field (e.g.,
- <literal>all</literal> or <literal>replication</literal>) makes
- the word lose its special meaning, and just match a database, user, or
- host with that name.
- </para>
-
- <para>
- Each record specifies a connection type, a client IP address
- range (if relevant for the connection type), a database name, a
- user name, and the authentication method to be used for
- connections matching these parameters. The first record with a
- matching connection type, client address, requested database,
- and user name is used to perform authentication. There is
- no <quote>fall-through</quote> or
- <quote>backup</quote>: if one record is chosen and the authentication
- fails, subsequent records are not considered. If no record matches,
- access is denied.
- </para>
-
- <para>
- A record can have one of the following formats
- <synopsis>
- local <replaceable>database</replaceable> <replaceable>user</replaceable> <replaceable>auth-method</replaceable> <optional><replaceable>auth-options</replaceable></optional>
-
- host <replaceable>database</replaceable> <replaceable>user</replaceable> <replaceable>IP-address</replaceable> <replaceable>IP-mask</replaceable> <replaceable>auth-method</replaceable> <optional><replaceable>auth-options</replaceable></optional>
- hostssl <replaceable>database</replaceable> <replaceable>user</replaceable> <replaceable>IP-address</replaceable> <replaceable>IP-mask</replaceable> <replaceable>auth-method</replaceable> <optional><replaceable>auth-options</replaceable></optional>
- hostnossl <replaceable>database</replaceable> <replaceable>user</replaceable> <replaceable>IP-address</replaceable> <replaceable>IP-mask</replaceable> <replaceable>auth-method</replaceable> <optional><replaceable>auth-options</replaceable></optional>
-
- host <replaceable>database</replaceable> <replaceable>user</replaceable> <replaceable>address</replaceable> <replaceable>auth-method</replaceable> <optional><replaceable>auth-options</replaceable></optional>
- hostssl <replaceable>database</replaceable> <replaceable>user</replaceable> <replaceable>address</replaceable> <replaceable>auth-method</replaceable> <optional><replaceable>auth-options</replaceable></optional>
- hostnossl <replaceable>database</replaceable> <replaceable>user</replaceable> <replaceable>address</replaceable> <replaceable>auth-method</replaceable> <optional><replaceable>auth-options</replaceable></optional>
- </synopsis>
- The meaning of the fields is as follows:
-
- <variablelist>
- <varlistentry>
- <term><literal>local</literal></term>
- <listitem>
- <para>
- This record matches connection attempts using Unix-domain
- sockets. Without a record of this type, Unix-domain socket
- connections are disallowed.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><literal>host</literal></term>
- <listitem>
- <para>
- This record matches connection attempts made using TCP/IP.
- <literal>host</literal> records match either
- <acronym>SSL</acronym> or non-<acronym>SSL</acronym> connection
- attempts.
- </para>
- <note>
- <para>
- Remote TCP/IP connections will not be possible unless
- the server is started with an appropriate value for the
- <xref linkend="guc-listen-addresses"> configuration parameter,
- since the default behavior is to listen for TCP/IP connections
- only on the local loopback address <literal>localhost</literal>.
- </para>
- </note>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><literal>hostssl</literal></term>
- <listitem>
- <para>
- This record matches connection attempts made using TCP/IP, but only
- when the connection is made with <acronym>SSL</acronym> encryption.
- </para>
- <para>
- To make use of this option the <productname>Pgpool-II</productname> must be
- built with SSL support. Furthermore, SSL must be enabled by setting the <xref linkend="guc-ssl">
- configuration parameter. Otherwise, the hostssl record is ignored.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><literal>hostnossl</literal></term>
- <listitem>
- <para>
- This record type has the opposite behavior of hostssl; it only matches connection
- attempts made over TCP/IP that do not use <acronym>SSL</acronym>.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><replaceable>database</replaceable></term>
- <listitem>
- <para>
- Specifies which database name(s) this record matches. The value
- <literal>all</literal> specifies that it matches all databases.
- <note>
- <para>
- <literal>"samegroup"</literal> for database field is not supported:
- </para>
- <para>
- Since <productname>Pgpool-II</productname> does not know anything about
- users in the <productname>PostgreSQL</productname> backend server, the database name is simply
- compared against the entries in the database field of <filename>pool_hba.conf</filename>.
- </para>
- </note>
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><replaceable>user</replaceable></term>
- <listitem>
- <para>
- Specifies which database user name(s) this record
- matches. The value <literal>all</literal> specifies that it
- matches all users. Otherwise, this is the name of a specific
- database user
- <note>
- <para>
- group names following <literal>"+"</literal> for user field is not supported:
- </para>
- <para>
- This is for the same reason as for the <literal>"samegroup"</literal> of database field.
- A user name is simply checked against the entries in the user field of
- <filename>pool_hba.conf</filename>.
- </para>
- </note>
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><replaceable>address</replaceable></term>
- <listitem>
- <para>
- Specifies the client machine address(es) that this record matches.
- This field can contain either a host name, an IP address range,
- or one of the special key words mentioned below.
- </para>
-
- <para>
- An IP address range is specified using standard numeric notation for
- the range's starting address, then a slash (<literal>/</literal>)
- and a <acronym>CIDR</acronym> mask length.
- The mask length indicates the number of high-order bits of the client
- IP address that must match. Bits to the right of this should be zero
- in the given IP address. There must not be any white space between the
- IP address, the <literal>/</literal>, and the CIDR mask length.
- </para>
-
- <para>
- Typical examples of an IPv4 address range specified this way are
- <literal>172.20.143.89/32</literal> for a single host, or
- <literal>172.20.143.0/24</literal> for a small network, or
- <literal>10.6.0.0/16</literal> for a larger one.
- An IPv6 address range might look like <literal>::1/128</literal> for
- a single host (in this case the IPv6 loopback address) or
- <literal>fe80::7a31:c1ff:0000:0000/96</literal> for a small network.
- <literal>0.0.0.0/0</literal> represents all IPv4 addresses, and
- <literal>::0/0</literal> represents all IPv6 addresses. To specify a
- single host, use a mask length of 32 for IPv4 or 128 for IPv6.
- In a network address, do not omit trailing zeroes.
- </para>
-
- <para>
- An entry given in IPv4 format will match only IPv4 connections, and
- an entry given in IPv6 format will match only IPv6 connections, even
- if the represented address is in the IPv4-in-IPv6 range.
- Note that entries in IPv6 format will be rejected if the system's C
- library does not have support for IPv6 addresses.
- </para>
-
- <para>
- You can also write <literal>all</literal> to match any IP address,
- <literal>samehost</literal> to match any
- of the server's own IP addresses, or samenet to match any address in
- any <literal>subnet</literal> that the server is directly connected to.
- </para>
-
- <para>
- If a host name is specified (anything that is not an IP address range or
- a special key word is treated as a host name), that name is compared with
- the result of a reverse name resolution of the client's IP address
- (e.g., reverse DNS lookup, if DNS is used). Host name comparisons are
- case insensitive. If there is a match, then a forward name resolution
- (e.g., forward DNS lookup) is performed on the host name to check whether
- any of the addresses it resolves to are equal to the client's IP address.
- If both directions match, then the entry is considered to match.
- (The host name that is used in <filename>pool_hba.conf</filename> should be the one that
- address-to-name resolution of the client's IP address returns, otherwise
- the line won't be matched. Some host name databases allow associating an
- IP address with multiple host names, but the operating system will only
- return one host name when asked to resolve an IP address.)
- </para>
-
- <para>
- A host name specification that starts with a dot (<literal>.</literal>) matches
- a suffix of the actual host name. So <literal>.example.com</literal> would match
- <literal>foo.example.com</literal> (but not just <literal>example.com</literal>).
- </para>
-
- <para>
- When host names are specified in <filename>pool_hba.conf</filename>, you should
- make sure that name resolution is reasonably fast. It can be of advantage to
- set up a local name resolution cache such as <acronym>nscd</acronym>.
- </para>
-
- <para>
- This field only applies to host, hostssl, and hostnossl records.
- </para>
- <para>
- Specifying the host name in address field is not supported prior to
- <productname>Pgpool-II </productname><emphasis>V3.7</emphasis>.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><replaceable>IP-address</replaceable></term>
- <term><replaceable>IP-mask</replaceable></term>
- <listitem>
- <para>
- These two fields can be used as an alternative to the
- <replaceable>IP-address</replaceable><literal>/</literal>
- <replaceable>mask-length</replaceable> notation.
- Instead of specifying the mask length, the actual mask
- is specified in a separate column. For
- example, <literal>255.0.0.0</literal> represents an
- IPv4 <acronym>CIDR</acronym> mask length
- of <literal>8</literal>,
- and <literal>255.255.255.255</literal> represents a
- <acronym>CIDR</acronym> mask length of 32.
- </para>
-
- <para>
- This field only applies to host, hostssl, and hostnossl records.
- </para>
-
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><replaceable>auth-method</replaceable></term>
- <listitem>
- <para>
- Specifies the authentication method to use when a connection matches
- this record. The possible choices are summarized here; details
- are in <xref linkend="auth-methods">.
-
- <variablelist>
- <varlistentry>
- <term><literal>trust</literal></term>
- <listitem>
- <para>
- Allow the connection unconditionally. This method
- allows anyone that can connect to the
- <productname>Pgpool-II</productname>.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><literal>reject</literal></term>
- <listitem>
- <para>
- Reject the connection unconditionally. This is useful for
- <quote>filtering out</quote> certain hosts, for example a
- <literal>reject</literal> line could block a specific
- host from connecting.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><literal>md5</literal></term>
- <listitem>
- <para>
- Require the client to supply a double-MD5-hashed password for
- authentication.
-
- <note>
- <para>
- To use <literal>md5</literal>
- authentication, you need to register the
- user name and password
- in <xref linkend="guc-pool-passwd"> file.
- See <xref linkend="auth-md5"> for more
- details. If you don't want to manage
- password by
- using <filename>pool_passwd</filename>,
- you could
- use <xref linkend="guc-allow-clear-text-frontend-auth">.
- </para>
- </note>
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><literal>scram-sha-256</literal></term>
- <listitem>
- <para>
- Perform SCRAM-SHA-256 authentication to verify the user's password.
- <note>
- <para>
- To use <literal>scram-sha-256</literal>
- authentication, you need to register the
- user name and password
- in <xref linkend="guc-pool-passwd"> file.
- See <xref linkend="auth-scram"> for more
- details. If you don't want to manage
- password by
- using <filename>pool_passwd</filename>,
- you could
- use <xref linkend="guc-allow-clear-text-frontend-auth">.
- </para>
- </note>
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><literal>cert</literal></term>
- <listitem>
- <para>
- Authenticate using SSL client certificates.
- See <xref linkend="auth-cert"> for more details.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><literal>pam</literal></term>
- <listitem>
- <para>
- Authenticate using the Pluggable Authentication Modules
- (PAM) service provided by the operating system.
- See <xref linkend="auth-pam"> for details.
- </para>
- <para>
- PAM authentication is supported using user information on the host
- where <productname>Pgpool-II</productname> is running.
- To enable PAM support the <productname>Pgpool-II</productname>
- must be configured with <command>"--with-pam"</command>
- </para>
- <para>
- To enable PAM authentication, you must create a
- service-configuration file
- for <productname>Pgpool-II</productname> in the system's PAM
- configuration directory (that is usually located
- at <literal>"/etc/pam.d"</literal>). A sample
- service-configuration file is also installed
- as <literal>"share/pgpool.pam"</literal> under the install
- directory.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><literal>ldap</literal></term>
- <listitem>
- <para>
- Authenticate using LDAP server.
- See <xref linkend="auth-ldap"> for more details.
- </para>
- <para>
- To enable LDAP support the <productname>Pgpool-II</productname>
- must be configured with <command>"--with-ldap"</command>
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><replaceable>auth-options</replaceable></term>
- <listitem>
- <para>
- After the <replaceable>auth-method</replaceable> field,
- there can be field(s) of the
- form <replaceable>name</replaceable><literal>=</literal>
- <replaceable>value</replaceable>
- that specify options for the authentication method.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </para>
-
- <para>
- Since the <filename>pool_hba.conf</filename> records are examined
- sequentially for each connection attempt, the order of the records
- is significant. Typically, earlier records will have tight
- connection match parameters and weaker authentication methods, while
- later records will have looser match parameters and stronger
- authentication methods. For example, one might wish to
- use <literal>trust</literal> authentication for local TCP/IP
- connections but require a password for remote TCP/IP connections. In
- this case a record specifying
- <literal>trust</literal> authentication for connections from 127.0.0.1 would
- appear before a record specifying password authentication for a wider
- range of allowed client IP addresses.
- </para>
-
- <tip>
- <para>
- All pool_hba authentication options described in this section are
- about the authentication taking place between a client and the
- <productname>Pgpool-II</productname>. A client still has to go
- through the <productname>PostgreSQL</productname>'s authentication
- process and must have the <literal>CONNECT</literal> privilege for
- the database on the backend <productname>PostgreSQL</productname>
- server.
- </para>
- <para>
- As far as pool_hba is concerned, it does not matter if a user name
- and/or database name given by a client
- (i.e. <command>psql -U testuser testdb</command>)
- really exists in the backend. pool_hba only cares if a match in the
- <filename>pool_hba.conf</filename> can be found or not.
- </para>
- </tip>
-
- <para>
- Some examples of <filename>pool_hba.conf</filename> entries.
- See the next section for details on the different authentication methods.
- </para>
-
- <example id="example-pg-hba.conf">
- <title>Example <filename>pool_hba.conf</filename> Entries</title>
- <programlisting>
- # Allow any user on the local system to connect to any database with
- # any database user name using Unix-domain sockets (the default for local
- # connections).
- #
- # TYPE DATABASE USER ADDRESS METHOD
- local all all trust
-
- # The same using local loopback TCP/IP connections.
- #
- # TYPE DATABASE USER ADDRESS METHOD
- host all all 127.0.0.1/32 trust
-
- # Allow any user from host 192.168.12.10 to connect to database
- # "postgres" if the user's password is correctly supplied.
- #
- # TYPE DATABASE USER ADDRESS METHOD
- host postgres all 192.168.12.10/32 md5
- </programlisting>
- </example>
- </sect1>
-
- <sect1 id="auth-methods">
- <title>Authentication Methods</title>
- <para>
- The following subsections describe the authentication methods in more detail.
- </para>
-
- <sect2 id="auth-trust">
- <title>Trust Authentication</title>
-
- <para>
- When <literal>trust</literal> authentication is specified,
- <productname>Pgpool-II</productname> assumes that anyone who can
- connect to the server is authorized to access connect with
- whatever database user name they specify.
- </para>
- </sect2>
-
- <sect2 id="auth-md5">
- <title>MD5 Password Authentication</title>
-
- <indexterm>
- <primary>MD5</primary>
- </indexterm>
-
- <para>
- This authentication method is the password-based authentication
- methods in which MD-5-hashed password is sent by client.
- Since <productname>Pgpool-II</productname> does not has the
- visibility of <productname>PostgreSQL</productname>'s database
- user password and client application only sends the MD5-hash of
- the password, so <literal>md5</literal> authentication
- in <productname>Pgpool-II</productname> is supported using the
- <xref linkend="guc-pool-passwd"> authentication file.
- </para>
-
- <note>
- <para>
- If <productname>Pgpool-II</productname> is operated in raw
- mode or there's only 1 backend configured, you don't need to
- setup <xref linkend="guc-pool-passwd">.
- </para>
- </note>
-
- <sect3 id="md5-authentication-file-format">
- <title>Authentication file format</title>
- <para>
- To use the <literal>md5</literal> authentication
- <xref linkend="guc-pool-passwd"> authentication file
- must contain the user password in either plain text
- <literal>md5</literal> or <literal>AES</literal> encrypted format.
- </para>
- <para>
- The <xref linkend="guc-pool-passwd"> file should contain lines in the following format:
- <programlisting>
- "username:plain_text_passwd"
- </programlisting>
- <programlisting>
- "username:encrypted_passwd"
- </programlisting>
- </para>
- </sect3>
-
- <sect3 id="setting-md5-authentication">
- <title>Setting md5 Authentication</title>
- <indexterm zone="setting-md5-authentication">
- <primary>MD5</primary>
- </indexterm>
-
- <para>
- here are the steps to enable <literal>md5</literal>
- authentication:
- </para>
- <para>
- 1- Login as the database's operating system user and type
- <command>"pg_md5 --md5auth --username=username password"</command> user name
- and <literal>md5</literal> encrypted password are registered
- into <xref linkend="guc-pool-passwd">. If pool_passwd does not exist yet, pg_md5
- command will automatically create it for you.
- <note>
- <para>
- user name and password must be identical to those registered
- in <productname>PostgreSQL</productname> server.
- </para>
- </note>
- </para>
-
- <para>
- 2- Add an appropriate md5 entry to <filename>pool_hba.conf</filename>.
- See <xref linkend="auth-pool-hba-conf"> for more details.
- </para>
- <para>
- 3- After changing md5 password (in both pool_passwd
- and <productname>PostgreSQL</productname> of course), reload
- the pgpool configurations.
- </para>
- </sect3>
-
- </sect2>
-
- <sect2 id="auth-scram">
- <title>scram-sha-256 Authentication</title>
-
- <indexterm zone="auth-scram">
- <primary>SCRAM</primary>
- </indexterm>
-
- <para>
- This authentication method also known as SCRAM is a
- challenge-response based authentication that prevents the
- password sniffing on untrusted connections.
- Since <productname>Pgpool-II</productname> does not has the
- visibility of <productname>PostgreSQL</productname>'s database user
- password, so <literal>SCRAM</literal> authentication is supported using the
- <xref linkend="guc-pool-passwd"> authentication file.
- </para>
-
- <sect3 id="scram-authentication-file-format">
- <title>Authentication file entry for SCRAM</title>
-
- <para>
- To use the <literal>SCRAM</literal> authentication
- <xref linkend="guc-pool-passwd"> authentication file
- must contain the user password in either plain text
- or <literal>AES</literal> encrypted format.
-
- <programlisting>
- "username:plain_text_passwd"
- </programlisting>
- <programlisting>
- "username:AES_encrypted_passwd"
- </programlisting>
- <note>
- <para>
- <literal>md5</literal> type user passwords in
- <xref linkend="guc-pool-passwd"> file can't be used for
- <literal>scram</literal> authentication
- </para>
- </note>
- </para>
- </sect3>
-
- <sect3 id="setting-scram-sha-256-authentication">
- <title>Setting scram-sha-256 Authentication</title>
- <indexterm zone="setting-scram-sha-256-authentication">
- <primary>SCRAM</primary>
- </indexterm>
-
- <para>
- Here are the steps to enable <literal>scram-sha-256</literal>
- authentication:
- </para>
- <para>
- 1- Create <xref linkend="guc-pool-passwd"> file entry
- for database user and password in plain text or <literal>AES</literal>
- encrypted format.
- The <xref linkend="PG-ENC"> utility that comes with <productname>Pgpool-II</productname>
- can be used to create the <literal>AES</literal> encrypted password
- entries in the <xref linkend="guc-pool-passwd"> file.
- <note>
- <para>
- User name and password must be identical to those registered
- in the <productname>PostgreSQL</productname> server.
- </para>
- </note>
- </para>
-
- <para>
- 2- Add an appropriate scram-sha-256 entry to <filename>pool_hba.conf</filename>.
- See <xref linkend="auth-pool-hba-conf"> for more details.
- </para>
- <para>
- 3- After changing SCRAM password (in both pool_passwd
- and <productname>PostgreSQL</productname> of course), reload
- the <productname>Pgpool-II</productname> configuration.
- </para>
- </sect3>
-
- </sect2>
-
- <sect2 id="auth-cert">
- <title>Certificate Authentication</title>
-
- <indexterm zone="auth-cert">
- <primary>Certificate</primary>
- </indexterm>
-
- <para>
- This authentication method uses <literal>SSL</literal> client certificates
- to perform authentication. It is therefore only available for SSL connections.
- When using this authentication method, the <productname>Pgpool-II</productname>
- will require that the client provide a valid certificate.
- No password prompt will be sent to the client.
- The <literal>cn</literal> (Common Name) attribute of the certificate will be
- compared to the requested database user name, and if they match the login will
- be allowed.
- </para>
-
- <note>
- <para>
- The certificate authentication works between only client and
- <productname>Pgpool-II</productname>. The certificate
- authentication does not work between
- <productname>Pgpool-II</productname> and
- <productname>PostgreSQL</productname>. For backend
- authentication you can use any other authentication method.
- </para>
- </note>
-
- </sect2>
-
- <sect2 id="auth-pam">
- <title>PAM Authentication</title>
-
- <indexterm zone="auth-pam">
- <primary>PAM</primary>
- </indexterm>
-
- <para>
- This authentication method uses PAM (Pluggable
- Authentication Modules) as the authentication mechanism. The
- default PAM service name is <literal>pgpool</literal>.
- PAM authentication is supported using user information on
- the host where <productname>Pgpool-II</productname> is executed.
- For more
- information about PAM, please read the
- <ulink url="http://www.kernel.org/pub/linux/libs/pam/">
- <productname>Linux-PAM</productname> Page</ulink>.
- </para>
-
- <para>
- To enable PAM authentication, you need to create a service-configuration
- file for <productname>Pgpool-II</productname> in the system's
- PAM configuration directory (which is usually at <literal>"/etc/pam.d"</literal>).
- A sample service-configuration file is installed as
- <filename>"share/pgpool-II/pgpool.pam"</filename> under the install directory.
- </para>
-
- <note>
- <para>
- To enable PAM support the <productname>Pgpool-II</productname>
- must be configured with <command>"--with-pam"</command>
- </para>
- </note>
- </sect2>
-
- <sect2 id="auth-ldap">
- <title>LDAP Authentication</title>
-
- <indexterm zone="auth-ldap">
- <primary>LDAP</primary>
- </indexterm>
-
- <para>
- This authentication method uses LDAP as the password certification method.
- LDAP is used only to validate the user name/password pairs. Therefore the user must
- already exist in the database before LDAP can be used for authentication.
- </para>
-
- <para>
- LDAP authentication can operate in two modes. In the first mode, which we
- will call the simple bind mode, the server will bind to the distinguished
- name constructed as
- <replaceable>prefix</replaceable> <replaceable>username</replaceable> <replaceable>suffix</replaceable>.
- Typically, the <replaceable>prefix</replaceable> parameter is used to specify
- <literal>cn=</literal>, or <replaceable>DOMAIN</replaceable><literal>\</literal>
- in an Active Directory environment. <replaceable>suffix</replaceable> is used
- to specify the remaining part of the DN in a non-Active Directory environment.
- </para>
-
- <para>
- In the second mode, which we will call the search+bind mode, the server first
- binds to the LDAP directory with a fixed user name and password, specified
- with <replaceable>ldapbinddn</replaceable> and <replaceable>ldapbindpasswd</replaceable>,
- and performs a search for the user trying to log in to the database. If no
- user and password is configured, an anonymous bind will be attempted to the
- directory. The search will be performed over the subtree at
- <replaceable>ldapbasedn</replaceable>, and will try to do an exact match of
- the attribute specified in <replaceable>ldapsearchattribute</replaceable>.
- Once the user has been found in this search, the server disconnects and
- re-binds to the directory as this user, using the password specified by the
- client, to verify that the login is correct. This mode is the same as that
- used by LDAP authentication schemes in other software, such as Apache
- <literal>mod_authnz_ldap</literal> and <literal>pam_ldap</literal>. This
- method allows for significantly more flexibility in where the user objects
- are located in the directory, but will cause two separate connections to the
- LDAP server to be made.
- </para>
-
- <para>
- The following configuration options are used in both modes:
- <variablelist>
- <varlistentry>
- <term><literal>ldapserver</literal></term>
- <listitem>
- <para>
- Names or IP addresses of LDAP servers to connect to. Multiple servers
- may be specified, separated by spaces.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>ldapport</literal></term>
- <listitem>
- <para>
- Port number on LDAP server to connect to. If no port is specified, the
- LDAP library's default port setting will be used.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>ldapscheme</literal></term>
- <listitem>
- <para>
- Set to <literal>ldaps</literal> to use LDAPS. This is a non-standard
- way of using LDAP over SSL, supported by some LDAP server implementations.
- See also the <literal>ldaptls</literal> option for an alternative.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>ldaptls</literal></term>
- <listitem>
- <para>
- Set to 1 to make the connection between Pgpool-II and the LDAP server
- use TLS encryption. This uses the <literal>StartTLS</literal> operation
- per RFC 4513. See also the <literal>ldapscheme</literal> option for an alternative.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </para>
-
- <para>
- Note that using <literal>ldapscheme</literal> or
- <literal>ldaptls</literal> only encrypts the traffic between the
- Pgpool-II server and the LDAP server. The connection between the
- Pgpool-II server and the client will still be unencrypted
- unless SSL is used there as well.
- </para>
-
- <para>
- The following options are used in simple bind mode only:
- <variablelist>
- <varlistentry>
- <term><literal>ldapprefix</literal></term>
- <listitem>
- <para>
- String to prepend to the user name when forming the DN to bind as,
- when doing simple bind authentication.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>ldapsuffix</literal></term>
- <listitem>
- <para>
- String to append to the user name when forming the DN to bind as,
- when doing simple bind authentication.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </para>
-
- <para>
- The following options are used in search+bind mode only:
- <variablelist>
- <varlistentry>
- <term><literal>ldapbasedn</literal></term>
- <listitem>
- <para>
- Root DN to begin the search for the user in, when doing search+bind
- authentication.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>ldapbinddn</literal></term>
- <listitem>
- <para>
- DN of user to bind to the directory with to perform the search when
- doing search+bind authentication.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>ldapbindpasswd</literal></term>
- <listitem>
- <para>
- Password for user to bind to the directory with to perform the search
- when doing search+bind authentication.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>ldapsearchattribute</literal></term>
- <listitem>
- <para>
- Attribute to match against the user name in the search when doing
- search+bind authentication. If no attribute is specified, the
- <literal>uid</literal> attribute will be used.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>ldapsearchfilter</literal></term>
- <listitem>
- <para>
- The search filter to use when doing search+bind authentication.
- Occurrences of <literal>$username</literal> will be replaced with the
- user name. This allows for more flexible search filters than
- <literal>ldapsearchattribute</literal>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>ldapurl</literal></term>
- <listitem>
- <para>
- An RFC 4516 LDAP URL. This is an alternative way to write some of the
- other LDAP options in a more compact and standard form. The format is
-<synopsis>
-ldap[s]://<replaceable>host</replaceable>[:<replaceable>port</replaceable>]/<replaceable>basedn</replaceable>[?[<replaceable>attribute</replaceable>][?[<replaceable>scope</replaceable>][?[<replaceable>filter</replaceable>]]]]
-</synopsis>
- <replaceable>scope</replaceable> must be one of <literal>base</literal>,
- <literal>one</literal>, <literal>sub</literal>, typically the last.
- (The default is <literal>base</literal>, which is normally not useful
- in this application.) <replaceable>attribute</replaceable> can nominate
- a single attribute, in which case it is used as a value for <literal>ldapsearchattribute</literal>.
- If <replaceable>attribute</replaceable> is empty then <replaceable>filter</replaceable>
- can be used as a value for <literal>ldapsearchfilter</literal>.
- </para>
-
- <para>
- The URL scheme <literal>ldaps</literal> chooses the LDAPS method for
- making LDAP connections over SSL, equivalent to using <literal>ldapscheme=ldaps</literal>.
- To use encrypted LDAP connections using the <literal>StartTLS</literal>
- operation, use the normal URL scheme <literal>ldap</literal> and specify the
- <literal>ldaptls</literal> option in addition to <literal>ldapurl</literal>.
- </para>
-
- <para>
- For non-anonymous binds, <literal>ldapbinddn</literal> and
- <literal>ldapbindpasswd</literal> must be specified as separate options.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>backendusepasswd</literal></term>
- <listitem>
- <para>
- Set to 1 to make the password used for LDAP authentication use authentication
- between <productname>Pgpool-II</productname> and backend.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </para>
-
- <para>
- It is an error to mix configuration options for simple bind with options
- for search+bind.
- </para>
-
- <para>
- When using search+bind mode, the search can be performed using a single
- attribute specified with <literal>ldapsearchattribute</literal>, or using
- a custom search filter specified with
- <literal>ldapsearchfilter</literal>.
- Specifying <literal>ldapsearchattribute=foo</literal> is equivalent to
- specifying <literal>ldapsearchfilter="(foo=$username)"</literal>. If neither
- option is specified the default is
- <literal>ldapsearchattribute=uid</literal>.
- </para>
-
- <para>
- If <productname>Pgpool-II</productname> was compiled with
- <productname>OpenLDAP</productname> as the LDAP client library, the
- <literal>ldapserver</literal> setting may be omitted. In that case, a
- list of host names and ports is looked up via RFC 2782 DNS SRV records.
- The name <literal>_ldap._tcp.DOMAIN</literal> is looked up, where
- <literal>DOMAIN</literal> is extracted from <literal>ldapbasedn</literal>.
- </para>
-
- <para>
- Here is an example for a simple-bind LDAP configuration:
-<programlisting>
-host ... ldap ldapserver=ldap.example.net ldapprefix="cn=" ldapsuffix=", dc=example, dc=net"
-</programlisting>
- When a connection to the database server as database
- user <literal>foo</literal> is requested, Pgpool-II will attempt to
- bind to the LDAP server using the DN <literal>cn=foo, dc=example,
- dc=net</literal> and the password provided by the client. If that connection
- succeeds, the database access is granted.
- </para>
-
- <para>
- Here is an example for a search+bind configuration:
-<programlisting>
-host ... ldap ldapserver=ldap.example.net ldapbasedn="dc=example, dc=net" ldapsearchattribute=uid
-</programlisting>
- When a connection to the database server as database
- user <literal>foo</literal> is requested, Pgpool-II will attempt to
- bind anonymously (since <literal>ldapbinddn</literal> was not specified) to
- the LDAP server, perform a search for <literal>(uid=foo)</literal>
- under the specified base DN. If an entry is found, it will then attempt to
- bind using that found information and the password supplied by the client.
- If that second connection succeeds, the database access is granted.
- </para>
-
- <para>
- Here is the same search+bind configuration written as a URL:
-<programlisting>
-host ... ldap ldapurl="ldap://ldap.example.net/dc=example,dc=net?uid?sub"
-</programlisting>
- Some other software that supports authentication against LDAP uses the
- same URL format, so it will be easier to share the configuration.
- </para>
-
- <para>
- Here is an example for a search+bind configuration that uses
- <literal>ldapsearchfilter</literal> instead of
- <literal>ldapsearchattribute</literal> to allow authentication by
- user ID or email address:
-<programlisting>
-host ... ldap ldapserver=ldap.example.net ldapbasedn="dc=example, dc=net" ldapsearchfilter="(|(uid=$username)(mail=$username))"
-</programlisting>
- </para>
-
- <para>
- Here is an example for a search+bind configuration that uses DNS SRV
- discovery to find the host name(s) and port(s) for the LDAP service for the
- domain name <literal>example.net</literal>:
-<programlisting>
-host ... ldap ldapbasedn="dc=example,dc=net"
-</programlisting>
- </para>
-
- <tip>
- <para>
- Since LDAP often uses commas and spaces to separate the different
- parts of a DN, it is often necessary to use double-quoted parameter
- values when configuring LDAP options, as shown in the examples.
- </para>
- </tip>
-
- <note>
- <para>
- To enable LDAP support the <productname>Pgpool-II</productname>
- must be configured with <command>"--with-ldap"</command>
- </para>
- </note>
- </sect2>
- <sect2 id="auth-gssapi">
- <title>GSSAPI Authentication</title>
- <indexterm zone="auth-gssapi">
- <primary>GSSAPI</primary>
- </indexterm>
-
- <para>
- GSSAPI is an industry-standard protocol for secure authentication
- defined in RFC 2743. Currently
- <productname>Pgpool-II</productname> does not support GSSAPI.
- Clients should not use GSSAPI authentication, or should use
- "prefer GSSAPI authentication if possible" option (this is the
- default setting of <productname>PostgreSQL</productname> clients).
- If latter is chosen, <productname>Pgpool-II</productname> requests
- non-GSSAPI authentication to client, and the clients will fall
- back to non-GSSAPI authentication method. Thus, usually users do
- not need to worry about that <productname>Pgpool-II</productname>
- does not accept GSSAPI authentication.
- </para>
- </sect2>
- </sect1>
-
- <sect1 id="auth-different-auth-method">
- <title>Using different methods for frontend and backend authentication</title>
-
- <indexterm zone="auth-different-auth-method">
- <primary>AUTH</primary>
- </indexterm>
-
- <para>
- Since <productname>Pgpool-II</productname><emphasis>V4.0</emphasis>
- it possible to use different authentication for client application
- and backend <productname>PostgreSQL</productname> servers.
- For example, a client application can use <literal>scram-sha-256</literal>
- to connect to <productname>Pgpool-II</productname> which
- in turn can use <literal>trust</literal> or <literal>md5</literal>
- authentication to connect to <productname>PostgreSQL</productname>
- backend for the same session.
-
- </para>
- </sect1>
-
- <sect1 id="auth-aes-encrypted-password">
- <title>Using AES256 encrypted passwords in <xref linkend="guc-pool-passwd"></title>
-
- <indexterm zone="auth-aes-encrypted-password">
- <primary>AUTH</primary>
- </indexterm>
-
- <para>
- <literal>SCRAM</literal> authentication guards against the man-in-the-middle
- type of attack, so <productname>Pgpool-II</productname> requires the user password
- to authenticate with the <productname>PostgreSQL</productname> backend.
- </para>
-
- <para>
- However, storing the clear text passwords in the <filename>"pool_passwd"</filename> file
- is not a good idea.
- </para>
- <para>
- You can instead store AES256 encrypted passwords, which will be used for authentication.
- The password is first encrypted using the AES256 encryption with the user provided key
- and then the encrypted password is <literal>base64</literal> encoded and
- an <literal>AES</literal> prefix is added to the encoded string.
- <note>
- <para>
- You can use the <xref linkend="PG-ENC"> utility to create the properly
- formatted AES256 encrypted password.
- </para>
- </note>
- </para>
-
- <sect2 id="auth-create-aes-passwords">
- <title>Creating encrypted password entries</title>
- <para>
- <xref linkend="PG-ENC"> can be used to create <literal>AES</literal>
- encrypted password entries in <xref linkend="guc-pool-passwd"> file.
- <xref linkend="PG-ENC"> requires the key for encrypting the password entries.
- Later that same key will be required by <productname>Pgpool-II</productname>
- to decrypt the passwords to use for authentication.
- <note>
- <para>
- <productname>Pgpool-II</productname> must be built with SSL
- (--with-openssl) support to use the encrypted password feature.
- </para>
- </note>
- </para>
- </sect2>
-
- <sect2 id="auth-aes-decryption-key">
- <title>Providing decryption key to <productname>Pgpool-II</productname></title>
-
- <para>
- If you have <literal>AES</literal> encrypted passwords stored in the
- <xref linkend="guc-pool-passwd"> file, then <productname>Pgpool-II</productname>
- will require the decryption key to decrypt the passwords before using them,
- <productname>Pgpool-II</productname> tries to read the decryption key at
- startup from the <filename>.pgpoolkey</filename> file.
- <indexterm><primary>pgpoolkey</primary></indexterm>
- <indexterm><primary>PGPOOLKEYFILE</primary></indexterm>
- <filename>.pgpoolkey</filename> is a plain text file which
- contains the decryption key string.
- </para>
- <para>
- By default the <productname>Pgpool-II</productname> will look for the
- <filename>.pgpoolkey</filename> file in the user's home directory or the file
- referenced by environment variable <literal>PGPOOLKEYFILE</literal>.
- You can also specify the key file using the (-k, --key-file=KEY_FILE)
- command line argument to the <xref linkend="PGPOOL"> command.
- The permissions on .pgpoolkey must disallow any access to world or group.
- Change the file permissions by the command <command>chmod 0600 ~/.pgpoolkey</command>.
- </para>
- </sect2>
-
- </sect1>
-
-</chapter>
+++ /dev/null
-<!-- doc/src/sgml/config.sgml -->
-
-</chapter>
+++ /dev/null
-<!-- doc/src/sgml/config.sgml -->
-
-<chapter id="runtime-config">
- <title>Server Configuration</title>
-
- <indexterm>
- <primary>configuration</primary>
- <secondary>of the server</secondary>
- </indexterm>
-
- <para>
- There are many configuration parameters that affect the behavior of
- <productname>Pgpool-II</productname>. In the first section of this chapter we
- describe how to interact with configuration parameters. The subsequent sections
- discuss each parameter in detail.
- </para>
-
- <sect1 id="config-setting">
- <title>Setting Parameters</title>
-
- <sect2 id="config-setting-names-values">
- <title>Parameter Names and Values</title>
-
- <para>
- All parameter names are case-insensitive. Every parameter takes a
- value of one of five types: boolean, string, integer, floating point,
- or enumerated (enum). The type determines the syntax for setting the
- parameter:
- </para>
-
- <itemizedlist>
- <listitem>
- <para>
- <emphasis>Boolean:</emphasis>
- Values can be written as
- <literal>on</literal>,
- <literal>off</literal>,
- <literal>true</literal>,
- <literal>false</literal>,
- <literal>yes</literal>,
- <literal>no</literal>,
- <literal>1</literal>,
- <literal>0</literal>
- (all case-insensitive) or any unambiguous prefix of one of these.
- </para>
- </listitem>
-
- <listitem>
- <para>
- <emphasis>String:</emphasis>
- In general, enclose the value in single quotes, doubling any single
- quotes within the value. Quotes can usually be omitted if the value
- is a simple number or identifier, however.
- </para>
- </listitem>
-
- <listitem>
- <para>
- <emphasis>Numeric (integer and floating point):</emphasis>
- A decimal point is permitted only for floating-point parameters.
- Do not use thousands separators. Quotes are not required.
- </para>
- </listitem>
-
- <listitem>
- <para>
- <emphasis>Numeric with Unit:</emphasis>
- The numeric parameters that describe the quantities of
- memory or time have an implicit unit.
- The unit might be kilobytes, megabytes, milliseconds,
- seconds, or minutes.
- For example:
-
- <programlisting>
- search_primary_node_timeout = 6min
- memqcache_total_size = 64MB
- </programlisting>
- An unadorned numeric value for one of these settings will use
- the parameter's default unit.
- </para>
- <para>
- The unit name is case-sensitive, and there can be whitespace between the numeric value and the unit.
- </para>
- <para>Valid memory units are kB (kilobytes), MB (megabytes), GB (gigabytes), and TB (terabytes).</para>
- <para>Valid time units are ms (milliseconds), s (seconds), min (minutes), h (hours), and d (days).</para>
-
- </listitem>
-
- <listitem>
- <para>
- <emphasis>Enumerated:</emphasis>
- Enumerated-type parameters are written in the same way as string
- parameters, but are restricted to have one of a limited set of
- values. Enum parameter values are case-insensitive.
- </para>
- </listitem>
- </itemizedlist>
- </sect2>
-
- <sect2 id="config-setting-configuration-file">
- <title>Parameter Interaction via the Configuration File</title>
-
- <para>
- The most fundamental way to set these parameters is to edit the file
- <filename>pgpool.conf</><indexterm><primary>pgpool.conf</></>,
- which is located in <literal>$prefix/etc/pgpool.conf</literal>, if it
- installed from source code. An example of what this file might look like is:
- <programlisting>
- # This is a comment
- listen_addresses = 'localhost'
- port = 9999
- serialize_accept = off
- reset_query_list = 'ABORT; DISCARD ALL'
- </programlisting>
-
- One parameter is specified per line. The equal sign between name and
- value is optional. Whitespace is insignificant (except within a quoted
- parameter value) and blank lines are
- ignored. Hash marks (<literal>#</literal>) designate the remainder
- of the line as a comment. Parameter values that are not simple
- identifiers or numbers must be single-quoted. To embed a single
- quote in a parameter value, write either two quotes (preferred)
- or backslash-quote.
- </para>
-
- <para>
- Parameters set in this way provide default values for the cluster.
- The settings seen by active sessions will be these values unless they
- are overridden. The following sections describe ways in which the
- administrator or user can override these defaults.
- </para>
-
- <para>
- <indexterm>
- <primary>SIGHUP</primary>
- </indexterm>
- The configuration file is reread whenever the main server process
- receives a <systemitem>SIGHUP</> signal; this signal is most easily
- sent by running <literal>pgpool reload</> from the command line. The main
- pgpool process also propagates this signal to all its child
- processes, so that next sessions also adopt the new values.
- Some parameters can only be set at server start; any changes to their
- entries in the configuration file will be ignored until the server is restarted.
- Invalid parameter settings in the configuration file are likewise
- ignored (but logged) during <systemitem>SIGHUP</> processing.
- </para>
- </sect2>
-
- <sect2 id="config-setting-sql-command-interaction">
- <title>Parameter Interaction via SQL Clients</title>
-
- <para>
- <productname>Pgpool-II</productname> also provides two SQL style
- commands to interact with session-local configuration settings.
- </para>
-
- <itemizedlist>
- <listitem>
- <para>
- The <xref linkend="SQL-PGPOOL-SHOW"> command allows inspection of the
- current value of all parameters.
- </para>
- </listitem>
-
- <listitem>
- <para>
- The <xref linkend="SQL-PGPOOL-SET"> command allows modification of the
- current value of those parameters that can be set locally to a
- session; it has no effect on other sessions.
- </para>
- </listitem>
- </itemizedlist>
-
- </sect2>
- </sect1>
-
+++ /dev/null
-<!-- doc/src/sgml/config.sgml -->
-
-<sect1 id="runtime-config-connection-pooling">
- <title>Connection Pooling</title>
-
- <para>
- <productname>Pgpool-II</productname> maintains established
- connections to the PostgreSQL servers, and reuses them whenever a
- new connection with the same properties (i.e. user name, database,
- protocol version) comes in. It reduces the connection overhead,
- and improves system's overall throughput.
- </para>
-
- <sect2 id="runtime-config-connection-pooling-settings">
- <title>Connection Pooling Settings</title>
-
- <variablelist>
-
- <varlistentry id="guc-connection-cache" xreflabel="connection_cache">
- <term><varname>connection_cache</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>connection_cache</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Caches connections to backends when set to on. Default is on.
- <emphasis>However, connections to <literal>template0</>, <literal>template1</>,
- <literal>postgres</> and <literal>regression</> databases are not cached even if
- <varname>connection_cache</> is on.</emphasis>
- </para>
- <para>
- You need to restart <productname>Pgpool-II</productname>
- if you change this value.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-max-pool" xreflabel="max_pool">
- <term><varname>max_pool</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>max_pool</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- The maximum number of cached connections
- in each <productname>Pgpool-II</productname> child
- process. <productname>Pgpool-II</productname> reuses the
- cached connection if an incoming connection is connecting
- to the same database with the same user name and the same
- run-time parameters. If not,
- <productname>Pgpool-II</productname> creates a new
- connection to the backend. If the number of cached
- connections exceeds max_pool, the oldest connection will
- be discarded, and uses that slot for the new connection.
- </para>
- <para>
- Default value is 4. Please be aware that the number of
- connections from <productname>Pgpool-II</productname> processes to the backends may reach
- num_init_children * max_pool in total.
- </para>
- <para>
- This parameter can only be set at server start.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-listen-backlog-multiplier" xreflabel="listen_backlog_multiplier">
- <term><varname>listen_backlog_multiplier</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>listen_backlog_multiplier</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the length of connection queue from frontend to
- <productname>Pgpool-II</productname>. The queue length (actually
- <literal>"backlog"</literal> parameter of <literal>listen()</literal>
- system call) is defined as
- <varname>listen_backlog_multiplier</varname> * <xref linkend="guc-num-init-children">.
- </para>
- <note>
- <para>
- Some systems have the upper limit of the backlog parameter of
- <literal>listen()</literal> system call.
- See <xref linkend="guc-num-init-children"> for more details.
- </para>
- </note>
- <para>
- Default is 2.
- </para>
- <para>
- This parameter can only be set at server start.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-serialize-accept" xreflabel="serialize_accept">
- <term><varname>serialize_accept</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>serialize_accept</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- When set to on, <productname>Pgpool-II</productname> enables the serialization
- on incoming client connections.
- Without serialization the OS kernel wakes up all of the <productname>
- Pgpool-II</productname> children processes to execute <literal>accept()</> and one of them
- actually gets the incoming connection. The problem here is, because so my child
- process wake up at a same time, heavy context switching occurs and the
- performance is affected.
- </para>
- <para>
- This phenomena is a well known classic problem called
- "the thundering herd problem". This can be solved by the
- serialization of the <literal>accept()</> calls, so that only one
- <productname>Pgpool-II</productname> process gets woken up
- for incoming connection to execute the <literal>accept()
- </literal>.
- </para>
-
- <para>
- But serialization has its own overheads, and it is recommended
- to be used only with the larger values of <xref linkend="guc-num-init-children">.
- For the small number of <xref linkend="guc-num-init-children">,
- the serialize accept can degrade the performance because of
- serializing overhead.
- </para>
-
- <note>
- <para>
- It is recommended to do a benchmark before deciding whether to use
- <varname>serialize_accept</varname> or not, because the correlation
- of <xref linkend="guc-num-init-children"> and <varname>serialize_accept</varname>
- can be different on different environments.
- </para>
- </note>
-
- <example id="example-serialize-accept-pgbench">
- <title>Using pgbench to decide if serialize_accept should be used</title>
- <para>
- To run the <command>pgbench</command> use the following
- command.
- <programlisting>
- pgbench -n -S -p 9999 -c 32 -C -S -T 300 test
- </programlisting>
- Here, <literal>-C</literal> tells <command>pgbench</command> to connect
- to database each time a transaction gets executed. <literal>-c 32</literal>
- specifies the number of the concurrent sessions to <productname>Pgpool-II</productname>.
- You should change this according to your system's requirement.
- After <command>pgbench</command> finishes, check the number from
- "including connections establishing".
- </para>
- </example>
-
- <note>
- <para>
- When <xref linkend="guc-child-life-time"> is enabled, <varname>serialize_accept</varname>
- has no effect. Make sure that you set <xref linkend="guc-child-life-time"> to 0 if you intend
- to turn on the <varname>serialize_accept</varname>.
- And if you are worried about <productname>Pgpool-II</productname> process memory leaks
- or whatever potential issue, you could use <xref linkend="guc-child-max-connections"> instead.
- This is purely an implementation limitation and may be removed in the future.
- </para>
- </note>
-
- <para>
- Default is off.
- </para>
- <para>
- This parameter can only be set at server start.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-child-life-time" xreflabel="child_life_time">
- <term><varname>child_life_time</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>child_life_time</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the time in seconds to terminate a <productname>Pgpool-II
- </productname> child process if it remains idle. The new child process
- is immediately spawned by <productname>Pgpool-II</productname> when it
- is terminated because of <varname>child_life_time</varname>.
- <varname>child_life_time</varname> is a measure to prevent the
- memory leaks and other unexpected errors in <productname>Pgpool-II
- </productname> children.
- </para>
- <note>
- <para>
- <varname>child_life_time</varname> does not apply to
- processes that have not accepted any connection yet.
- </para>
- </note>
- <note>
- <para>
- <xref linkend="guc-serialize-accept"> becomes ineffective when
- <varname>child_life_time</varname> is enabled.
- </para>
- </note>
- <para>
- Default is 300 (5 minutes) and setting it to 0 disables the feature.
- </para>
- <para>
- This parameter can only be set at server start.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-client-idle-limit" xreflabel="client_idle_limit">
- <term><varname>client_idle_limit</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>client_idle_limit</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the time in seconds to disconnect a client if it remains idle
- since the last query.
- This is useful for preventing the <productname>Pgpool-II</productname>
- children from being occupied by a lazy clients or broken TCP/IP
- connection between client and <productname>Pgpool-II</productname>.
- </para>
- <note>
- <para>
- <varname>client_idle_limit</varname> is ignored in
- the second stage of online recovery.
- </para>
- </note>
- <para>
- The default is 0, which turns off the feature.
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- You can also use <xref linkend="SQL-PGPOOL-SET"> command to alter the value of
- this parameter for a current session.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-child-max-connections" xreflabel="child_max_connections">
- <term><varname>child_max_connections</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>child_max_connections</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the lifetime of a <productname>Pgpool-II</productname>
- child process in terms of the number of client connections it can receive.
- <productname>Pgpool-II</productname> will terminate the child process
- after it has served <varname>child_max_connections</varname> client
- connections and will immediately spawn a new child process to take its place.
- </para>
- <para>
- <varname>child_max_connections</varname> is useful on a very busy server,
- where <xref linkend="guc-child-life-time"> and <xref linkend="guc-connection-life-time">
- never gets triggered. It is also useful to prevent the <productname>PostgreSQL</> servers from getting
- too big.
- </para>
- <para>
- The default is 0, which turns off the feature.
- </para>
- <para>
- This parameter can only be set at server start.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-connection-life-time" xreflabel="connection_life_time">
- <term><varname>connection_life_time</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>connection_life_time</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the time in seconds to terminate the cached connections
- to the PostgreSQL backend. This serves as the cached connection expiration time.
- </para>
- <para>
- The default is 0, which means the cached connections will not be disconnected.
- </para>
- <para>
- This parameter can only be set at server start.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-reset-query-list" xreflabel="reset_query_list">
- <term><varname>reset_query_list</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>reset_query_list</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the <acronym>SQL</acronym> commands to be sent to reset the backend connection
- when exiting the user session. Multiple commands can be specified by delimiting each
- by <literal>";"</literal>.
- </para>
-
- <para>
- The available commands differ among <productname>PostgreSQL</> versions.
- Below are some recommended settings for <varname>reset_query_list</varname>
- on different <productname>PostgreSQL</> versions.
- Note, however, that <literal>ABORT</literal> command should be always included.
- </para>
-
- <table id="reset-query-list-suggestions-table">
- <title>Recommended setting for <varname>reset_query_list</varname>
- on different PostgreSQL versions</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>PostgreSQL version</entry>
- <entry>reset_query_list</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>7.1 or earlier</entry>
- <entry><literal>'ABORT'</literal></entry>
- </row>
-
- <row>
- <entry>7.2 to 8.2</entry>
- <entry><literal>'ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT'</literal></entry>
- </row>
-
- <row>
- <entry>8.3 or later</entry>
- <entry><literal>'ABORT; DISCARD ALL'</literal></entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
-
- <note>
- <para>
- <literal>"ABORT"</literal> is not issued when not in a transaction block for 7.4 or later
- <productname>PostgreSQL</> versions.
- </para>
- </note>
- <para>
- Default is <literal>'ABORT; DISCARD ALL'</literal>.
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </sect2>
-</sect1>
-
-<sect1 id="runtime-config-logging">
- <title>Error Reporting and Logging</title>
-
- <sect2 id="runtime-config-logging-where-to-log">
- <title>Where To Log</title>
-
- <variablelist>
-
- <varlistentry id="guc-log-destination" xreflabel="log_destination">
- <term><varname>log_destination</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>log_destination</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- <productname>Pgpool-II</productname> supports two destinations
- for logging the <productname>Pgpool-II</productname> messages.
- The supported log destinations are <literal>stderr</literal>
- and <literal>syslog</literal>. You can also set this parameter to a list
- of desired log destinations separated by commas if you want the log messages
- on the multiple destinations.
- <programlisting>
- #for example to log on both syslog and stderr
- log_destination = 'syslog,stderr'
- </programlisting>
- The default is to log to <literal>stderr</literal> only.
- </para>
- <note>
- <para>
- On some systems you will need to alter the configuration of your
- system's <application>syslog</application> daemon in order to make use of the
- <literal>syslog</literal> option
- for <varname>log_destination</varname>. <productname>Pgpool-II</productname>
- can log to <application>syslog</application> facilities LOCAL0 through LOCAL7
- (see <xref linkend="guc-syslog-facility">), but the default
- <application>syslog</application>
- configuration on most platforms will discard all such messages.
- You will need to add something like:
- <programlisting>
- local0.* /var/log/pgpool.log
- </programlisting>
- to the syslog daemon's configuration file to make it work.
- </para>
- </note>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-logging-collector" xreflabel="logging_collector">
- <term><varname>logging_collector</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>logging_collector</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- This parameter enables the logging collector, which is a background process that captures
- log messages sent to stderr and redirects them into log files.
- </para>
- <note>
- <para>
- It is possible to log to stderr without using the logging collector; the log messages will
- just go to wherever the server's stderr is directed. However, that method is only suitable
- for low log volumes, since it provides no convenient way to rotate log files.
- </para>
- </note>
- <para>
- This parameter can only be set at the Pgpool-II start.
- </para>
- <para>
- <varname>logging_collector</varname> is not available prior to
- <productname>Pgpool-II </productname><emphasis>V4.2</emphasis>.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-log-directory" xreflabel="log_directory">
- <term><varname>log_directory</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>log_directory</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- When <xref linkend="guc-logging-collector"> is enabled, this parameter determines
- the directory in which log files will be created.
- </para>
- <para>The default is <literal>/tmp/pgpool_logs</literal>.</para>
- <para>
- This parameter can only be set at the Pgpool-II start.
- </para>
-
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-log-filename" xreflabel="log_filename">
- <term><varname>log_filename</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>log_filename</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- When <xref linkend="guc-logging-collector"> is enabled, this parameter sets the
- file names of the created log files. The value is treated as a
- <literal>strftime</literal> pattern, so %-escapes can be used to specify time-varying
- file names.
- The supported %-escapes are similar to those listed in the Open Group's
- <ulink url="https://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html">strftime</ulink>specification.
- </para>
- <para>
- If you specify a file name without escapes, you should plan to use a log rotation
- utility to avoid eventually filling the entire disk.
- </para>
- <para>
- The default is <literal>pgpool-%Y-%m-%d_%H%M%S.log</literal>.
- </para>
- <para>
- This parameter can only be set at the Pgpool-II start.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-log-file-mode" xreflabel="log_file_mode">
- <term><varname>log_file_mode</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>log_file_mode</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- This parameter sets the permissions for log files when <xref linkend="guc-logging-collector">
- is enabled. The parameter value is expected to be a numeric mode specified in the format
- accepted by the <literal>chmod</literal> and <literal>umask</literal> system calls.
- </para>
-
- <note>
- <para>
- To use the customary octal format the number must start with a 0 (zero).
- </para>
- </note>
-
- <para>
- This parameter can only be set at the Pgpool-II start.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-log-rotation-age" xreflabel="log_rotation_age">
- <term><varname>log_rotation_age</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>log_rotation_age</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- When <xref linkend="guc-logging-collector"> is enabled, this parameter determines
- the maximum amount of time to use an individual log file, after which a new log
- file will be created. If this value is specified without units,
- it is taken as minutes. The default is 24 hours.
- </para>
- <para>
- Set to zero to disable size-based creation of new log files.
- </para>
- <para>
- This parameter can only be set at the Pgpool-II start.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-log-rotation-size" xreflabel="log_rotation_size">
- <term><varname>log_rotation_size</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>log_rotation_size</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- When <xref linkend="guc-logging-collector"> is enabled, this parameter determines
- the maximum size of an individual log file. After this many kilobytes have been
- emitted into a log file, a new log file will be created.
- </para>
- <para>
- Set to zero to disable size-based creation of new log files.
- </para>
- <para>
- This parameter can only be set at the Pgpool-II start.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-log-truncate-on-rotation" xreflabel="log_truncate_on_rotation">
- <term><varname>log_truncate_on_rotation</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>log_truncate_on_rotation</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- When <xref linkend="guc-logging-collector"> is enabled,
- this parameter will cause <productname>Pgpool-II</> to truncate (overwrite),
- rather than append to, any existing log file of the same name.
- However, truncation will occur only when a new file is being opened due to
- time-based rotation, not during the startup or size-based rotation.
- When off, pre-existing files will be appended to in all cases.
- For example, using this setting in combination with a <xref linkend="guc-log-filename">
- like pgpool-%H.log would result in generating twenty-four hourly log
- files and then cyclically overwriting them.
- </para>
- <para>
- This parameter can only be set at the Pgpool-II start.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-syslog-facility" xreflabel="syslog_facility">
- <term><varname>syslog_facility</varname> (<type>enum</type>)
- <indexterm>
- <primary><varname>syslog_facility</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- See also the documentation of your system's syslog daemon.
- When logging to <application>syslog</application> is enabled,
- this parameter determines the <application>syslog</application>
- <literal>"facility"</literal> to be used.
- You can choose from <literal>LOCAL0</>, <literal>LOCAL1</>,
- <literal>LOCAL2</>, <literal>LOCAL3</>, <literal>LOCAL4</>,
- <literal>LOCAL5</>, <literal>LOCAL6</>, <literal>LOCAL7</>;
- the default is <literal>LOCAL0</>.
- See also the documentation of your system's <application>syslog</> daemon.
- </para>
-
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-syslog-ident" xreflabel="syslog_ident">
- <term><varname>syslog_ident</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>syslog_ident</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- When logging to <application>syslog</> is enabled, this parameter determines
- the program name used to identify <productname>Pgpool-II</productname>
- messages in <application>syslog</> logs. The default is <literal>pgpool</literal>.
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </sect2>
-
- <sect2 id="runtime-config-logging-when-to-log">
- <title>When To Log</title>
-
- <variablelist>
-
- <varlistentry id="guc-client-min-messages" xreflabel="client_min_messages">
- <term><varname>client_min_messages</varname> (<type>enum</type>)
- <indexterm>
- <primary><varname>client_min_messages</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Controls which minimum message levels are sent to the client.
- Valid values are <literal>DEBUG5</>, <literal>DEBUG4</>,
- <literal>DEBUG3</>, <literal>DEBUG2</>, <literal>DEBUG1</>,
- <literal>LOG</>, <literal>NOTICE</>, <literal>WARNING</> and
- <literal>ERROR</>. Each level includes
- all the levels that follow it. The default is <literal>NOTICE</>.
- </para>
-
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- You can also use <xref linkend="SQL-PGPOOL-SET"> command to alter the value of
- this parameter for a current session.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-log-min-messages" xreflabel="log_min_messages">
- <term><varname>log_min_messages</varname> (<type>enum</type>)
- <indexterm>
- <primary><varname>log_min_messages</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- The default is WARNING.
- Controls which minimum message levels are emitted to log.
- Valid values are <literal>DEBUG5</>, <literal>DEBUG4</>,
- <literal>DEBUG3</>, <literal>DEBUG2</>, <literal>DEBUG1</>,
- <literal>INFO</>, <literal>NOTICE</>, <literal>WARNING</>,
- <literal>ERROR</>, <literal>LOG</>, <literal>FATAL</>,
- and <literal>PANIC</>.
- Each level includes all the levels that follow it.
- The default is <literal>WARNING</>.
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- You can also use <xref linkend="SQL-PGPOOL-SET"> command to alter the value of
- this parameter for a current session.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </sect2>
-
- <sect2 id="runtime-config-logging-what-to-log">
- <title>What To Log</title>
-
- <variablelist>
-
- <varlistentry id="guc-log-statement" xreflabel="log_statement">
- <term><varname>log_statement</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>log_statement</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Setting to on, prints all SQL statements to the log.
- </para>
-
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- You can also use <xref linkend="SQL-PGPOOL-SET"> command to alter the value of
- this parameter for a current session.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-log-per-node-statement" xreflabel="log_per_node_statement">
- <term><varname>log_per_node_statement</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>log_per_node_statement</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Similar to <xref linkend="guc-log-statement">, except that it print the
- logs for each DB node separately. It can be useful to make sure that
- replication or load-balancing is working.
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- You can also use <xref linkend="SQL-PGPOOL-SET"> command to alter the value of
- this parameter for a current session.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-log-client-messages" xreflabel="log_client_messages">
- <term><varname>log_client_messages</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>log_client_messages</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Setting to on, prints client messages to the log.
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- You can also use <xref linkend="SQL-PGPOOL-SET"> command to alter the value of
- this parameter for a current session.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-log-hostname" xreflabel="log_hostname">
- <term><varname>log_hostname</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>log_hostname</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Setting to on, prints the hostname instead of IP address
- in the <command>ps</> command result, and connection logs
- (when <xref linkend="guc-log-connections"> is on).
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-log-connections" xreflabel="log_connections">
- <term><varname>log_connections</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>log_connections</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Setting to on, prints all client connections from to the log.
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-log-disconnections" xreflabel="log_disconnections">
- <term><varname>log_disconnections</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>log_disconnections</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Setting to on, prints all client connection terminations to the log.
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-log-error-verbosity" xreflabel="log_error_verbosity">
- <term><varname>log_error_verbosity</varname> (<type>enum</type>)
- <indexterm>
- <primary><varname>log_error_verbosity</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Controls the amount of detail emitted for each message that is logged.
- Valid values are <literal>TERSE</>, <literal>DEFAULT</>, and <literal>VERBOSE</>,
- each adding more fields
- to displayed messages. <literal>TERSE</> excludes the logging of <literal>DETAIL</>,
- <literal>HINT</>,
- and <literal>CONTEXT</> error information.
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- You can also use <xref linkend="SQL-PGPOOL-SET"> command to alter the value of
- this parameter for a current session.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-log-line-prefix" xreflabel="log_line_prefix">
- <term><varname>log_line_prefix</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>log_line_prefix</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- This is a <function>printf</>-style string that is output at the beginning of
- each log line.
- <literal>%</literal> characters begin <quote>escape sequences</> that are replaced
- with information outlined below.
- All unrecognized escapes are ignored. Other characters are copied straight to
- the log line. Default is '%t: pid %p: ', which prints timestamp and process id,
- which keeps backward compatibility with pre<productname>Pgpool-II</productname>
- <emphasis>V3.4</emphasis>.
- </para>
-
- <table id="log-line-prefix-table">
- <title>log_line_prefix escape options</title>
-
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Escape</entry>
- <entry>Effect</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>%a</entry>
- <entry>
- Application name. The initial value for child (session
- process) is "child". If Clients set application name
- (either in the startup message or by using SET command),
- application name will be changed accordingly. In other types
- of process, application name is a hard coded string. see
- <xref linkend="application-name-table">.
- </entry>
- </row>
-
- <row>
- <entry>%p</entry>
- <entry>Process ID (PID)</entry>
- </row>
-
- <row>
- <entry>%P</entry>
- <entry>Process name</entry>
- </row>
-
- <row>
- <entry>%t</entry>
- <entry>Time stamp</entry>
- </row>
-
- <row>
- <entry>%d</entry>
- <entry>Database name</entry>
- </row>
-
- <row>
- <entry>%u</entry>
- <entry>User name</entry>
- </row>
-
- <row>
- <entry>%l</entry>
- <entry>Log line number for each process</entry>
- </row>
-
- <row>
- <entry>%%</entry>
- <entry>'%' character</entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
-
- <table id="application-name-table">
- <title>application names in various process</title>
-
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Process type</entry>
- <entry>application name</entry>
- </row>
- </thead>
-
- <tbody>
-
- <row>
- <entry>main</entry>
- <entry>main</entry>
- </row>
-
- <row>
- <entry>child</entry>
- <entry>child</entry>
- </row>
-
- <row>
- <entry>streaming replication delay check worker</entry>
- <entry>sr_check_worker</entry>
- </row>
-
- <row>
- <entry>watchdog heart beat sender</entry>
- <entry>heart_beat_sender</entry>
- </row>
-
- <row>
- <entry>watchdog heart beat receiver</entry>
- <entry>heart_beat_receiver</entry>
- </row>
-
- <row>
- <entry>watchdog</entry>
- <entry>watchdog</entry>
- </row>
-
- <row>
- <entry>watchdog life check</entry>
- <entry>life_check</entry>
- </row>
-
- <row>
- <entry>follow primary child</entry>
- <entry>follow_child</entry>
- </row>
-
- <row>
- <entry>watchdog utility</entry>
- <entry>watchdog_utility</entry>
- </row>
-
- <row>
- <entry>pcp main</entry>
- <entry>pcp_main</entry>
- </row>
-
- <row>
- <entry>pcp child</entry>
- <entry>pcp_child</entry>
- </row>
-
- <row>
- <entry>health check process</entry>
- <entry>health_check%d (%d is replaced with backend node id)</entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
-
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </sect2>
-</sect1>
+++ /dev/null
-<!-- doc/src/sgml/config.sgml -->
-
-<sect1 id="runtime-config-connection">
- <title>Connections and Authentication</title>
-
- <sect2 id="runtime-config-connection-settings">
- <title>Connection Settings</title>
-
- <variablelist>
-
- <varlistentry id="guc-listen-addresses" xreflabel="listen_addresses">
- <term><varname>listen_addresses</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>listen_addresses</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the hostname or IP address, on
- which <productname>Pgpool-II</productname> will accept
- TCP/IP connections. <literal>'*'</literal> accepts all
- incoming connections. <literal>''</literal> disables
- TCP/IP connections. Default
- is <literal>'localhost'</literal>. Connections via UNIX
- domain socket are always accepted.
- </para>
- <para>
- This parameter can only be set at server start.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-port" xreflabel="port">
- <term><varname>port</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>port</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- The port number used
- by <productname>Pgpool-II</productname> to listen for
- connections. Default is 9999.
- </para>
- <para>
- This parameter can only be set at server start.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-socket-dir" xreflabel="socket_dir">
- <term><varname>socket_dir</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>socket_dir</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- The directory where the UNIX domain socket accepting connections for
- <productname>Pgpool-II</productname> will be
- created. Default is <literal>/tmp</literal>. Be aware that
- this socket might be deleted by a cron job. We recommend
- to set this value to <literal>/var/run</literal> or such
- directory.
- </para>
- <para>
- This parameter can only be set at server start.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-pcp-listen-addresses" xreflabel="pcp_listen_addresses">
- <term><varname>pcp_listen_addresses</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>pcp_listen_addresses</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the hostname or IP address, on which pcp process
- will accept TCP/IP connections. <literal>*</literal>
- accepts all incoming connections. <literal>"" </literal>
- disables TCP/IP connections. Default
- is <literal>*</literal>. Connections via UNIX domain
- socket are always accepted.
- </para>
- <para>
- This parameter can only be set at server start.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-pcp-port" xreflabel="pcp_port">
- <term><varname>pcp_port</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>pcp_port</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- The port number used by PCP
- process to listen for connections. Default is 9898.
- </para>
- <para>
- This parameter can only be set at server start.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-pcp-socket-dir" xreflabel="pcp_socket_dir">
- <term><varname>pcp_socket_dir</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>pcp_socket_dir</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- The directory where the UNIX domain socket accepting
- connections for PCP process will be created. Default
- is <literal>/tmp</literal>. Be aware that this socket
- might be deleted by a cron job. We recommend to set this
- value to <literal>/var/run</literal> or such directory.
- </para>
- <para>
- This parameter can only be set at server start.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-num-init-children" xreflabel="num_init_children">
- <term><varname>num_init_children</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>num_init_children</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- The number of
- preforked <productname>Pgpool-II</productname> server
- processes. Default is 32. num_init_children is also the
- concurrent connections limit
- to <productname>Pgpool-II</productname> from clients. If
- more than num_init_children clients try to connect to
- <productname>Pgpool-II</productname>, <emphasis>they are
- blocked (not rejected with an error,
- like <productname>PostgreSQL</productname>) until a
- connection to any <productname>Pgpool-II</productname>
- process is closed</emphasis>
- unless <xref linkend="guc-reserved-connections"> is set
- to 1 or more. Up to
- <xref linkend="guc-listen-backlog-multiplier">*
- num_init_children can be queued.
- </para>
- <para>
- The queue is inside the kernel called "listen queue". The
- length of the listen queue is called "backlog". There is
- an upper limit of the backlog in some systems, and if
- num_init_children*<xref linkend="guc-listen-backlog-multiplier">
- exceeds the number, you need to set the backlog higher.
- Otherwise, following problems may occur in heavy loaded systems:
- <itemizedlist>
- <listitem>
- <para>
- connecting to <productname>Pgpool-II</productname> fails
- </para>
- </listitem>
- <listitem>
- <para>
- connecting to <productname>Pgpool-II</productname> is
- getting slow because of retries in the kernel.
- </para>
- </listitem>
- </itemizedlist>
- You can check if the listen queue is actually overflowed by using
- "netstat -s" command. If you find something like:
- <programlisting>
- 535 times the listen queue of a socket overflowed
- </programlisting>
- then the listen queue is definitely overflowed. You
- should increase the backlog in this case (you will be
- required a super user privilege).
- <programlisting>
- # sysctl net.core.somaxconn
- net.core.somaxconn = 128
- # sysctl -w net.core.somaxconn = 256
- </programlisting>
- You could add following to /etc/sysctl.conf instead.
- <programlisting>
- net.core.somaxconn = 256
- </programlisting>
- </para>
- <para>
- Number of connections to
- each <productname>PostgreSQL</productname> is roughly
- max_pool*num_init_children.
- </para>
-
- <para>
- However, canceling a query creates another
- connection to the backend; thus, a query cannot be canceled if
- all the connections are in use. If you want to ensure that queries can
- be canceled, set this value to twice the expected connections.
- </para>
- <para>
- In addition, <productname>PostgreSQL</productname> allows concurrent
- connections for non superusers up to max_connections -
- superuser_reserved_connections.
- </para>
- <para>
- In summary, max_pool, num_init_children, max_connections,
- superuser_reserved_connections must satisfy the following formula:
- <programlisting>
- max_pool*num_init_children <= (max_connections - superuser_reserved_connections) (no query canceling needed)
- max_pool*num_init_children*2 <= (max_connections - superuser_reserved_connections) (query canceling needed)
- </programlisting>
- </para>
- <para>
- This parameter can only be set at server start.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-reserved-connections" xreflabel="reserved_connections">
- <term><varname>reserved_connections</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>reserved_connections</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- When this parameter is set to 1 or greater, incoming
- connections from clients are not accepted with error
- message "Sorry, too many clients already", rather than
- blocked if the number of current connections from clients
- is more than (<xref linkend="guc-num-init-children"> -
- <varname>reserved_connections</varname>). For example,
- if <varname>reserved_connections</varname> = 1
- and <xref linkend="guc-num-init-children"> = 32, then the
- 32th connection from a client will be refused. This
- behavior is similar
- to <productname>PostgreSQL</productname> and good for
- systems on which the number of connections from clients is
- large and each session may take long time. In this case
- length of the listen queue could be very long and may
- cause the system unstable. In this situation setting this
- parameter to non 0 is a good idea to prevent the listen
- queue becomes very long.
- </para>
- <para>
- If this parameter is set to 0, no connection from clients
- will be refused. The default value is 0.
- This parameter can only be set at server start.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </sect2>
-
- <sect2 id="runtime-config-authentication-settings">
- <title>Authentication Settings</title>
- <variablelist>
-
- <varlistentry id="guc-enable-pool-hba" xreflabel="enable_pool_hba">
- <term><varname>enable_pool_hba</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>enable_pool_hba</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- If <literal>true</literal>, <productname>Pgpool-II</productname> will use the
- <filename>pool_hba.conf</filename> for the client
- authentication. See <xref linkend="auth-pool-hba-conf">
- for details on how to configure
- <filename>pool_hba.conf</filename> for client authentication.
- Default is <literal>false</literal>.
- </para>
- <para>
- This parameter can be changed by reloading
- the <productname>Pgpool-II</productname> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-pool-passwd" xreflabel="pool_passwd">
- <term><varname>pool_passwd</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>pool_passwd</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specify the path (absolute or relative) to password file for
- authentication. Default value is <literal>"pool_passwd"</literal>.
- A relative path will be interpreted with respect to the directory
- where configuration file is placed.
- Specifying <literal>''</literal> (empty) disables the use
- of password file.
- </para>
- <para>
- Passwords can be stored in the pool_passwd file using three formats.
- AES256 encrypted format, plain text format and md5 format.
- <productname>Pgpool-II</productname> identifies the password format type
- by it's prefix, so each password entry in the pool_passwd must be prefixed
- as per the password format.
- </para>
- <para>
- To store the password in the plain text format use <literal>TEXT</literal> prefix.
- For example. to store clear text password string <literal>"mypassword"</literal>
- in the pool_passwd, prepend the password string with <literal>TEXT</literal> prefix.
- e.g. <literal>TEXTmypassword</literal>
- </para>
- <para>
- similarly md5 hashed passwords must be prefixed with <literal>md5</literal> and
- AES256 encrypted password types can be stored using <literal>AES</literal> prefix.
- see <xref linkend="auth-aes-encrypted-password"> for more details on using
- AES256 encrypted passwords.
- </para>
-
- <para>
- In the absence of a valid prefix, <productname>Pgpool-II</productname> will
- be considered the string as a plain text password.
- </para>
- <para>
- This parameter can only be set at server start.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-allow-clear-text-frontend-auth" xreflabel="allow_clear_text_frontend_auth">
- <term><varname>allow_clear_text_frontend_auth</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>allow_clear_text_frontend_auth</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- If <productname>PostgreSQL</productname> backend servers require
- <literal>md5</literal> or <literal> SCRAM</literal> authentication for some
- user's authentication but the password for that user is not present in the
- <filename>"pool_passwd"</filename> file, then enabling
- <literal>allow_clear_text_frontend_auth</literal> will allow the
- <productname>Pgpool-II</productname> to use clear-text-password
- authentication with frontend clients to get the password in plain text form
- from the client and use it for backend authentication.
- </para>
- <para>
- Default is <literal>false</literal>.
- </para>
- <para>
- This parameter can be changed by reloading
- the <productname>Pgpool-II</productname> configurations.
- </para>
- <note>
- <para>
- <literal>allow_clear_text_frontend_auth</literal> only works when <xref linkend="guc-enable-pool-hba"> is not enabled
- </para>
- </note>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-authentication-timeout" xreflabel="authentication_timeout">
- <term><varname>authentication_timeout</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>authentication_timeout</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specify the timeout in seconds
- for <productname>Pgpool-II</productname>
- authentication. Specifying 0 disables the time out.
- Default value is 60.
- </para>
- <para>
- This parameter can be changed by reloading
- the <productname>Pgpool-II</productname> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
-
- </sect2>
-</sect1>
-
-<sect1 id="runtime-config-running-mode">
- <title>Clustering mode</title>
- <para>
- <variablelist>
- <varlistentry id="guc-backend-clustering-mode" xreflabel="backend_clustering_mode">
- <term><varname>backend_clustering_mode</varname> (<type>enum</type>)
- <indexterm>
- <primary><varname>backend_clustering_mode</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Clustering mode is the method to sync
- <productname>PostgreSQL</productname> servers. To set the clustering
- mode, <varname>backend_clustering_mode</varname> can be used. In
- this section we discuss how to set the clustering mode. See <xref
- linkend="planning-postgresql"> for more details.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </para>
-
- <sect2 id="runtime-config-streaming-replication-mode">
- <title>Streaming replication mode</title>
-
- <para>
- This mode is most popular and recommended clustering mode. In this
- mode <productname>PostgreSQL</productname> is responsible to
- replicate each servers. To enable this mode, use
- 'streaming_replication' for
- <varname>backend_clustering_mode</varname>.
- <programlisting>
-backend_clustering_mode = 'streaming_replication'
- </programlisting>
- In this mode you can have up to 127 streaming replication standby servers.
- Also it is possible not to have standby server at all.
- </para>
- <para>
- See <xref linkend="runtime-streaming-replication-check"> for
- additional parameters for streaming replication mode.
- </para>
- </sect2>
-
- <sect2 id="runtime-config-logical-replication-mode">
- <title>Logical replication mode</title>
-
- <para>
- This mode is recently added. In this mode
- <productname>PostgreSQL</productname> is responsible to replicate
- each servers. To enable this mode, use 'logical_replication' for
- <varname>backend_clustering_mode</varname>.
- <programlisting>
-backend_clustering_mode = 'logical_replication'
- </programlisting>
- In this mode you can have up to 127 logical replication standby servers.
- Also it is possible not to have standby server at all.
- </para>
- </sect2>
-
- <sect2 id="runtime-config-slony-mode">
- <title>Slony mode</title>
-
- <para>
- This mode is used to couple <productname>Pgpool-II</productname>
- with <acronym>Slony-I</acronym>. Slony-I is responsible for doing
- the actual data replication. To enable this mode, use 'slony' for
- <varname>backend_clustering_mode</varname>.
- <programlisting>
-backend_clustering_mode = 'slony'
- </programlisting>
- In this mode you can have up to 127 replica servers. Also it is
- possible not to have replica server at all.
- </para>
- </sect2>
-
- <sect2 id="guc-replication-mode" xreflabel="native_replication_mode">
- <title>Native replication mode</title>
-
- <para>
- This mode makes the <productname>Pgpool-II</productname> to
- replicate data between <productname>PostgreSQL</productname>
- backends. To enable this mode, use 'native_replication' for
- <varname>backend_clustering_mode</varname>.
- <programlisting>
-backend_clustering_mode = 'native_replication'
- </programlisting>
- In this mode you can have up to 127 standby replication servers.
- Also it is possible not to have standby server at all.
- </para>
-
- <para>
- Following options affect the behavior of
- <productname>Pgpool-II</productname> in the replication mode.
- </para>
-
- <variablelist>
-
- <varlistentry id="guc-replication-stop-on-mismatch" xreflabel="replication_stop_on_mismatch">
- <term><varname>replication_stop_on_mismatch</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>replication_stop_on_mismatch</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- When set to on, and all nodes do not reply with the same
- packet kind to the query that was sent to
- all <productname>PostgreSQL</productname> backend nodes,
- then the backend node whose reply differs from the
- majority is degenerated by
- the <productname>Pgpool-II</productname>.
- If <varname>replication_stop_on_mismatch</varname> is set
- to off and a similar situation happens then
- the <productname>Pgpool-II</productname> only terminates
- the current user session but does not degenerate a backend
- node.
- </para>
-
- <note>
- <para>
- <productname>Pgpool-II</productname> does not examine
- the data returned by the backends and takes the decision
- only by comparing the result packet types.
- </para>
- </note>
-
- <para>
- A typical use case of enabling
- the <varname>replication_stop_on_mismatch</varname> is to
- guard against the data inconsistency among the backend
- nodes. For example, you may want to degenerate a backend
- node if an UPDATE statement fails on one backend node
- while passes on others.
- </para>
- <para>
- Default is off.
- </para>
- <para>
- This parameter can be changed by reloading
- the <productname>Pgpool-II</productname> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-failover-if-affected-tuples-mismatch" xreflabel="failover_if_affected_tuples_mismatch">
- <term><varname>failover_if_affected_tuples_mismatch</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>failover_if_affected_tuples_mismatch</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- When set to on, and all nodes do not reply with the same
- number of affected tuples to the INSERT/UPDATE/DELETE
- query, then the backend node whose reply differs from the
- majority is degenerated by
- the <productname>Pgpool-II</productname>.
- If <varname>failover_if_affected_tuples_mismatch</varname>
- is set to off and a similar situation happens then
- the <productname>Pgpool-II</productname> only terminates
- the current user session but does not degenerate a backend
- node.
- </para>
-
- <note>
- <para>
- In case of a tie, when two or more groups have the same
- number of nodes, then the group containing the primary
- node (backend node having the youngest node id) gets the
- precedence.
- </para>
- </note>
-
- <para>
- Default is off.
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</productname> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-replicate-select" xreflabel="replicate_select">
- <term><varname>replicate_select</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>replicate_select</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- When set to on, <productname>Pgpool-II</productname> enables the
- SELECT query replication mode. i.e. The SELECT queries are sent
- to all backend nodes.
- </para>
-
- <table id="replicate-select-affect-table">
- <title>replicate_select with <xref linkend="guc-load-balance-mode"> affects on SELECT routing</title>
- <tgroup cols="6" align="center">
- <colspec colname="_1" colwidth="1*">
- <colspec colname="_2" colwidth="1*">
- <colspec colname="_3" colwidth="1*">
- <colspec colname="_4" colwidth="1*">
- <colspec colname="_5" colwidth="1*">
- <colspec colname="_6" colwidth="1*">
-
- <tbody>
- <row>
- <entry>replicate_select is true</entry>
- <entry align="center">Y</entry>
- <entry align="center" nameend="_6" namest="_3">N</entry>
- </row>
-
- <row>
- <entry>load_balance_mode is true</entry>
- <entry>ANY</entry>
- <entry align="center" nameend="_5" namest="_3">Y</entry>
- <entry align="center">N</entry>
- </row>
-
- <row>
- <entry>SELECT is inside a transaction block</entry>
- <entry align="center">ANY</entry>
- <entry nameend="_4" namest="_3" align="center"> Y </entry>
- <entry align="center">N</entry>
- <entry align="center">ANY</entry>
- </row>
-
- <row>
- <entry>
- Transaction isolation level is SERIALIZABLE and
- the transaction has issued a write query
- </entry>
- <entry align="center">ANY</entry>
- <entry align="center">Y</entry>
- <entry align="center">N</entry>
- <entry align="center">ANY</entry>
- <entry align="center">ANY</entry>
- </row>
-
- <row>
- <entry>
- results(R:replication, M: send only to main, L: load balance)
- </entry>
- <entry align="center">R</entry>
- <entry align="center">M</entry>
- <entry align="center">L</entry>
- <entry align="center">L</entry>
- <entry align="center">M</entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
-
- <para>
- Default is off.
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</productname> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-insert-lock" xreflabel="insert_lock">
- <term><varname>insert_lock</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>insert_lock</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- When set to on, <productname>Pgpool-II</productname> will
- automatically lock the table
- on <productname>PostgreSQL</productname> before an INSERT
- statement is issued for that.
- </para>
-
- <para>
- When replicating a table with SERIAL data type, the SERIAL
- column value may get different values on the different
- backends. The workaround to this problem is to explicitly
- lock the table before issuing the INSERT.
- </para>
- <para>
- So for automatically locking the
- table <productname>Pgpool-II</productname> do the
- following transformation:
- <programlisting>
- INSERT INTO ...
- </programlisting>
- to
- <programlisting>
- BEGIN;
- LOCK TABLE ...
- INSERT INTO ...
- COMMIT;
- </programlisting>
- </para>
- <caution>
- <para>
- This approach severely degrades the transactions'
- parallelism
- </para>
- </caution>
-
- <para>
- <productname>Pgpool-II</productname> <emphasis>V2.2</emphasis>
- or later, automatically detects whether the table has a
- SERIAL columns or not, so it never locks the table if it
- doesn't have the SERIAL columns.
- </para>
-
- <para>
- <productname>Pgpool-II</productname> <emphasis>V3.0</emphasis> until
- <productname>Pgpool-II</productname> <emphasis>V3.0.4</emphasis>
- uses a row lock against the sequence relation, rather than
- table lock. This is intended to minimize lock conflict
- with <acronym>VACUUM</acronym> (including autovacuum).
- However this can lead to another problem. After
- transaction wraparound happens, row locking against the
- sequence relation causes PostgreSQL internal error (more
- precisely, access error on pg_clog, which keeps
- transaction status). To prevent
- this, <productname>PostgreSQL</productname> core
- developers decided to disallow row locking against
- sequences and this broke
- the <productname>Pgpool-II</productname>, of course (the
- "fixed" version of PostgreSQL was released as 9.0.5,
- 8.4.9, 8.3.16 and 8.2.22).
- </para>
-
- <para>
- <productname>Pgpool-II</productname> <emphasis>V3.0.5</emphasis>
- or later uses a row lock
- against <literal>pgpool_catalog.insert_lock</literal>
- table because new PostgreSQL disallows a row lock against
- the sequence relation. So creating insert_lock table in
- all databases which are accessed via
- <productname>Pgpool-II</productname> beforehand is
- required. See <xref linkend="create-installlock-table">
- for more details. If does not exist insert_lock
- table, <productname>Pgpool-II</productname> locks the
- insert target table. This behavior is same
- as <productname>Pgpool-II</productname> <emphasis>V2.2</emphasis>
- and <emphasis>V2.3</emphasis> series.
- </para>
- <para>
- If you want to use <varname>insert_lock</varname> which is
- compatible with older releases, you can specify lock
- method by configure script.
- See <xref linkend="install-pgpool"> for more details.
- </para>
-
- <para>
- For fine (per statement) control:
- </para>
-
- <itemizedlist>
- <listitem>
- <para>
- set insert_lock to true, and add /*NO INSERT LOCK*/ at
- the beginning of an INSERT statement for which you do
- not want to acquire the table lock.
- </para>
- </listitem>
- <listitem>
- <para>
- set insert_lock to false, and add /*INSERT LOCK*/ at
- the beginning of an INSERT statement for which you
- want to acquire the table lock.
- </para>
- </listitem>
-
- </itemizedlist>
- <note>
- <para>
- If insert_lock is enabled, the regression tests for
- PostgreSQL 8.0 gets fail in transactions, privileges,
- rules, and alter_table.
- </para>
- <para>
- The reason for this is
- that <productname>Pgpool-II</productname> tries to LOCK
- the VIEW for the rule test, and it produces the below
- error message:
- <programlisting>
- ! ERROR: current transaction is aborted, commands ignored until
- end of transaction block
- </programlisting>
- For example, the transactions test tries an INSERT into
- a table which does not exist,
- and <productname>Pgpool-II</productname>
- causes <productname>PostgreSQL</productname> to acquire
- the lock for the table. Of cause this results in an
- error. The transaction will be aborted, and the
- following INSERT statement produces the above error
- message.
- </para>
- </note>
- <para>
- Default is off.
- </para>
- <para>
- This parameter can be changed by reloading
- the <productname>Pgpool-II</productname> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-lobj-lock-table" xreflabel="lobj_lock_table">
- <term><varname>lobj_lock_table</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>lobj_lock_table</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies a table name used for large object replication control.
- If it is specified, <productname>Pgpool-II</productname> will lock
- the table specified by <varname>lobj_lock_table</varname> and generate
- a large object id by looking into <literal>pg_largeobject</literal>
- system catalog and then call <literal>lo_create</literal> to create
- the large object.
- This procedure guarantees that <productname>Pgpool-II</productname>
- will get the same large object id in all DB nodes in replication mode.
- </para>
- <note>
- <para>
- <productname>PostgreSQL</productname> 8.0 and older does
- not have <literal>lo_create</literal>, so this feature
- does not work with PostgreSQL 8.0 and older versions.
- </para>
- </note>
- <para>
- A call to the <literal>libpq</literal>
- function <literal>lo_creat()</literal> triggers this
- feature. Also large object creation
- through <acronym>Java</acronym> API
- (<acronym>JDBC</acronym> driver), <acronym>PHP</acronym>
- API (<literal>pg_lo_create</literal>, or similar API in
- PHP library such as PDO), and this same API in various
- programming languages are known to use a similar protocol,
- and thus should work.
- </para>
-
- <para>
- This feature does not works with following operations on large objects.
- </para>
- <itemizedlist>
- <listitem>
- <para>
- All APIs using <literal>lo_create</literal>, <literal>lo_import_with_oid</literal>.
- </para>
- </listitem>
- <listitem>
- <para>
- <literal>lo_import</literal> function in backend called in SELECT.
- </para>
- </listitem>
- <listitem>
- <para>
- <literal>lo_create</literal> function in backend called in SELECT.
- </para>
- </listitem>
- </itemizedlist>
-
- <note>
- <para>
- All <productname>PostgreSQL</productname> users must
- have a write access
- on <varname>lobj_lock_table</varname> and it can be
- created in any schema.
- </para>
- </note>
-
- <para>
- Example to create a large object lock table:
- <programlisting>
- CREATE TABLE public.my_lock_table ();
- GRANT ALL ON public.my_lock_table TO PUBLIC;
- </programlisting>
- </para>
- <para>
- Default is <literal>''</literal>(empty), which disables the feature.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </sect2>
-
- <sect2 id="guc-snapshot-isolation-mode" xreflabel="snapshot_isolation_mode">
- <title>Snapshot isolation mode</title>
-
- <para>
- This mode is similar to the native replication mode except it adds
- the visibility consistency among nodes. The implementation is based
- on a research paper <xref linkend="mishima2009">.
- To enable this mode, use 'snapshot_isolation' for
- <varname>backend_clustering_mode</varname>.
- <programlisting>
-backend_clustering_mode = 'snapshot_isolation'
- </programlisting>
- For example, you can avoid following inconsistency among nodes caused by the
- visibility inconsistency. Here S1 and S2 denotes sessions, while N1
- and N2 denotes the PostgreSQL server 1 and 2 respectively.
- <programlisting>
-S1/N1: BEGIN;
-S1/N2: BEGIN;
-S1/N1: UPDATE t1 SET i = i + 1; -- i = 1
-S1/N2: UPDATE t1 SET i = i + 1; -- i = 1
-S1/N1: COMMIT;
-S2/N1: BEGIN;
-S2/N2: BEGIN;
-S2/N2: DELETE FROM t1 WHERE i = 1; -- delete 1 row since S1/N2 is not committed yet
-S2/N1: DELETE FROM t1 WHERE i = 1; -- delete no row since S1/N1 is committed and i is not 1 anymore
-S1/N2: COMMIT;
-S2/N1: COMMIT;
-S2/N2: COMMIT;
- </programlisting>
- In the snapshot isolation mode, the result will be either one of
- them below and it never damages the data consistency among database
- nodes.
- <programlisting>
-S1/N1: BEGIN;
-S1/N2: BEGIN;
-S1/N1: UPDATE t1 SET i = i + 1; -- i = 1
-S1/N2: UPDATE t1 SET i = i + 1; -- i = 1
-S2/N1: BEGIN;
-S2/N2: BEGIN;
-S1/N1: COMMIT;
-S1/N2: COMMIT;
-S2/N1: DELETE FROM t1 WHERE i = 1; -- delete no row since S1/N1 is committed and i is not 1 anymore
-S2/N2: DELETE FROM t1 WHERE i = 1; -- delete no row since S1/N2 is committed and i is not 1 anymore
-S2/N1: COMMIT;
-S2/N2: COMMIT;
- </programlisting>
-
- <programlisting>
-S1/N1: BEGIN;
-S1/N2: BEGIN;
-S1/N1: UPDATE t1 SET i = i + 1; -- i = 1
-S1/N2: UPDATE t1 SET i = i + 1; -- i = 1
-S2/N1: BEGIN;
-S2/N2: BEGIN;
-S2/N1: DELETE FROM t1 WHERE i = 1; -- delete 1 row since S1/N1 is not committed yet
-S2/N2: DELETE FROM t1 WHERE i = 1; -- delete 1 row since S1/N2 is not committed yet
-S1/N1: COMMIT;
-S1/N2: COMMIT;
-S2/N1: COMMIT;
-S2/N2: COMMIT;
- </programlisting>
-
- Please note that there are some limitations in this mode and
- currently (in <productname>Pgpool-II</productname> 4.2) this mode
- is regarded as "experimental implementation. Be warned that careful
- testings are required before you implement this in a production
- system.
- </para>
- <itemizedlist>
- <listitem>
- <para>
- It is necessary to set the transaction isolation level to
- REPEATABLE READ. That means you need to set it in
- <filename>postgresql.conf</filename> like this:
- <programlisting>
-default_transaction_isolation = 'repeatable read'
- </programlisting>
- </para>
- </listitem>
-
- <listitem>
- <para>
- Consistent visibility in SERIAL data type and sequences are not
- guaranteed.
- </para>
- </listitem>
- </itemizedlist>
- </sect2>
-
- <sect2 id="guc-raw-mode" xreflabel="raw_mode">
- <title>Raw mode</title>
- <para>
- In this mode, <productname>Pgpool-II</> does not care about the database synchronization.
- It's user's responsibility to make the whole system does a meaningful thing.
- Load balancing is <emphasis>not</emphasis> possible in the mode.
- To enable this mode, use 'raw' for <varname>backend_clustering_mode</varname>.
- <programlisting>
-backend_clustering_mode = 'raw'
- </programlisting>
- </para>
- </sect2>
-
-</sect1>
-
-<sect1 id="runtime-config-backend-settings">
- <title>Backend Settings</title>
-
- <sect2 id="runtime-config-backend-connection-settings">
- <title>Backend Connection Settings</title>
-
- <variablelist>
-
- <varlistentry id="guc-backend-hostname" xreflabel="backend_hostname">
- <term><varname>backend_hostname</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>backend_hostname</varname> configuration parameter</primary>
- </indexterm>
- </term>
-
- <listitem>
- <para>
- <varname>backend_hostname</varname> specifies the
- <productname>PostgreSQL</productname> backend to be
- connected to. It is used
- by <productname>Pgpool-II</productname> to communicate
- with the server.
- </para>
-
- <para>
- For TCP/IP communication, this parameter can take a
- hostname or an IP address. If this begins with a
- slash(<literal>/</literal>), it specifies Unix-domain
- communication rather than TCP/IP; the value is the name of
- the directory in which the socket file is stored. The
- default behavior when backend_hostname is empty
- (<literal>''</literal>) is to connect to a Unix-domain
- socket in <filename>/tmp</filename>.
- </para>
-
- <para>
- Multiple backends can be specified by adding a number at the
- end of the parameter name (e.g.backend_hostname0). This
- number is referred to as "DB node ID", and it starts from
- 0. The backend which was given the DB node ID of 0 will be
- called "main node". When multiple backends are defined, the
- service can be continued even if the main node is down (not
- true in some modes). In this case, the youngest DB node ID
- alive will be the new main node.
- </para>
-
- <para>
- Please note that the DB node which has id 0 has no special
- meaning if operated in streaming replication mode. Rather,
- you should care about if the DB node is the "primary node" or
- not. See <xref linkend="runtime-config-load-balancing">,
- <xref linkend="runtime-config-failover">,
- <xref linkend="runtime-streaming-replication-check">
- for more details.
- </para>
-
- <para>
- If you plan to use only
- one <productname>PostgreSQL</productname> server, specify
- it by backend_hostname0.
- </para>
-
- <para>
- New nodes can be added by adding parameter rows and
- reloading a configuration file. However, the existing
- values cannot be updated, so you must
- restart <productname>Pgpool-II</productname> in that case.
- </para>
-
- </listitem>
-
- </varlistentry>
-
- <varlistentry id="guc-backend-port" xreflabel="backend_port">
- <term><varname>backend_port</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>backend_port</varname> configuration parameter</primary>
- </indexterm>
- </term>
-
- <listitem>
- <para>
- <varname>backend_port</varname> specifies the port number
- of the backends. Multiple backends can be specified by
- adding a number at the end of the parameter name
- (e.g. backend_port0). If you plan to use only one
- <productname>PostgreSQL</productname> server, specify it by backend_port0.
- </para>
- <para>
- New backend ports can be added by adding parameter rows
- and reloading a configuration file. However, the existing
- values cannot be updated, so you must
- restart <productname>Pgpool-II</productname> in that case.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-backend-weight" xreflabel="backend_weight">
- <term><varname>backend_weight</varname> (<type>floating point</type>)
- <indexterm>
- <primary><varname>backend_weight</varname> configuration parameter</primary>
- </indexterm>
- </term>
-
- <listitem>
- <para>
- <varname>backend_weight</varname> specifies the load balance
- ratio of the backends. It may be set to any integer or
- floating point value greater than or equal to zero.
- Multiple backends can be specified by
- adding a number at the end of the parameter name
- (e.g. backend_weight0). If you plan to use only one
- PostgreSQL server, specify it by backend_weight0.
- </para>
- <para>
- New <varname>backend_weight</varname> can be added in this parameter by
- reloading a configuration file. However, this will take
- effect only for new established client sessions.
- <productname>Pgpool-II</productname> <emphasis>V2.2.6</emphasis>, <emphasis>V2.3</emphasis>
- or later allows updating the values by reloading a
- configuration file. This is useful if you want to prevent
- any query sent to standbys to perform some administrative
- work in streaming replication mode, logical replication mode and slony mode.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </sect2>
-
- <sect2 id="runtime-config-backend-data">
- <title>Backend Data Settings</title>
-
- <variablelist>
-
- <varlistentry id="guc-backend-data-directory" xreflabel="backend_data_directory">
- <term><varname>backend_data_directory</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>backend_data_directory</varname> configuration parameter</primary>
- </indexterm>
- </term>
-
- <listitem>
- <para>
- <varname>backend_data_directory</varname> specifies the
- database cluster directory of the backend. Multiple backends can be
- specified by adding a number at the end of the parameter
- name (e.g. backend_data_directory0). If you plan to use
- only one PostgreSQL server, specify it by
- backend_data_directory0.
- </para>
- <para>
- New <varname>backend data_directory</varname> can be added by adding parameter rows and reloading a
- configuration file. However, the existing values cannot be updated, so
- you must restart <productname>Pgpool-II</productname> in
- that case.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-backend-flag" xreflabel="backend_flag">
- <term><varname>backend_flag</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>backend_flag</varname> configuration parameter</primary>
- </indexterm>
- </term>
-
- <listitem>
- <para>
- <varname>backend_flag</varname> controls various backend
- behavior. Multiple backends can be specified by adding a
- number at the end of the parameter name
- (e.g. backend_flag0). If you plan to use only one
- PostgreSQL server, specify it by backend_flag0.
- </para>
- <para>
- New backend flags can be added by adding parameter rows and reloading a
- configuration file. Currently followings are allowed. Multiple flags can
- be specified by using "|".
- </para>
-
- <table id="backend-flag-table">
- <title>Backend flags</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Flag</entry>
- <entry>Description</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry><literal>ALLOW_TO_FAILOVER</literal></entry>
- <entry>Allow to failover or detaching backend. This
- is the default. You cannot specify with
- DISALLOW_TO_FAILOVER at a same time.</entry>
- </row>
- <row>
- <entry><literal>DISALLOW_TO_FAILOVER</literal></entry>
- <entry>Disallow to failover or detaching backend
- This is useful when you protect backend by
- using HA (High Availability) softwares such as
- <productname>Heartbeat</productname>
- or <productname>Pacemaker</productname>. You cannot specify with
- ALLOW_TO_FAILOVER at a same time.
- </entry>
- </row>
-
- <row>
- <entry><literal>ALWAYS_PRIMARY</literal></entry>
- <entry>This is only useful in streaming replication
- mode. See <xref linkend="running-mode"> about
- streaming replication mode. If this flag is set to
- one of
- backends, <productname>Pgpool-II</productname> will
- not find the primary node by inspecting
- backend. Instead, always regard the node which the
- flag is set as the primary node. This is useful for
- systems including <productname>Amazon Aurora for
- PostgreSQL Compatibility</productname> which has
- fixed primary server name. See <xref linkend="example-Aurora">
- for an example settings.
- </entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
- <para>
- This parameter can be changed by reloading
- the <productname>Pgpool-II</productname> configurations.
- </para>
-
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-backend-application-name" xreflabel="backend_application_name">
- <term><varname>backend_application_name</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>backend_application_name</varname> configuration parameter</primary>
- </indexterm>
- </term>
-
- <listitem>
- <para>
- <varname>backend_application_name</varname> specifies the
- application name of walsender, which receives WAL log
- from primary node. Thus in other than streaming
- replication mode, this parameter does not need to be set.
- Also this parameter is required to if you want to show
- "replication_state" and "replication_sync_state" column
- in <xref linkend="SQL-SHOW-POOL-NODES"> command.
- </para>
- <para>
- This parameter can be changed by reloading
- the <productname>Pgpool-II</productname> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
-
- </sect2>
-
-</sect1>
+++ /dev/null
-<!-- autogenerated from src/backend/utils/errcodes.txt, do not edit -->
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 00 — Successful Completion</></entry>
-</row>
-
-<row>
- <entry><literal>00000</literal></entry>
- <entry><symbol>successful_completion</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 01 — Warning</></entry>
-</row>
-
-<row>
- <entry><literal>01000</literal></entry>
- <entry><symbol>warning</symbol></entry>
-</row>
-
-<row>
- <entry><literal>0100C</literal></entry>
- <entry><symbol>dynamic_result_sets_returned</symbol></entry>
-</row>
-
-<row>
- <entry><literal>01008</literal></entry>
- <entry><symbol>implicit_zero_bit_padding</symbol></entry>
-</row>
-
-<row>
- <entry><literal>01003</literal></entry>
- <entry><symbol>null_value_eliminated_in_set_function</symbol></entry>
-</row>
-
-<row>
- <entry><literal>01007</literal></entry>
- <entry><symbol>privilege_not_granted</symbol></entry>
-</row>
-
-<row>
- <entry><literal>01006</literal></entry>
- <entry><symbol>privilege_not_revoked</symbol></entry>
-</row>
-
-<row>
- <entry><literal>01004</literal></entry>
- <entry><symbol>string_data_right_truncation</symbol></entry>
-</row>
-
-<row>
- <entry><literal>01P01</literal></entry>
- <entry><symbol>deprecated_feature</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 02 — No Data (this is also a warning class per the SQL standard)</></entry>
-</row>
-
-<row>
- <entry><literal>02000</literal></entry>
- <entry><symbol>no_data</symbol></entry>
-</row>
-
-<row>
- <entry><literal>02001</literal></entry>
- <entry><symbol>no_additional_dynamic_result_sets_returned</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 03 — SQL Statement Not Yet Complete</></entry>
-</row>
-
-<row>
- <entry><literal>03000</literal></entry>
- <entry><symbol>sql_statement_not_yet_complete</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 08 — Connection Exception</></entry>
-</row>
-
-<row>
- <entry><literal>08000</literal></entry>
- <entry><symbol>connection_exception</symbol></entry>
-</row>
-
-<row>
- <entry><literal>08003</literal></entry>
- <entry><symbol>connection_does_not_exist</symbol></entry>
-</row>
-
-<row>
- <entry><literal>08006</literal></entry>
- <entry><symbol>connection_failure</symbol></entry>
-</row>
-
-<row>
- <entry><literal>08001</literal></entry>
- <entry><symbol>sqlclient_unable_to_establish_sqlconnection</symbol></entry>
-</row>
-
-<row>
- <entry><literal>08004</literal></entry>
- <entry><symbol>sqlserver_rejected_establishment_of_sqlconnection</symbol></entry>
-</row>
-
-<row>
- <entry><literal>08007</literal></entry>
- <entry><symbol>transaction_resolution_unknown</symbol></entry>
-</row>
-
-<row>
- <entry><literal>08P01</literal></entry>
- <entry><symbol>protocol_violation</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 09 — Triggered Action Exception</></entry>
-</row>
-
-<row>
- <entry><literal>09000</literal></entry>
- <entry><symbol>triggered_action_exception</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 0A — Feature Not Supported</></entry>
-</row>
-
-<row>
- <entry><literal>0A000</literal></entry>
- <entry><symbol>feature_not_supported</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 0B — Invalid Transaction Initiation</></entry>
-</row>
-
-<row>
- <entry><literal>0B000</literal></entry>
- <entry><symbol>invalid_transaction_initiation</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 0F — Locator Exception</></entry>
-</row>
-
-<row>
- <entry><literal>0F000</literal></entry>
- <entry><symbol>locator_exception</symbol></entry>
-</row>
-
-<row>
- <entry><literal>0F001</literal></entry>
- <entry><symbol>invalid_locator_specification</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 0L — Invalid Grantor</></entry>
-</row>
-
-<row>
- <entry><literal>0L000</literal></entry>
- <entry><symbol>invalid_grantor</symbol></entry>
-</row>
-
-<row>
- <entry><literal>0LP01</literal></entry>
- <entry><symbol>invalid_grant_operation</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 0P — Invalid Role Specification</></entry>
-</row>
-
-<row>
- <entry><literal>0P000</literal></entry>
- <entry><symbol>invalid_role_specification</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 0Z — Diagnostics Exception</></entry>
-</row>
-
-<row>
- <entry><literal>0Z000</literal></entry>
- <entry><symbol>diagnostics_exception</symbol></entry>
-</row>
-
-<row>
- <entry><literal>0Z002</literal></entry>
- <entry><symbol>stacked_diagnostics_accessed_without_active_handler</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 20 — Case Not Found</></entry>
-</row>
-
-<row>
- <entry><literal>20000</literal></entry>
- <entry><symbol>case_not_found</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 21 — Cardinality Violation</></entry>
-</row>
-
-<row>
- <entry><literal>21000</literal></entry>
- <entry><symbol>cardinality_violation</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 22 — Data Exception</></entry>
-</row>
-
-<row>
- <entry><literal>22000</literal></entry>
- <entry><symbol>data_exception</symbol></entry>
-</row>
-
-<row>
- <entry><literal>2202E</literal></entry>
- <entry><symbol>array_subscript_error</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22021</literal></entry>
- <entry><symbol>character_not_in_repertoire</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22008</literal></entry>
- <entry><symbol>datetime_field_overflow</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22012</literal></entry>
- <entry><symbol>division_by_zero</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22005</literal></entry>
- <entry><symbol>error_in_assignment</symbol></entry>
-</row>
-
-<row>
- <entry><literal>2200B</literal></entry>
- <entry><symbol>escape_character_conflict</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22022</literal></entry>
- <entry><symbol>indicator_overflow</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22015</literal></entry>
- <entry><symbol>interval_field_overflow</symbol></entry>
-</row>
-
-<row>
- <entry><literal>2201E</literal></entry>
- <entry><symbol>invalid_argument_for_logarithm</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22014</literal></entry>
- <entry><symbol>invalid_argument_for_ntile_function</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22016</literal></entry>
- <entry><symbol>invalid_argument_for_nth_value_function</symbol></entry>
-</row>
-
-<row>
- <entry><literal>2201F</literal></entry>
- <entry><symbol>invalid_argument_for_power_function</symbol></entry>
-</row>
-
-<row>
- <entry><literal>2201G</literal></entry>
- <entry><symbol>invalid_argument_for_width_bucket_function</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22018</literal></entry>
- <entry><symbol>invalid_character_value_for_cast</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22007</literal></entry>
- <entry><symbol>invalid_datetime_format</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22019</literal></entry>
- <entry><symbol>invalid_escape_character</symbol></entry>
-</row>
-
-<row>
- <entry><literal>2200D</literal></entry>
- <entry><symbol>invalid_escape_octet</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22025</literal></entry>
- <entry><symbol>invalid_escape_sequence</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22P06</literal></entry>
- <entry><symbol>nonstandard_use_of_escape_character</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22010</literal></entry>
- <entry><symbol>invalid_indicator_parameter_value</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22023</literal></entry>
- <entry><symbol>invalid_parameter_value</symbol></entry>
-</row>
-
-<row>
- <entry><literal>2201B</literal></entry>
- <entry><symbol>invalid_regular_expression</symbol></entry>
-</row>
-
-<row>
- <entry><literal>2201W</literal></entry>
- <entry><symbol>invalid_row_count_in_limit_clause</symbol></entry>
-</row>
-
-<row>
- <entry><literal>2201X</literal></entry>
- <entry><symbol>invalid_row_count_in_result_offset_clause</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22009</literal></entry>
- <entry><symbol>invalid_time_zone_displacement_value</symbol></entry>
-</row>
-
-<row>
- <entry><literal>2200C</literal></entry>
- <entry><symbol>invalid_use_of_escape_character</symbol></entry>
-</row>
-
-<row>
- <entry><literal>2200G</literal></entry>
- <entry><symbol>most_specific_type_mismatch</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22004</literal></entry>
- <entry><symbol>null_value_not_allowed</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22002</literal></entry>
- <entry><symbol>null_value_no_indicator_parameter</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22003</literal></entry>
- <entry><symbol>numeric_value_out_of_range</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22026</literal></entry>
- <entry><symbol>string_data_length_mismatch</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22001</literal></entry>
- <entry><symbol>string_data_right_truncation</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22011</literal></entry>
- <entry><symbol>substring_error</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22027</literal></entry>
- <entry><symbol>trim_error</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22024</literal></entry>
- <entry><symbol>unterminated_c_string</symbol></entry>
-</row>
-
-<row>
- <entry><literal>2200F</literal></entry>
- <entry><symbol>zero_length_character_string</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22P01</literal></entry>
- <entry><symbol>floating_point_exception</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22P02</literal></entry>
- <entry><symbol>invalid_text_representation</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22P03</literal></entry>
- <entry><symbol>invalid_binary_representation</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22P04</literal></entry>
- <entry><symbol>bad_copy_file_format</symbol></entry>
-</row>
-
-<row>
- <entry><literal>22P05</literal></entry>
- <entry><symbol>untranslatable_character</symbol></entry>
-</row>
-
-<row>
- <entry><literal>2200L</literal></entry>
- <entry><symbol>not_an_xml_document</symbol></entry>
-</row>
-
-<row>
- <entry><literal>2200M</literal></entry>
- <entry><symbol>invalid_xml_document</symbol></entry>
-</row>
-
-<row>
- <entry><literal>2200N</literal></entry>
- <entry><symbol>invalid_xml_content</symbol></entry>
-</row>
-
-<row>
- <entry><literal>2200S</literal></entry>
- <entry><symbol>invalid_xml_comment</symbol></entry>
-</row>
-
-<row>
- <entry><literal>2200T</literal></entry>
- <entry><symbol>invalid_xml_processing_instruction</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 23 — Integrity Constraint Violation</></entry>
-</row>
-
-<row>
- <entry><literal>23000</literal></entry>
- <entry><symbol>integrity_constraint_violation</symbol></entry>
-</row>
-
-<row>
- <entry><literal>23001</literal></entry>
- <entry><symbol>restrict_violation</symbol></entry>
-</row>
-
-<row>
- <entry><literal>23502</literal></entry>
- <entry><symbol>not_null_violation</symbol></entry>
-</row>
-
-<row>
- <entry><literal>23503</literal></entry>
- <entry><symbol>foreign_key_violation</symbol></entry>
-</row>
-
-<row>
- <entry><literal>23505</literal></entry>
- <entry><symbol>unique_violation</symbol></entry>
-</row>
-
-<row>
- <entry><literal>23514</literal></entry>
- <entry><symbol>check_violation</symbol></entry>
-</row>
-
-<row>
- <entry><literal>23P01</literal></entry>
- <entry><symbol>exclusion_violation</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 24 — Invalid Cursor State</></entry>
-</row>
-
-<row>
- <entry><literal>24000</literal></entry>
- <entry><symbol>invalid_cursor_state</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 25 — Invalid Transaction State</></entry>
-</row>
-
-<row>
- <entry><literal>25000</literal></entry>
- <entry><symbol>invalid_transaction_state</symbol></entry>
-</row>
-
-<row>
- <entry><literal>25001</literal></entry>
- <entry><symbol>active_sql_transaction</symbol></entry>
-</row>
-
-<row>
- <entry><literal>25002</literal></entry>
- <entry><symbol>branch_transaction_already_active</symbol></entry>
-</row>
-
-<row>
- <entry><literal>25008</literal></entry>
- <entry><symbol>held_cursor_requires_same_isolation_level</symbol></entry>
-</row>
-
-<row>
- <entry><literal>25003</literal></entry>
- <entry><symbol>inappropriate_access_mode_for_branch_transaction</symbol></entry>
-</row>
-
-<row>
- <entry><literal>25004</literal></entry>
- <entry><symbol>inappropriate_isolation_level_for_branch_transaction</symbol></entry>
-</row>
-
-<row>
- <entry><literal>25005</literal></entry>
- <entry><symbol>no_active_sql_transaction_for_branch_transaction</symbol></entry>
-</row>
-
-<row>
- <entry><literal>25006</literal></entry>
- <entry><symbol>read_only_sql_transaction</symbol></entry>
-</row>
-
-<row>
- <entry><literal>25007</literal></entry>
- <entry><symbol>schema_and_data_statement_mixing_not_supported</symbol></entry>
-</row>
-
-<row>
- <entry><literal>25P01</literal></entry>
- <entry><symbol>no_active_sql_transaction</symbol></entry>
-</row>
-
-<row>
- <entry><literal>25P02</literal></entry>
- <entry><symbol>in_failed_sql_transaction</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 26 — Invalid SQL Statement Name</></entry>
-</row>
-
-<row>
- <entry><literal>26000</literal></entry>
- <entry><symbol>invalid_sql_statement_name</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 27 — Triggered Data Change Violation</></entry>
-</row>
-
-<row>
- <entry><literal>27000</literal></entry>
- <entry><symbol>triggered_data_change_violation</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 28 — Invalid Authorization Specification</></entry>
-</row>
-
-<row>
- <entry><literal>28000</literal></entry>
- <entry><symbol>invalid_authorization_specification</symbol></entry>
-</row>
-
-<row>
- <entry><literal>28P01</literal></entry>
- <entry><symbol>invalid_password</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 2B — Dependent Privilege Descriptors Still Exist</></entry>
-</row>
-
-<row>
- <entry><literal>2B000</literal></entry>
- <entry><symbol>dependent_privilege_descriptors_still_exist</symbol></entry>
-</row>
-
-<row>
- <entry><literal>2BP01</literal></entry>
- <entry><symbol>dependent_objects_still_exist</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 2D — Invalid Transaction Termination</></entry>
-</row>
-
-<row>
- <entry><literal>2D000</literal></entry>
- <entry><symbol>invalid_transaction_termination</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 2F — SQL Routine Exception</></entry>
-</row>
-
-<row>
- <entry><literal>2F000</literal></entry>
- <entry><symbol>sql_routine_exception</symbol></entry>
-</row>
-
-<row>
- <entry><literal>2F005</literal></entry>
- <entry><symbol>function_executed_no_return_statement</symbol></entry>
-</row>
-
-<row>
- <entry><literal>2F002</literal></entry>
- <entry><symbol>modifying_sql_data_not_permitted</symbol></entry>
-</row>
-
-<row>
- <entry><literal>2F003</literal></entry>
- <entry><symbol>prohibited_sql_statement_attempted</symbol></entry>
-</row>
-
-<row>
- <entry><literal>2F004</literal></entry>
- <entry><symbol>reading_sql_data_not_permitted</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 34 — Invalid Cursor Name</></entry>
-</row>
-
-<row>
- <entry><literal>34000</literal></entry>
- <entry><symbol>invalid_cursor_name</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 38 — External Routine Exception</></entry>
-</row>
-
-<row>
- <entry><literal>38000</literal></entry>
- <entry><symbol>external_routine_exception</symbol></entry>
-</row>
-
-<row>
- <entry><literal>38001</literal></entry>
- <entry><symbol>containing_sql_not_permitted</symbol></entry>
-</row>
-
-<row>
- <entry><literal>38002</literal></entry>
- <entry><symbol>modifying_sql_data_not_permitted</symbol></entry>
-</row>
-
-<row>
- <entry><literal>38003</literal></entry>
- <entry><symbol>prohibited_sql_statement_attempted</symbol></entry>
-</row>
-
-<row>
- <entry><literal>38004</literal></entry>
- <entry><symbol>reading_sql_data_not_permitted</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 39 — External Routine Invocation Exception</></entry>
-</row>
-
-<row>
- <entry><literal>39000</literal></entry>
- <entry><symbol>external_routine_invocation_exception</symbol></entry>
-</row>
-
-<row>
- <entry><literal>39001</literal></entry>
- <entry><symbol>invalid_sqlstate_returned</symbol></entry>
-</row>
-
-<row>
- <entry><literal>39004</literal></entry>
- <entry><symbol>null_value_not_allowed</symbol></entry>
-</row>
-
-<row>
- <entry><literal>39P01</literal></entry>
- <entry><symbol>trigger_protocol_violated</symbol></entry>
-</row>
-
-<row>
- <entry><literal>39P02</literal></entry>
- <entry><symbol>srf_protocol_violated</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 3B — Savepoint Exception</></entry>
-</row>
-
-<row>
- <entry><literal>3B000</literal></entry>
- <entry><symbol>savepoint_exception</symbol></entry>
-</row>
-
-<row>
- <entry><literal>3B001</literal></entry>
- <entry><symbol>invalid_savepoint_specification</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 3D — Invalid Catalog Name</></entry>
-</row>
-
-<row>
- <entry><literal>3D000</literal></entry>
- <entry><symbol>invalid_catalog_name</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 3F — Invalid Schema Name</></entry>
-</row>
-
-<row>
- <entry><literal>3F000</literal></entry>
- <entry><symbol>invalid_schema_name</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 40 — Transaction Rollback</></entry>
-</row>
-
-<row>
- <entry><literal>40000</literal></entry>
- <entry><symbol>transaction_rollback</symbol></entry>
-</row>
-
-<row>
- <entry><literal>40002</literal></entry>
- <entry><symbol>transaction_integrity_constraint_violation</symbol></entry>
-</row>
-
-<row>
- <entry><literal>40001</literal></entry>
- <entry><symbol>serialization_failure</symbol></entry>
-</row>
-
-<row>
- <entry><literal>40003</literal></entry>
- <entry><symbol>statement_completion_unknown</symbol></entry>
-</row>
-
-<row>
- <entry><literal>40P01</literal></entry>
- <entry><symbol>deadlock_detected</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 42 — Syntax Error or Access Rule Violation</></entry>
-</row>
-
-<row>
- <entry><literal>42000</literal></entry>
- <entry><symbol>syntax_error_or_access_rule_violation</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42601</literal></entry>
- <entry><symbol>syntax_error</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42501</literal></entry>
- <entry><symbol>insufficient_privilege</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42846</literal></entry>
- <entry><symbol>cannot_coerce</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42803</literal></entry>
- <entry><symbol>grouping_error</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42P20</literal></entry>
- <entry><symbol>windowing_error</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42P19</literal></entry>
- <entry><symbol>invalid_recursion</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42830</literal></entry>
- <entry><symbol>invalid_foreign_key</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42602</literal></entry>
- <entry><symbol>invalid_name</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42622</literal></entry>
- <entry><symbol>name_too_long</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42939</literal></entry>
- <entry><symbol>reserved_name</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42804</literal></entry>
- <entry><symbol>datatype_mismatch</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42P18</literal></entry>
- <entry><symbol>indeterminate_datatype</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42P21</literal></entry>
- <entry><symbol>collation_mismatch</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42P22</literal></entry>
- <entry><symbol>indeterminate_collation</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42809</literal></entry>
- <entry><symbol>wrong_object_type</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42703</literal></entry>
- <entry><symbol>undefined_column</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42883</literal></entry>
- <entry><symbol>undefined_function</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42P01</literal></entry>
- <entry><symbol>undefined_table</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42P02</literal></entry>
- <entry><symbol>undefined_parameter</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42704</literal></entry>
- <entry><symbol>undefined_object</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42701</literal></entry>
- <entry><symbol>duplicate_column</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42P03</literal></entry>
- <entry><symbol>duplicate_cursor</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42P04</literal></entry>
- <entry><symbol>duplicate_database</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42723</literal></entry>
- <entry><symbol>duplicate_function</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42P05</literal></entry>
- <entry><symbol>duplicate_prepared_statement</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42P06</literal></entry>
- <entry><symbol>duplicate_schema</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42P07</literal></entry>
- <entry><symbol>duplicate_table</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42712</literal></entry>
- <entry><symbol>duplicate_alias</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42710</literal></entry>
- <entry><symbol>duplicate_object</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42702</literal></entry>
- <entry><symbol>ambiguous_column</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42725</literal></entry>
- <entry><symbol>ambiguous_function</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42P08</literal></entry>
- <entry><symbol>ambiguous_parameter</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42P09</literal></entry>
- <entry><symbol>ambiguous_alias</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42P10</literal></entry>
- <entry><symbol>invalid_column_reference</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42611</literal></entry>
- <entry><symbol>invalid_column_definition</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42P11</literal></entry>
- <entry><symbol>invalid_cursor_definition</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42P12</literal></entry>
- <entry><symbol>invalid_database_definition</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42P13</literal></entry>
- <entry><symbol>invalid_function_definition</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42P14</literal></entry>
- <entry><symbol>invalid_prepared_statement_definition</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42P15</literal></entry>
- <entry><symbol>invalid_schema_definition</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42P16</literal></entry>
- <entry><symbol>invalid_table_definition</symbol></entry>
-</row>
-
-<row>
- <entry><literal>42P17</literal></entry>
- <entry><symbol>invalid_object_definition</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 44 — WITH CHECK OPTION Violation</></entry>
-</row>
-
-<row>
- <entry><literal>44000</literal></entry>
- <entry><symbol>with_check_option_violation</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 53 — Insufficient Resources</></entry>
-</row>
-
-<row>
- <entry><literal>53000</literal></entry>
- <entry><symbol>insufficient_resources</symbol></entry>
-</row>
-
-<row>
- <entry><literal>53100</literal></entry>
- <entry><symbol>disk_full</symbol></entry>
-</row>
-
-<row>
- <entry><literal>53200</literal></entry>
- <entry><symbol>out_of_memory</symbol></entry>
-</row>
-
-<row>
- <entry><literal>53300</literal></entry>
- <entry><symbol>too_many_connections</symbol></entry>
-</row>
-
-<row>
- <entry><literal>53400</literal></entry>
- <entry><symbol>configuration_limit_exceeded</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 54 — Program Limit Exceeded</></entry>
-</row>
-
-<row>
- <entry><literal>54000</literal></entry>
- <entry><symbol>program_limit_exceeded</symbol></entry>
-</row>
-
-<row>
- <entry><literal>54001</literal></entry>
- <entry><symbol>statement_too_complex</symbol></entry>
-</row>
-
-<row>
- <entry><literal>54011</literal></entry>
- <entry><symbol>too_many_columns</symbol></entry>
-</row>
-
-<row>
- <entry><literal>54023</literal></entry>
- <entry><symbol>too_many_arguments</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 55 — Object Not In Prerequisite State</></entry>
-</row>
-
-<row>
- <entry><literal>55000</literal></entry>
- <entry><symbol>object_not_in_prerequisite_state</symbol></entry>
-</row>
-
-<row>
- <entry><literal>55006</literal></entry>
- <entry><symbol>object_in_use</symbol></entry>
-</row>
-
-<row>
- <entry><literal>55P02</literal></entry>
- <entry><symbol>cant_change_runtime_param</symbol></entry>
-</row>
-
-<row>
- <entry><literal>55P03</literal></entry>
- <entry><symbol>lock_not_available</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 57 — Operator Intervention</></entry>
-</row>
-
-<row>
- <entry><literal>57000</literal></entry>
- <entry><symbol>operator_intervention</symbol></entry>
-</row>
-
-<row>
- <entry><literal>57014</literal></entry>
- <entry><symbol>query_canceled</symbol></entry>
-</row>
-
-<row>
- <entry><literal>57P01</literal></entry>
- <entry><symbol>admin_shutdown</symbol></entry>
-</row>
-
-<row>
- <entry><literal>57P02</literal></entry>
- <entry><symbol>crash_shutdown</symbol></entry>
-</row>
-
-<row>
- <entry><literal>57P03</literal></entry>
- <entry><symbol>cannot_connect_now</symbol></entry>
-</row>
-
-<row>
- <entry><literal>57P04</literal></entry>
- <entry><symbol>database_dropped</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class 58 — System Error (errors external to <productname>PostgreSQL</> itself)</></entry>
-</row>
-
-<row>
- <entry><literal>58000</literal></entry>
- <entry><symbol>system_error</symbol></entry>
-</row>
-
-<row>
- <entry><literal>58030</literal></entry>
- <entry><symbol>io_error</symbol></entry>
-</row>
-
-<row>
- <entry><literal>58P01</literal></entry>
- <entry><symbol>undefined_file</symbol></entry>
-</row>
-
-<row>
- <entry><literal>58P02</literal></entry>
- <entry><symbol>duplicate_file</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class F0 — Configuration File Error</></entry>
-</row>
-
-<row>
- <entry><literal>F0000</literal></entry>
- <entry><symbol>config_file_error</symbol></entry>
-</row>
-
-<row>
- <entry><literal>F0001</literal></entry>
- <entry><symbol>lock_file_exists</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class HV — Foreign Data Wrapper Error (SQL/MED)</></entry>
-</row>
-
-<row>
- <entry><literal>HV000</literal></entry>
- <entry><symbol>fdw_error</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV005</literal></entry>
- <entry><symbol>fdw_column_name_not_found</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV002</literal></entry>
- <entry><symbol>fdw_dynamic_parameter_value_needed</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV010</literal></entry>
- <entry><symbol>fdw_function_sequence_error</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV021</literal></entry>
- <entry><symbol>fdw_inconsistent_descriptor_information</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV024</literal></entry>
- <entry><symbol>fdw_invalid_attribute_value</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV007</literal></entry>
- <entry><symbol>fdw_invalid_column_name</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV008</literal></entry>
- <entry><symbol>fdw_invalid_column_number</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV004</literal></entry>
- <entry><symbol>fdw_invalid_data_type</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV006</literal></entry>
- <entry><symbol>fdw_invalid_data_type_descriptors</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV091</literal></entry>
- <entry><symbol>fdw_invalid_descriptor_field_identifier</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV00B</literal></entry>
- <entry><symbol>fdw_invalid_handle</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV00C</literal></entry>
- <entry><symbol>fdw_invalid_option_index</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV00D</literal></entry>
- <entry><symbol>fdw_invalid_option_name</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV090</literal></entry>
- <entry><symbol>fdw_invalid_string_length_or_buffer_length</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV00A</literal></entry>
- <entry><symbol>fdw_invalid_string_format</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV009</literal></entry>
- <entry><symbol>fdw_invalid_use_of_null_pointer</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV014</literal></entry>
- <entry><symbol>fdw_too_many_handles</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV001</literal></entry>
- <entry><symbol>fdw_out_of_memory</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV00P</literal></entry>
- <entry><symbol>fdw_no_schemas</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV00J</literal></entry>
- <entry><symbol>fdw_option_name_not_found</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV00K</literal></entry>
- <entry><symbol>fdw_reply_handle</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV00Q</literal></entry>
- <entry><symbol>fdw_schema_not_found</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV00R</literal></entry>
- <entry><symbol>fdw_table_not_found</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV00L</literal></entry>
- <entry><symbol>fdw_unable_to_create_execution</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV00M</literal></entry>
- <entry><symbol>fdw_unable_to_create_reply</symbol></entry>
-</row>
-
-<row>
- <entry><literal>HV00N</literal></entry>
- <entry><symbol>fdw_unable_to_establish_connection</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class P0 — PL/pgSQL Error</></entry>
-</row>
-
-<row>
- <entry><literal>P0000</literal></entry>
- <entry><symbol>plpgsql_error</symbol></entry>
-</row>
-
-<row>
- <entry><literal>P0001</literal></entry>
- <entry><symbol>raise_exception</symbol></entry>
-</row>
-
-<row>
- <entry><literal>P0002</literal></entry>
- <entry><symbol>no_data_found</symbol></entry>
-</row>
-
-<row>
- <entry><literal>P0003</literal></entry>
- <entry><symbol>too_many_rows</symbol></entry>
-</row>
-
-
-<row>
- <entry spanname="span12"><emphasis role="bold">Class XX — Internal Error</></entry>
-</row>
-
-<row>
- <entry><literal>XX000</literal></entry>
- <entry><symbol>internal_error</symbol></entry>
-</row>
-
-<row>
- <entry><literal>XX001</literal></entry>
- <entry><symbol>data_corrupted</symbol></entry>
-</row>
-
-<row>
- <entry><literal>XX002</literal></entry>
- <entry><symbol>index_corrupted</symbol></entry>
-</row>
+++ /dev/null
-<!-- doc/src/sgml/example-AWS.sgml -->
-
-<sect1 id="example-AWS">
- <title>AWS Configuration Example</title>
-
- <para>
- This tutorial explains the simple way to try "Watchdog"
- on <ulink url="https://aws.amazon.com/">AWS</ulink> and using
- the <ulink url="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html">
- Elastic IP Address</ulink> as the Virtual IP for the high availability solution.
- <note>
- <para>
- You can use watchdog with <productname>
- Pgpool-II</productname> in any mode: replication mode,
- native replication mode and raw mode.
- </para>
- </note>
- </para>
-
- <sect2 id="example-AWS-setup">
- <title>AWS Setup</title>
- <para>
- For this example, we will use two node <productname>
- Pgpool-II</productname> watchdog cluster. So we will set up two
- Linux Amazon EC2 instances and one Elastic IP address.
- So for this example, do the following steps:
- </para>
-
- <itemizedlist>
-
- <listitem>
- <para>
- Launch two Linux Amazon EC2 instances. For this example, we name these
- instances as "instance-1" and "instance-2"
- </para>
- </listitem>
-
- <listitem>
- <para>
- Configure the security group for the instances and allow inbound traffic
- on ports used by pgpool-II and watchdog.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Install the <productname>Pgpool-II</productname> on both instances.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Allocate an Elastic IP address.
- For this example, we will use "35.163.178.3" as an Elastic IP address"
- </para>
- </listitem>
-
- </itemizedlist>
-
- </sect2>
-
- <sect2 id="example-AWS-pgpool-config">
- <title><productname>Pgpool-II</productname> configurations</title>
- <para>
- Mostly the <productname>Pgpool-II</productname> configurations for this
- example will be same as in the <xref linkend="example-cluster">, except the
- <xref linkend="guc-delegate-ip"> which we will not set in this example instead
- we will use <xref linkend="guc-wd-escalation-command"> and
- <xref linkend="guc-wd-de-escalation-command"> to switch the
- Elastic IP address to the leader/Active <productname>Pgpool-II</productname> node.
- </para>
- <programlisting>
-use_watchdog = on
-delegate_IP = ''
-...
-wd_escalation_command = '$path_to_script/aws-escalation.sh'
-wd_de_escalation_command = '$path_to_script/aws-de-escalation.sh'
- </programlisting>
- </sect2>
-
- <sect2 id="example-AWS-pgpool-aws-escalation-instance">
- <title>escalation and de-escalation Scripts</title>
- <para>
- Create the aws-escalation.sh and aws-de-escalation.sh scripts on both
- instances and point the <xref linkend="guc-wd-escalation-command"> and
- <xref linkend="guc-wd-de-escalation-command"> to the respective scripts.
- </para>
-
- <note>
- <para>
- You may need to configure the AWS CLI first on all AWS instances
- to enable the execution of commands used by wd-escalation.sh and wd-de-escalation.sh.
- See <ulink url="http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html">configure AWS CLI</ulink>
- </para>
- </note>
-
- <sect3 id="example-AWS-pgpool-aws-escalation-script">
- <title>escalation script</title>
-
- <para>
- This script will be executed by the watchdog
- to assign the Elastic IP on the instance when the watchdog becomes the active/leader node.
- Change the INSTANCE_ID and ELASTIC_IP values as per your AWS setup values.
- </para>
- <para>
- <emphasis>aws-escalation.sh:</emphasis>
- <programlisting>
- #! /bin/sh
-
- ELASTIC_IP=35.163.178.3
- # replace it with the Elastic IP address you
- # allocated from the aws console
- INSTANCE_ID=i-0a9b64e449b17ed4b
- # replace it with the instance id of the Instance
- # this script is installed on
-
- echo "Assigning Elastic IP $ELASTIC_IP to the instance $INSTANCE_ID"
- # bring up the Elastic IP
- aws ec2 associate-address --instance-id $INSTANCE_ID --public-ip $ELASTIC_IP
-
- exit 0
- </programlisting>
-
- </para>
- </sect3>
-
- <sect3 id="example-AWS-pgpool-aws-de-escalation-script">
- <title>de-escalation script</title>
-
- <para>
- This script will be executed by watchdog
- to remove the Elastic IP from the instance when the watchdog resign from the active/leader node.
- </para>
- <para>
- <emphasis>aws-de-escalation.sh:</emphasis>
- <programlisting>
- #! /bin/sh
-
- ELASTIC_IP=35.163.178.3
- # replace it with the Elastic IP address you
- # allocated from the aws console
-
- echo "disassociating the Elastic IP $ELASTIC_IP from the instance"
- # bring down the Elastic IP
- aws ec2 disassociate-address --public-ip $ELASTIC_IP
- exit 0
- </programlisting>
- </para>
- </sect3>
-
- <bibliography>
- <title>AWS Command References</title>
-
- <biblioentry>
- <biblioset relation="article">
- <title><ulink url="http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html">Configure AWS CLI</ulink></title>
- </biblioset>
- <biblioset relation="book">
- <title>AWS Documentation: Configuring the AWS Command Line Interface</title>
- </biblioset>
- </biblioentry>
-
- <biblioentry>
- <biblioset relation="article">
- <title><ulink url="http://docs.aws.amazon.com/cli/latest/reference/ec2/associate-address.html">associate-address</ulink></title>
- </biblioset>
- <biblioset relation="book">
- <title>AWS Documentation: associate-address reference</title>
- </biblioset>
- </biblioentry>
-
- <biblioentry>
- <biblioset relation="article">
- <title><ulink url="http://docs.aws.amazon.com/cli/latest/reference/ec2/disassociate-address.html">disassociate-address</ulink></title>
- </biblioset>
- <biblioset relation="book">
- <title>AWS Documentation: disassociate-address reference</title>
- </biblioset>
- </biblioentry>
-
- </bibliography>
- </sect2>
-
- <sect2 id="example-AWS-try">
- <title>Try it out</title>
- <para>
- Start <productname>Pgpool-II</productname> on each server with "-n" switch
- and redirect log messages to the pgpool.log file.
- The log message of leader/active <productname>Pgpool-II</productname> node
- will show the message of Elastic IP assignment.
- <programlisting>
- LOG: I am the cluster leader node. Starting escalation process
- LOG: escalation process started with PID:23543
- LOG: watchdog: escalation started
- <emphasis>
- Assigning Elastic IP 35.163.178.3 to the instance i-0a9b64e449b17ed4b
- {
- "AssociationId": "eipassoc-39853c42"
- }
- </emphasis>
- LOG: watchdog escalation successful
- LOG: watchdog escalation process with pid: 23543 exit with SUCCESS.
- </programlisting>
- </para>
-
- <para>
- Confirm to ping to the Elastic IP address.
- <programlisting>
- [user@someserver]$ ping 35.163.178.3
- PING 35.163.178.3 (35.163.178.3) 56(84) bytes of data.
- 64 bytes from 35.163.178.3: icmp_seq=1 ttl=64 time=0.328 ms
- 64 bytes from 35.163.178.3: icmp_seq=2 ttl=64 time=0.264 ms
- 64 bytes from 35.163.178.3: icmp_seq=3 ttl=64 time=0.412 ms
- </programlisting>
- </para>
-
- <para>
- Try to connect <productname>PostgreSQL</productname> by "psql -h ELASTIC_IP -p port".
- <programlisting>
- [user@someserver]$ psql -h 35.163.178.3 -p 9999 -l
- </programlisting>
- </para>
- </sect2>
-
- <sect2 id="example-AWS-vip-switch">
- <title>Switching Elastic IP</title>
- <para>
- To confirm if the Standby server acquires the Elastic IP when the
- Active server becomes unavailable, Stop the <productname>Pgpool-II</productname>
- on the Active server. Then, the Standby server should start using the Elastic IP address,
- And the <productname>Pgpool-II</productname> log will show the below messages.
-
- <programlisting>
- <emphasis>
- LOG: remote node "172.31.2.94:9999 [Linux ip-172-31-2-94]" is shutting down
- LOG: watchdog cluster has lost the coordinator node
- </emphasis>
- LOG: watchdog node state changed from [STANDBY] to [JOINING]
- LOG: watchdog node state changed from [JOINING] to [INITIALIZING]
- LOG: I am the only alive node in the watchdog cluster
- HINT: skipping stand for coordinator state
- LOG: watchdog node state changed from [INITIALIZING] to [LEADER]
- LOG: I am announcing my self as leader/coordinator watchdog node
- LOG: I am the cluster leader node
- DETAIL: our declare coordinator message is accepted by all nodes
- LOG: I am the cluster leader node. Starting escalation process
- LOG: escalation process started with PID:23543
- LOG: watchdog: escalation started
- <emphasis>
- Assigning Elastic IP 35.163.178.3 to the instance i-0dd3e60734a6ebe14
- {
- "AssociationId": "eipassoc-39853c42"
- }
- </emphasis>
- LOG: watchdog escalation successful
- LOG: watchdog escalation process with pid: 61581 exit with SUCCESS.
- </programlisting>
-
- Confirm to ping to the Elastic IP address again.
-
- <programlisting>
- [user@someserver]$ ping 35.163.178.3
- PING 35.163.178.3 (35.163.178.3) 56(84) bytes of data.
- 64 bytes from 35.163.178.3: icmp_seq=1 ttl=64 time=0.328 ms
- 64 bytes from 35.163.178.3: icmp_seq=2 ttl=64 time=0.264 ms
- 64 bytes from 35.163.178.3: icmp_seq=3 ttl=64 time=0.412 ms
- </programlisting>
- </para>
- <para>
- Try to connect <productname>PostgreSQL</productname> by "psql -h ELASTIC_IP -p port".
- <programlisting>
- [user@someserver]$ psql -h 35.163.178.3 -p 9999 -l
- </programlisting>
- </para>
- </sect2>
-</sect1>
+++ /dev/null
-<sect1 id="example-Aurora">
- <title>Aurora Configuration Example</title>
-
- <para>
- <productname>Amazon Aurora for PostgreSQL
- Compatibility</productname> (Aurora) is a managed service for
- <productname>PostgreSQL</productname>. From user's point of
- view, <productname>Aurora</productname> can be regarded as a
- streaming replication cluster with some exceptions. First,
- fail over and online recovery are managed
- by <productname>Aurora</productname>. So you don't need to
- set <xref linkend="guc-failover-command">, <xref linkend="guc-follow-primary-command">,
- and recovery related parameters. In this section we explain
- how to set up <productname>Pgpool-II</productname> for Aurora.
- </para>
-
- <sect2 id="example-Aurora-config">
- <title>Setting pgpool.conf for Aurora</title>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- Create <filename>pgpool.conf</filename>
- from <filename>pgpool.conf.sample-stream</filename>.
- </para>
- </listitem>
- <listitem>
- <para>
- Set <xref linkend="guc-sr-check-period"> to 0 to
- disable streaming replication delay checking. This
- is because <productname>Aurora</productname> does
- not provide necessary functions to check the
- replication delay.
- </para>
- <programlisting>
-sr_check_period = 0
- </programlisting>
- </listitem>
- <listitem>
- <para>
- Enable <xref linkend="guc-enable-pool-hba"> to on so
- that md5 authentication is enabled
- (<productname>Aurora</productname> always use md5
- authentication).
- </para>
- <programlisting>
-enable_pool_hba = on
- </programlisting>
- </listitem>
- <listitem>
- <para>
- Create <filename>pool_password</filename>. See <xref linkend="auth-md5">
- for more details.
- </para>
- </listitem>
- <listitem>
- <para>
- Set <xref linkend="guc-backend-hostname">0 for the Aurora cluster endpoint.
- Set <xref linkend="guc-backend-hostname">1 for the Aurora reader endpoint.
- Set appropriate <xref linkend="guc-backend-weight"> as usual.
- You don't need to set <xref linkend="guc-backend-data-directory">.
- </para>
- <programlisting>
-backend_hostname0 = 'cluster endpoint'
-backend_hostname1 = 'reader endpoint'
- </programlisting>
- </listitem>
- <listitem>
- <para>
- Set <varname>ALWAYS_PRIMARY</varname> flag to
- the <xref linkend="guc-backend-flag">
- for <xref linkend="guc-backend-hostname">0.
- </para>
- </listitem>
- <listitem>
- <para>
- Because failover is managed by Aurora, set <varname>DISALLOW_TO_FAILOVER</varname> flag to
- the <xref linkend="guc-backend-flag">
- for <xref linkend="guc-backend-hostname">0 and <xref linkend="guc-backend-hostname">1.
- </para>
- <programlisting>
-backend_flag0 = 'ALWAYS_MASTER|DISALLOW_TO_FAILOVER'
-backend_flag1 = 'DISALLOW_TO_FAILOVER'
- </programlisting>
- </listitem>
- <listitem>
- <para>
- Set <xref linkend="guc-health-check-period"> to 0 to disable health checking.
- </para>
- <programlisting>
-health_check_period = 0
- </programlisting>
- </listitem>
- <listitem>
- <para>
- Disable <xref linkend="guc-failover-on-backend-error">
- to avoid failover when connecting to the backend or
- detecting errors on backend side while executing
- queries for the same reasons above.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </sect2>
-</sect1>
+++ /dev/null
-<sect1 id="example-Kubernetes">
- <title><productname>Pgpool-II</productname> on Kubernetes</title>
- <para>
- This section explains how to run <productname>Pgpool-II</productname> to achieve
- read query load balancing and connection pooling on Kubernetes.
- </para>
- <sect2 id="example-Kubernetes-intro">
- <title>Introduction</title>
- <para>
- Because <productname>PostgreSQL</productname> is a stateful application and managing
- <productname>PostgreSQL</productname> has very specific requirements (e.g. backup,
- recovery, automatic failover, etc), the built-in functionality of <productname>Kubernetes</productname>
- can't handle these tasks. Therefore, an Operator that extends the functionality of the Kubernetes to create
- and manage PostgreSQL is required.
- </para>
- <para>
- There are several PostgreSQL operators, such as
- <ulink url="https://github.com/CrunchyData/postgres-operator">Crunchy PostgreSQL Operator</ulink>,
- <ulink url="https://github.com/zalando/postgres-operator">Zalando PostgreSQL Operator</ulink> and
- <ulink url="https://github.com/kubedb/operator">KubeDB</ulink>.
- However, these operators don't provide query load balancing functionality.
- </para>
- <para>
- This section explains how to combine PostgreSQL Operator with Pgpool-II to deploy a PostgreSQL cluster
- with query load balancing and connection pooling capability on Kubernetes. Pgpool-II can be combined with
- any of the PostgreSQL operators mentioned above.
- </para>
- </sect2>
-
- <sect2 id="example-Kubernetes-architecture">
- <title>Architecture</title>
- <para>
- <figure>
- <title>Architecture</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="pgpool_on_k8s.gif">
- </imageobject>
- </mediaobject>
- </figure>
- </para>
- </sect2>
-
- <sect2 id="example-Kubernetes-pre-setup">
- <title>Prerequisites</title>
- <para>
- Before you start the configuration process, please check the following prerequisites.
- <itemizedlist>
- <listitem>
- <para>
- Make sure you have a <productname>Kubernetes</productname> cluster, and <command>kubectl</command> is installed.
- </para>
- </listitem>
- <listitem>
- <para>
- PostgreSQL Operator and a PostgreSQL cluster are installed.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </sect2>
-
- <sect2 id="example-Kubernetes-deploy-pgpool">
- <title>Deploy Pgpool-II</title>
- <para>
- Deploy Pgpool-II pod that contains a Pgpool-II container and a
- <ulink url="https://github.com/pgpool/pgpool2_exporter">Pgpool-II Exporter</ulink> container.
- </para>
- <programlisting>
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: pgpool
-spec:
- replicas: 1
- selector:
- matchLabels:
- app: pgpool
- template:
- metadata:
- labels:
- app: pgpool
- spec:
- containers:
- - name: pgpool
- image: pgpool/pgpool:4.2
- ...
- - name: pgpool-stats
- image: pgpool/pgpool2_exporter:1.0
- ...
- </programlisting>
- <para>
- <productname>Pgpool-II</productname>'s health check, automatic failover, Watchdog and online recovery features
- aren't required on <productname>Kubernetes</productname>. You need to only enable load balancing and connection
- pooling.
- </para>
- <para>
- The Pgpool-II pod should work with the minimal configuration below:
- </para>
- <programlisting>
-backend_hostname0='primary service name'
-backend_hostname1='replica service name'
-backend_port0='5432'
-backend_port1='5432'
-backend_flag0='ALWAYS_PRIMARY|DISALLOW_TO_FAILOVER'
-backend_flag1='DISALLOW_TO_FAILOVER'
-
-sr_check_period = 10
-sr_check_user='PostgreSQL user name'
-
-load_balance_mode = on
-connection_cache = on
-listen_addresses = '*'
- </programlisting>
- <para>
- There are two ways you can configure Pgpool-II.
- <orderedlist>
- <listitem>
- <para>
- Using environment variables
- </para>
- </listitem>
- <listitem>
- <para>
- Using a <ulink url="https://kubernetes.io/docs/concepts/configuration/configmap/">ConfigMap</ulink>
- </para>
- </listitem>
- </orderedlist>
- </para>
- <para>
- You may need to configure client authentication and more parameters in a production environment.
- In a production environment, we recommend using a ConfigMap to configure Pgpool-II's
- config files, i.e. pgpool.conf, pcp.conf, pool_passwd and pool_hba.conf.
- </para>
- <para>
- The following sections explain how to configure and deploy Pgpool-II pod using environment
- variables and ConfigMap respectively. You can download the various manifest files used for
- deploying Pgpool-II from <ulink url="https://github.com/pgpool/pgpool2_on_k8s">here</ulink>.
- </para>
-
- <sect3 id="example-Kubernetes-configure-pgpool-env">
- <title>Configure Pgpool-II using environment variables</title>
- <para>
- Kubernetes environment variables can be passed to a container in a pod.
- You can define environment variables in the deployment manifest to configure Pgpool-II's parameters.
- <filename>pgpool_deploy.yaml</filename> is an example of a Deployment manifest.
- You can download <filename>pgpool_deploy.yaml</filename> and specify environment variables in this manifest file.
- </para>
- <programlisting>
-$ curl -LO https://raw.githubusercontent.com/pgpool/pgpool2_on_k8s/master/pgpool_deploy.yaml
- </programlisting>
- <para>
- Environment variables starting with <literal>PGPOOL_PARAMS_</literal> can be converted to Pgpool-II's configuration
- parameters and these values can override the default configurations.
- </para>
- <itemizedlist>
- <listitem>
- <para>
- The Pgpool-II container Docker images is build with streaming replication mode.
- By default, load balancing, connection pooling and streaming replication check is enabled.
- </para>
- </listitem>
- <listitem>
- <para>
- Specify <emphasis>only two backend nodes</emphasis>.
- Specify the Primary Service name to <xref linkend="GUC-BACKEND-HOSTNAME">0.
- Specify the Replica Service name to <xref linkend="GUC-BACKEND-HOSTNAME">1.
- Because failover is managed by <productname>Kubernetes</productname>,
- specify <literal>DISALLOW_TO_FAILOVER</literal> flag to <xref linkend="GUC-BACKEND-FLAG">
- for both of the two nodes and <literal>ALWAYS_PRIMARY</literal> flag to <xref linkend="GUC-BACKEND-FLAG">0.
- Configure appropriate <xref linkend="GUC-BACKEND-WEIGHT"> as usual.
- You don't need to specify <xref linkend="GUC-BACKEND-DATA-DIRECTORY">.
- </para>
- <para>
- For example, the following environment variables defined in manifest,
- </para>
- <programlisting>
-env:
-- name: PGPOOL_PARAMS_BACKEND_HOSTNAME0
- value: "hippo"
-- name: PGPOOL_PARAMS_BACKEND_HOSTNAME1
- value: "hippo-replica"
-- name: PGPOOL_PARAMS_BACKEND_FLAG0
- value: "ALWAYS_PRIMARY|DISALLOW_TO_FAILOVER"
-- name: PGPOOL_PARAMS_BACKEND_FLAG1
- value: "DISALLOW_TO_FAILOVER"
- </programlisting>
- <para>
- will be convert to the following configuration parameters in pgpool.conf.
- </para>
- <programlisting>
-backend_hostname0='hippo'
-backend_hostname1='hippo-replica'
-backend_flag0='ALWAYS_PRIMARY|DISALLOW_TO_FAILOVER'
-backend_flag1='DISALLOW_TO_FAILOVER'
- </programlisting>
- </listitem>
- <listitem>
- <para>
- Specify a PostgreSQL user name and password to perform streaming replication check.
- For the security reasons, we recommend that you specify a encrypted password.
- </para>
- <programlisting>
-- name: PGPOOL_PARAMS_SR_CHECK_USER
- value: "PostgreSQL user name"
-- name: PGPOOL_PARAMS_SR_CHECK_PASSWORD
- value: "encrypted PostgreSQL user's password"
- </programlisting>
- <para>
- Alternatively, you can create a secret and use this secret as environment variables.
- </para>
- </listitem>
- <listitem>
- <para>
- Since health check is performed by <productname>Kubernetes</productname>, Pgpool-II's health check should be disabled.
- Because the default value is off, we don't need to set this parameter.
- </para>
- </listitem>
-
- <listitem>
- <para>
- By default, the following environment variables will be set when Pgpool-II container is started.
- </para>
- <programlisting>
-export PGPOOL_PARAMS_LISTEN_ADDRESSES=*
-export PGPOOL_PARAMS_SR_CHECK_USER=${POSTGRES_USER:-"postgres"}
-export PGPOOL_PARAMS_SOCKET_DIR=/var/run/postgresql
-export PGPOOL_PARAMS_PCP_SOCKET_DIR=/var/run/postgresql
- </programlisting>
- </listitem>
- </itemizedlist>
- </sect3>
- <sect3 id="example-Kubernetes-configure-pgpool-configmap">
- <title>Configure Pgpool-II using ConfigMap</title>
- <para>
- Alternatively, you can use a Kubernetes <literal>ConfigMap</literal> to store entire configuration files,
- i.e. pgpool.conf, pcp.conf, pool_passwd and pool_hba.conf.
- The <literal>ConfigMap</literal> can be mounted to Pgpool-II's container as a volume.
- </para>
- <para>
- You can download the example manifest files that define the <literal>ConfigMap</literal> and <literal>Deployment</literal>
- from <ulink url="https://github.com/pgpool/pgpool2_on_k8s">repository</ulink>.
- </para>
- <programlisting>
-curl -LO https://raw.githubusercontent.com/pgpool/pgpool2_on_k8s/master/pgpool_configmap.yaml
-curl -LO https://raw.githubusercontent.com/pgpool/pgpool2_on_k8s/master/pgpool_deploy_with_mount_configmap.yaml
- </programlisting>
- <para>
- The manifest that defines the <literal>ConfigMap</literal> is in the following format. You can update it based
- on your configuration preferences.
- </para>
- <programlisting>
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: pgpool-config
- labels:
- app: pgpool-config
-data:
- pgpool.conf: |-
- listen_addresses = '*'
- port = 9999
- socket_dir = '/var/run/postgresql'
- pcp_listen_addresses = '*'
- pcp_port = 9898
- pcp_socket_dir = '/var/run/postgresql'
- backend_hostname0 = 'hippo'
- backend_port0 = 5432
- backend_weight0 = 1
- backend_flag0 = 'ALWAYS_PRIMARY|DISALLOW_TO_FAILOVER'
- backend_hostname1 = 'hippo-replica'
- backend_port1 = 5432
- backend_weight1 = 1
- backend_flag1 = 'DISALLOW_TO_FAILOVER'
- sr_check_user = 'postgres'
- sr_check_period = 10
- enable_pool_hba = on
- master_slave_mode = on
- num_init_children = 32
- max_pool = 4
- child_life_time = 300
- child_max_connections = 0
- connection_life_time = 0
- client_idle_limit = 0
- connection_cache = on
- load_balance_mode = on
- pcp.conf: |-
- postgres:e8a48653851e28c69d0506508fb27fc5
- pool_passwd: |-
- postgres:md53175bce1d3201d16594cebf9d7eb3f9d
- pool_hba.conf: |-
- local all all trust
- host all all 127.0.0.1/32 trust
- host all all ::1/128 trust
- host all all 0.0.0.0/0 md5
- </programlisting>
- <para>
- First, you need to create the <literal>ConfigMap</literal> before referencing it to <productname>Pgpool-II</productname> pod.
- </para>
- <programlisting>
-kubectl apply -f pgpool_configmap.yaml
- </programlisting>
- <para>
- Once you have created the <literal>ConfigMap</literal>, you can deploy <productname>Pgpool-II</productname> pod and
- mount the <literal>ConfigMap</literal> to Pgpool-II pod as a volume.
- </para>
- <programlisting>
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: pgpool
- ...
- volumeMounts:
- - name: pgpool-config
- mountPath: /usr/local/pgpool-II/etc
- ...
- volumes:
- - name: pgpool-config
- configMap:
- name: pgpool-config
- </programlisting>
- <para>
- <filename>pgpool_deploy_with_mount_configmap.yaml</filename> is an example of a Deployment manifest that mounts the
- created <literal>ConfigMap</literal> to the <productname>Pgpool-II</productname> pod.
- </para>
- <programlisting>
-kubectl apply -f pgpool_deploy_with_mount_configmap.yaml
- </programlisting>
- <para>
- After deploying Pgpool-II, you can see the Pgpool-II pod and services using <command>kubectl get pod</command>
- and <command>kubectl get svc</command> command.
- </para>
- </sect3>
- </sect2>
-</sect1>
+++ /dev/null
-<!-- doc/src/sgml/example-basic.sgml -->
-<sect1 id="example-basic">
- <title>Basic Configuration Example</title>
-
- <sect2 id="example-configs-begin">
- <title>Let's Begin!</title>
- <para>
- First, we must learn how to install and configure <productname>Pgpool-II</productname> and database nodes before using replication.
- </para>
-
- <sect3 id="example-configs-begin-installing">
- <title>Installing <productname>Pgpool-II</productname></title>
- <para>
- Installing <productname>Pgpool-II</productname> is very easy.
- In the directory which you have extracted the source tar ball,
- execute the following commands.
- <programlisting>
- $ ./configure
- $ make
- $ make install
- </programlisting>
- <command>configure</command> script collects your system information
- and use it for the compilation procedure. You can pass command
- line arguments to <command>configure</command> script to change the default behavior,
- such as the installation directory. <productname>Pgpool-II</productname>
- will be installed to <literal>/usr/local</literal> directory by default.
- </para>
- <para>
- <command>make</command> command compiles the source code, and
- <command>make install</command> will install the executables.
- You must have write permission on the installation directory.
- In this tutorial, we will install <productname>Pgpool-II
- </productname> in the default <literal>/usr/local</literal> directory.
- </para>
- <note>
- <para>
- <productname>Pgpool-II</productname> requires <literal>libpq</literal>
- library in <productname>PostgreSQL</productname> 7.4 or later (version 3 protocol).
- </para>
- </note>
- <para>
- If the <command>configure</command> script displays the following error message, the
- <literal>libpq</literal> library may not be installed, or it is not of version 3
- <programlisting>
- configure: error: libpq is not installed or libpq is old
- </programlisting>
- If the library is version 3, but the above message is still displayed, your
- <literal>libpq</literal> library is probably not recognized by the <command>
- configure</command> script.
- The <command>configure</command> script searches for <literal>libpq</literal>
- library under <literal>/usr/local/pgsql</literal>. If you have installed the
- <productname>PostgreSQL</productname> in a directory other than <literal>/usr/local/pgsql</literal>, use
- <literal>--with-pgsql</literal>, or <literal>--with-pgsql-includedir</literal>
- and <literal>--with-pgsql-libdir</literal> command line options when you
- execute <command>configure</command>.
- </para>
- </sect3>
-
- <sect3 id="example-configs-begin-config-files">
- <title>Configuration Files</title>
- <para>
- <productname>Pgpool-II</productname> configuration parameters are saved in the
- <literal>pgpool.conf</literal> file. The file is in <literal>"parameter = value"
- </literal> per line format. When you install <productname>Pgpool-II</productname>,
- <literal>pgpool.conf.sample</literal> is automatically created.
- We recommend copying and renaming it to <literal>pgpool.conf</literal>, and edit
- it as you like.
- <programlisting>
- $ cp /usr/local/etc/pgpool.conf.sample /usr/local/etc/pgpool.conf
- </programlisting>
- <productname>Pgpool-II</productname> only accepts connections from the localhost
- using port 9999 by the default. If you wish to receive connections from other hosts,
- set <xref linkend="guc-listen-addresses"> to <literal>'*'</literal>.
- <programlisting>
- listen_addresses = 'localhost'
- port = 9999
- </programlisting>
- We will use the default parameters in this tutorial.
- </para>
- </sect3>
-
- <sect3 id="example-configs-begin-config-pcp">
- <title>Configuring <acronym>PCP</acronym> Commands</title>
- <para>
- <productname>Pgpool-II</productname> has an interface for administrative
- purpose to retrieve information on database nodes, shutdown
- <productname>Pgpool-II</productname>, etc. via network. To use
- <acronym>PCP</acronym> commands, user authentication is required.
- This authentication is different from <productname>PostgreSQL</productname>'s user authentication.
- A user name and password need to be defined in the <literal>pcp.conf</literal>
- file. In the file, a user name and password are listed as a pair on each line,
- and they are separated by a colon (:). Passwords are encrypted in
- <literal>md5</literal> hash format.
-
- <programlisting>
- postgres:e8a48653851e28c69d0506508fb27fc5
- </programlisting>
-
- When you install <productname>Pgpool-II</productname>, <literal>pcp.conf.sample
- </literal> is automatically created. We recommend copying and renaming it
- to <literal>pcp.conf</literal>, and edit it.
- <programlisting>
- $ cp /usr/local/etc/pcp.conf.sample /usr/local/etc/pcp.conf
- </programlisting>
- To encrypt your password into md5 hash format, use the <command>pg_md5</command>
- command, which is installed as one of <productname>Pgpool-II</productname>'s
- executables. <command>pg_md5</command> takes text as a command line argument,
- and displays its md5-hashed text.
- For example, give <literal>"postgres"</literal> as the command line argument,
- and <command>pg_md5</command> displays md5-hashed text on its standard output.
- <programlisting>
- $ /usr/local/bin/pg_md5 postgres
- e8a48653851e28c69d0506508fb27fc5
- </programlisting>
- PCP commands are executed via network, so the port number must be configured
- with <xref linkend="guc-pcp-port"> parameter in <literal>pgpool.conf</literal> file.
- We will use the default 9898 for <xref linkend="guc-pcp-port"> in this tutorial.
- <programlisting>
- pcp_port = 9898
- </programlisting>
- </para>
- </sect3>
-
- <sect3 id="example-configs-prep-db-nodes">
- <title>Preparing Database Nodes</title>
- <para>
- Now, we need to set up backend <productname>PostgreSQL</productname> servers for <productname>Pgpool-II
- </productname>. These servers can be placed within the same host as
- <productname>Pgpool-II</productname>, or on separate machines. If you decide
- to place the servers on the same host, different port numbers must be assigned
- for each server. If the servers are placed on separate machines,
- they must be configured properly so that they can accept network
- connections from <productname>Pgpool-II</productname>.
-
- <programlisting>
- backend_hostname0 = 'localhost'
- backend_port0 = 5432
- backend_weight0 = 1
- backend_hostname1 = 'localhost'
- backend_port1 = 5433
- backend_weight1 = 1
- backend_hostname2 = 'localhost'
- backend_port2 = 5434
- backend_weight2 = 1
- </programlisting>
-
- For <xref linkend="guc-backend-hostname">, <xref linkend="guc-backend-port">,
- <xref linkend="guc-backend-weight">, set the node's hostname, port number,
- and ratio for load balancing. At the end of each parameter string,
- node ID must be specified by adding positive integers starting with 0 (i.e. 0, 1, 2..).
- </para>
- <note>
- <para>
- <xref linkend="guc-backend-weight"> parameters for all nodes are
- set to 1, meaning that SELECT queries are equally distributed among
- three servers.
- </para>
- </note>
- </sect3>
-
- <sect3 id="example-configs-start-stop-pgpool">
- <title>Starting/Stopping <productname>Pgpool-II</productname></title>
- <para>
- To fire up <productname>Pgpool-II</productname>, execute the following
- command on a terminal.
-
- <programlisting>
- $ pgpool
- </programlisting>
-
- The above command, however, prints no log messages because <productname>
- Pgpool-II</productname> detaches the terminal. If you want to show
- <productname>Pgpool-II</productname> log messages, you pass <literal>-n</literal>
- option to <command>pgpool</command> command so <productname>Pgpool-II</productname>
- is executed as non-daemon process, and the terminal will not be detached.
- <programlisting>
- $ pgpool -n &
- </programlisting>
-
- The log messages are printed on the terminal, so it is recommended to use the following options.
- <programlisting>
- $ pgpool -n -d > /tmp/pgpool.log 2>&1 &
- </programlisting>
-
- The <literal>-d</literal> option enables debug messages to be generated.
- The above command keeps appending log messages to <literal>/tmp/pgpool.log
- </literal>. If you need to rotate log files, pass the logs to a external
- command which has log rotation function.
- For example, you can use <ulink url="https://httpd.apache.org/docs/2.4/programs/rotatelogs.html">
- <command>rotatelogs</command></ulink> from Apache2:
- <programlisting>
- $ pgpool -n 2>&1 | /usr/local/apache2/bin/rotatelogs \
- -l -f /var/log/pgpool/pgpool.log.%A 86400 &
- </programlisting>
-
- This will generate a log file named <literal>"pgpool.log.Thursday"</literal>
- then rotate it 00:00 at midnight. Rotatelogs adds logs to a file if it already
- exists. To delete old log files before rotation, you could use cron:
- <programlisting>
- 55 23 * * * /usr/bin/find /var/log/pgpool -type f -mtime +5 -exec /bin/rm -f '{}' \;
- </programlisting>
-
- Please note that rotatelogs may exist as <literal>/usr/sbin/rotatelogs2</literal>
- in some distributions. <literal>-f</literal> option generates a log file as soon as
- <command>rotatelogs</command> starts and is available in apache2 2.2.9 or greater.
- Also <ulink url="http://www.cronolog.org/">cronolog</ulink> can be used.
- <programlisting>
- $ pgpool -n 2>&1 | /usr/sbin/cronolog \
- --hardlink=/var/log/pgsql/pgpool.log \
- '/var/log/pgsql/%Y-%m-%d-pgpool.log' &
- </programlisting>
-
- To stop <productname>Pgpool-II</productname> execute the following command.
- <programlisting>
- $ pgpool stop
- </programlisting>
-
- If any client is still connected, <productname>Pgpool-II</productname>
- waits for it to disconnect, and then terminates itself. Run the following
- command instead if you want to shutdown <productname>Pgpool-II</productname>
- forcibly.
- <programlisting>
- $ pgpool -m fast stop
- </programlisting>
-
- </para>
- </sect3>
- </sect2>
-
- <sect2 id="example-configs-replication">
- <title>Your First Replication</title>
- <para>
- Replication (see <xref linkend="guc-replication-mode">) enables
- the same data to be copied to multiple database nodes.
- In this section, we'll use three database nodes, which we have already set
- up in <xref linkend="example-configs-begin">, and takes you step by step to
- create a database replication system.
- Sample data to be replicated will be generated by the
- <ulink url="https://www.postgresql.org/docs/current/static/pgbench.html">
- <command>pgbench</command></ulink> benchmark program.
- </para>
-
- <sect3 id="example-configs-config-replication">
- <title>Configuring Replication</title>
- <para>
- To enable the database replication function, set
- <xref linkend="guc-replication-mode"> to on in <literal>pgpool.conf</literal> file.
- <programlisting>
- replication_mode = true
- </programlisting>
- When <xref linkend="guc-replication-mode"> is on, <productname>Pgpool-II</productname>
- will send a copy of a received query to all the database nodes.
- In addition, when <xref linkend="guc-load-balance-mode"> is set to true,
- <productname>Pgpool-II</productname> will distribute <acronym>SELECT</acronym> queries
- among the database nodes.
- <programlisting>
- load_balance_mode = true
- </programlisting>
- In this section, we will enable both <xref linkend="guc-replication-mode">
- and <xref linkend="guc-load-balance-mode">.
- </para>
- </sect3>
-
- <sect3 id="example-configs-checking-replication">
- <title>Checking Replication</title>
- <para>
- To reflect the above changes in <literal>pgpool.conf</literal>,
- <productname>Pgpool-II</productname> must be restarted.
- Please refer to "Starting/Stopping <productname>Pgpool-II</productname>"
- <xref linkend="example-configs-start-stop-pgpool">.
- After configuring <literal>pgpool.conf</literal> and restarting the
- <productname>Pgpool-II</productname>, let's try the actual replication
- and see if everything is working.
- First, we need to create a database to be replicated. We will name it
- <literal>"bench_replication"</literal>. This database needs to be created
- on all the nodes. Use the
- <ulink url="https://www.postgresql.org/docs/current/static/app-createdb.html">
- <command>createdb</command></ulink> commands through
- <productname>Pgpool-II</productname>, and the database will be created
- on all the nodes.
- <programlisting>
- $ createdb -p 9999 bench_replication
- </programlisting>
- Then, we'll execute <ulink url="https://www.postgresql.org/docs/current/static/pgbench.html">
- <command>pgbench</command></ulink> with <literal>-i</literal> option.
- <literal>-i</literal> option initializes the database with pre-defined tables and data.
- <programlisting>
- $ pgbench -i -p 9999 bench_replication
- </programlisting>
- The following table is the summary of tables and data, which will be created by
- <ulink url="https://www.postgresql.org/docs/current/static/pgbench.html">
- <command>pgbench -i</command></ulink>. If, on all the nodes, the listed tables and
- data are created, replication is working correctly.
- </para>
-
- <table id="example-configs-checking-replication-table">
- <title>data summary</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Table Name</entry>
- <entry>Number of Rows</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>pgbench_branches</entry>
- <entry>1</entry>
- </row>
-
- <row>
- <entry>pgbench_tellers</entry>
- <entry>10</entry>
- </row>
-
- <row>
- <entry>pgbench_accounts</entry>
- <entry>100000</entry>
- </row>
-
- <row>
- <entry>pgbench_history</entry>
- <entry>0</entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
-
- <para>
- Let's use a simple shell script to check the above on all the nodes.
- The following script will display the number of rows in pgbench_branches,
- pgbench_tellers, pgbench_accounts, and pgbench_history tables on all the nodes (5432, 5433, 5434).
- <programlisting>
- $ for port in 5432 5433 5434; do
- > echo $port
- > for table_name in pgbench_branches pgbench_tellers pgbench_accounts pgbench_history; do
- > echo $table_name
- > psql -c "SELECT count(*) FROM $table_name" -p $port bench_replication
- > done
- > done
- </programlisting>
-
- </para>
- </sect3>
- </sect2>
-
-</sect1>
+++ /dev/null
-<sect1 id="example-cluster">
- <title><productname>Pgpool-II</productname> + Watchdog Setup Example</title>
- <para>
- This section shows an example of streaming replication configuration using
- <productname>Pgpool-II</productname>. In this example, we use 3
- <productname>Pgpool-II</productname> servers to manage <productname>PostgreSQL</productname>
- servers to create a robust cluster system and avoid the single point of failure or split brain.
- </para>
- <para>
- <productname>PostgreSQL</productname> 13 is used in this configuration example.
- All scripts have been tested with <productname>PostgreSQL</productname> 95 and later.
- </para>
- <sect2 id="example-cluster-requirement">
- <title>Requirements</title>
- <para>
- We assume that all the Pgpool-II servers and the <productname>PostgreSQL</productname> servers are in the same subnet.
- </para>
- </sect2>
-
- <sect2 id="example-cluster-structure">
- <title>Cluster System Configuration</title>
- <para>
- We use 3 servers with CentOS 7.4. Let these servers be <literal>server1</literal>,
- <literal>server2</literal>, <literal>server3</literal>.
- We install <productname>PostgreSQL</productname> and <productname>Pgpool-II</productname> on each server.
- </para>
- <para>
- <figure>
- <title>Cluster System Configuration</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="cluster_40.gif">
- </imageobject>
- </mediaobject>
- </figure>
- </para>
- <note>
- <para>
- The roles of <literal>Active</literal>, <literal>Standby</literal>, <literal>Primary</literal>,
- <literal>Standby</literal> are not fixed and may be changed by further operations.
- </para>
- </note>
- <table id="example-cluster-table-ip">
- <title>Hostname and IP address</title>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Hostname</entry>
- <entry>IP Address</entry>
- <entry>Virtual IP</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>server1</entry>
- <entry>192.168.137.101</entry>
- <entry morerows="2">192.168.137.150</entry>
- </row>
- <row>
- <entry>server2</entry>
- <entry>192.168.137.102</entry>
- </row>
- <row>
- <entry>server3</entry>
- <entry>192.168.137.103</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <table id="example-cluster-table-postgresql-config">
- <title>PostgreSQL version and Configuration</title>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Item</entry>
- <entry>Value</entry>
- <entry>Detail</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>PostgreSQL Version</entry>
- <entry>13.0</entry>
- <entry>-</entry>
- </row>
- <row>
- <entry>port</entry>
- <entry>5432</entry>
- <entry>-</entry>
- </row>
- <row>
- <entry>$PGDATA</entry>
- <entry>/var/lib/pgsql/13/data</entry>
- <entry>-</entry>
- </row>
- <row>
- <entry>Archive mode</entry>
- <entry>on</entry>
- <entry>/var/lib/pgsql/archivedir</entry>
- </row>
- <row>
- <entry>Replication Slots</entry>
- <entry>Enable</entry>
- <entry>-</entry>
- </row>
- <row>
- <entry>Start automatically</entry>
- <entry>Enable</entry>
- <entry>-</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <table id="example-cluster-table-pgpool-config">
- <title>Pgpool-II version and Configuration</title>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Item</entry>
- <entry>Value</entry>
- <entry>Detail</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>Pgpool-II Version</entry>
- <entry>4.2.0</entry>
- <entry>-</entry>
- </row>
- <row>
- <entry morerows='3'>port</entry>
- <entry>9999</entry>
- <entry>Pgpool-II accepts connections</entry>
- </row>
- <row>
- <entry>9898</entry>
- <entry>PCP process accepts connections</entry>
- </row>
- <row>
- <entry>9000</entry>
- <entry>watchdog accepts connections</entry>
- </row>
- <row>
- <entry>9694</entry>
- <entry>UDP port for receiving Watchdog's heartbeat signal</entry>
- </row>
- <row>
- <entry>Config file</entry>
- <entry>/etc/pgpool-II/pgpool.conf</entry>
- <entry>Pgpool-II config file</entry>
- </row>
- <row>
- <entry>Pgpool-II start user</entry>
- <entry>postgres (Pgpool-II 4.1 or later)</entry>
- <entry>Pgpool-II 4.0 or before, the default startup user is root</entry>
- </row>
- <row>
- <entry>Running mode</entry>
- <entry>streaming replication mode</entry>
- <entry>-</entry>
- </row>
- <row>
- <entry>Watchdog</entry>
- <entry>on</entry>
- <entry>Life check method: heartbeat</entry>
- </row>
- <row>
- <entry>Start automatically</entry>
- <entry>Enable</entry>
- <entry>-</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <table id="example-cluster-table-sample-scripts">
- <title>Various sample scripts included in rpm package</title>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Feature</entry>
- <entry>Script</entry>
- <entry>Detail</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry morerows='1'>Failover</entry>
- <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/failover.sh.sample;hb=refs/heads/master">/etc/pgpool-II/failover.sh.sample</ulink></entry>
- <entry>Run by <xref linkend="GUC-FAILOVER-COMMAND"> to perform failover</entry>
- </row>
- <row>
- <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/follow_primary.sh.sample;hb=refs/heads/master">/etc/pgpool-II/follow_primary.sh.sample</ulink></entry>
- <entry>Run by <xref linkend="GUC-FOLLOW-PRIMARY-COMMAND"> to synchronize the Standby with the new Primary after failover.</entry>
- </row>
- <row>
- <entry morerows='1'>Online recovery</entry>
- <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/recovery_1st_stage.sample;hb=refs/heads/master">/etc/pgpool-II/recovery_1st_stage.sample</ulink></entry>
- <entry>Run by <xref linkend="GUC-RECOVERY-1ST-STAGE-COMMAND"> to recovery a Standby node</entry>
- </row>
- <row>
- <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/pgpool_remote_start.sample;hb=refs/heads/master">/etc/pgpool-II/pgpool_remote_start.sample</ulink></entry>
- <entry>Run after <xref linkend="GUC-RECOVERY-1ST-STAGE-COMMAND"> to start the Standby node</entry>
- </row>
- <row>
- <entry morerows='1'>Watchdog</entry>
- <entry><ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/escalation.sh.sample;hb=refs/heads/master">/etc/pgpool-II/escalation.sh.sample</ulink></entry>
- <entry>Run by <xref linkend="guc-wd-escalation-command"> to switch the Active/Standby Pgpool-II safely</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <para>
- The above scripts are included in the RPM package and can be customized as needed.
- </para>
- </sect2>
-
- <sect2 id="example-cluster-installation">
- <title>Installation</title>
- <para>
- In this example, we install <productname>Pgpool-II</productname> 4.2 and <productname>PostgreSQL</productname> 13.0 using RPM packages.
- </para>
-
- <para>
- Install <productname>PostgreSQL</productname> using <productname>PostgreSQL</productname> YUM repository.
- </para>
- <programlisting>
-# yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
-# yum install -y postgresql13-server
- </programlisting>
- <para>
- Install <productname>Pgpool-II</productname> by using Pgpool-II YUM repository.
- </para>
- <programlisting>
-# yum install -y http://www.pgpool.net/yum/rpms/4.1/redhat/rhel-7-x86_64/pgpool-II-release-4.1-2.noarch.rpm
-# yum install -y pgpool-II-pg13-*
- </programlisting>
- </sect2>
-
- <sect2 id="example-cluster-pre-setup">
- <title>Before Starting</title>
- <para>
- Before you start the configuration process, please check the following prerequisites.
- </para>
-
- <itemizedlist>
- <listitem>
- <para>
- Set up <productname>PostgreSQL</productname> streaming replication on the primary server.
- In this example, we use WAL archiving.
- </para>
- <para>
- First, we create the directory <filename>/var/lib/pgsql/archivedir</filename> to store
- <acronym>WAL</acronym> segments on all servers. In this example, only Primary node archives
- <acronym>WAL</acronym> locally.
- </para>
- <programlisting>
-[all servers]# su - postgres
-[all servers]$ mkdir /var/lib/pgsql/archivedir
- </programlisting>
-
- <para>
- Then we edit the configuration file <filename>$PGDATA/postgresql.conf</filename>
- on <literal>server1</literal> (primary) as follows. Enable <literal>wal_log_hints</literal>
- to use <literal>pg_rewind</literal>.
- Since the Primary may become a Standby later, we set <varname>hot_standby = on</varname>.
- </para>
- <programlisting>
-listen_addresses = '*'
-archive_mode = on
-archive_command = 'cp "%p" "/var/lib/pgsql/archivedir/%f"'
-max_wal_senders = 10
-max_replication_slots = 10
-wal_level = replica
-hot_standby = on
-wal_log_hints = on
- </programlisting>
- <para>
- We use the online recovery functionality of <productname>Pgpool-II</productname> to setup standby server after the primary server is started.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Because of the security reasons, we create a user <literal>repl</literal> solely used
- for replication purpose, and a user <literal>pgpool</literal> for streaming
- replication delay check and health check of <productname>Pgpool-II</productname>.
- </para>
-
- <table id="example-cluster-user">
- <title>Users</title>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>User Name</entry>
- <entry>Password</entry>
- <entry>Detail</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>repl</entry>
- <entry>repl</entry>
- <entry>PostgreSQL replication user</entry>
- </row>
- <row>
- <entry>pgpool</entry>
- <entry>pgpool</entry>
- <entry>Pgpool-II health check (<xref linkend="GUC-HEALTH-CHECK-USER">) and replication delay check (<xref linkend="GUC-SR-CHECK-USER">) user</entry>
- </row>
- <row>
- <entry>postgres</entry>
- <entry>postgres</entry>
- <entry>User running online recovery</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <programlisting>
-[server1]# psql -U postgres -p 5432
-postgres=# SET password_encryption = 'scram-sha-256';
-postgres=# CREATE ROLE pgpool WITH LOGIN;
-postgres=# CREATE ROLE repl WITH REPLICATION LOGIN;
-postgres=# \password pgpool
-postgres=# \password repl
-postgres=# \password postgres
- </programlisting>
-
- <para>
- If you want to show "replication_state" and "replication_sync_state" column in
- <xref linkend="SQL-SHOW-POOL-NODES"> command result, role <literal>pgpool</literal>
- needs to be PostgreSQL super user or or in <literal>pg_monitor</literal> group
- (<productname>Pgpool-II</productname> 4.1 or later). Grant <literal>pg_monitor</literal>
- to <literal>pgpool</literal>:
- </para>
- <programlisting>
-GRANT pg_monitor TO pgpool;
- </programlisting>
- <note>
- <para>
- If you plan to use <xref linkend="guc-detach-false-primary">(<productname>Pgpool-II</productname> 4.0 or later),
- role "pgpool" needs to be <productname>PostgreSQL</productname> super user or
- or in "pg_monitor" group to use this feature.
- </para>
- </note>
- <para>
- Assuming that all the <productname>Pgpool-II</productname> servers and the
- <productname>PostgreSQL</productname> servers are in the same subnet and edit <filename>pg_hba.conf</filename> to
- enable <literal>scram-sha-256</literal> authentication method.
- </para>
- <programlisting>
-host all all samenet scram-sha-256
-host replication all samenet scram-sha-256
- </programlisting>
- </listitem>
-
- <listitem>
- <para>
- To use the automated failover and online recovery of <productname>Pgpool-II</productname>,
- the settings that allow <emphasis>passwordless</emphasis> SSH to all backend servers
- between <productname>Pgpool-II</productname> execution user (default root user)
- and <literal>postgres</literal> user and between <literal>postgres</literal> user
- and <literal>postgres</literal> user are necessary. Execute the following command on all servers
- to set up passwordless <literal>SSH</literal>. The generated key file name is <literal>id_rsa_pgpool</literal>.
- </para>
- <programlisting>
-[all servers]# cd ~/.ssh
-[all servers]# ssh-keygen -t rsa -f id_rsa_pgpool
-[all servers]# ssh-copy-id -i id_rsa_pgpool.pub postgres@server1
-[all servers]# ssh-copy-id -i id_rsa_pgpool.pub postgres@server2
-[all servers]# ssh-copy-id -i id_rsa_pgpool.pub postgres@server3
-
-[all servers]# su - postgres
-[all servers]$ cd ~/.ssh
-[all servers]$ ssh-keygen -t rsa -f id_rsa_pgpool
-[all servers]$ ssh-copy-id -i id_rsa_pgpool.pub postgres@server1
-[all servers]$ ssh-copy-id -i id_rsa_pgpool.pub postgres@server2
-[all servers]$ ssh-copy-id -i id_rsa_pgpool.pub postgres@server3
- </programlisting>
- <para>
- After setting, use <command>ssh postgres@serverX -i ~/.ssh/id_rsa_pgpool</command> command to
- make sure that you can log in without entering a password. Edit <filename>/etc/ssh/sshd_config</filename>
- if necessary and restart sshd.
- </para>
- </listitem>
-
- <listitem>
- <para>
- To allow <literal>repl</literal> user without specifying password for streaming
- replication and online recovery, and execute <application>pg_rewind</application>
- using <literal>postgres</literal>, we create the <filename>.pgpass</filename> file
- in <literal>postgres</literal> user's home directory and change the permission to
- <literal>600</literal> on each <productname>PostgreSQL</productname> server.
- </para>
- <programlisting>
-[all servers]# su - postgres
-[all servers]$ vi /var/lib/pgsql/.pgpass
-server1:5432:replication:repl:<repl user password>
-server2:5432:replication:repl:<repl user password>
-server3:5432:replication:repl:<repl user password>
-server1:5432:postgres:postgres:<postgres user password>
-server2:5432:postgres:postgres:<postgres user password>
-server3:5432:postgres:postgres:<postgres user password>
-[all servers]$ chmod 600 /var/lib/pgsql/.pgpass
- </programlisting>
- </listitem>
-
- <listitem>
- <para>
- When connect to <productname>Pgpool-II</productname> and <productname>PostgreSQL</productname> servers, the target port must be accessible by enabling firewall management softwares. Following is an example for <systemitem>CentOS/RHEL7</systemitem>.
- </para>
- <programlisting>
-[all servers]# firewall-cmd --permanent --zone=public --add-service=postgresql
-[all servers]# firewall-cmd --permanent --zone=public --add-port=9999/tcp --add-port=9898/tcp --add-port=9000/tcp --add-port=9694/udp
-[all servers]# firewall-cmd --reload
- </programlisting>
- </listitem>
-
- <listitem>
- <para>
- We set <productname>Pgpool-II</productname> to start automatically on all servers.
- </para>
- <programlisting>
-[all servers]# systemctl enable pgpool.service
- </programlisting>
-
- <note>
- <para>
- If you set the auto-start of <productname>Pgpool-II</productname>, you need to change the <xref linkend="guc-search-primary-node-timeout"> to an appropriate value that you can start the <productname>PostgreSQL</productname> after the server has been started.
- <productname>Pgpool-II</productname> will fail if it can't connect to the <productname>PostgreSQL</productname> on the backend during the <literal>search_primary_node_timeout</literal>.
- </para>
- </note>
-
- </listitem>
- </itemizedlist>
- </sect2>
-
- <sect2 id="example-cluster-pgpool-node-id">
- <title>Create pgpool_node_id</title>
- <para>
- From <productname>Pgpool-II</productname> 4.2, now all configuration parameters are identical on all hosts.
- If <literal>watchdog</literal> feature is enabled, to distinguish which host is which,
- a <filename>pgpool_node_id</filename> file is required.
- You need to create a <filename>pgpool_node_id</filename> file and specify the pgpool (watchdog) node number
- (e.g. 0, 1, 2 ...) to identify pgpool (watchdog) host.
- </para>
- <itemizedlist>
- <listitem>
- <para>
- <literal>server1</literal>
- </para>
- <programlisting>
-[server1]# cat /etc/pgpool-II/pgpool_node_id
-0
- </programlisting>
- </listitem>
- <listitem>
- <para>
- <literal>server2</literal>
- </para>
- <programlisting>
-[server2]# cat /etc/pgpool-II/pgpool_node_id
-1
- </programlisting>
- </listitem>
- <listitem>
- <para>
- <literal>server3</literal>
- </para>
- <programlisting>
-[server3]# cat /etc/pgpool-II/pgpool_node_id
-2
- </programlisting>
- </listitem>
- </itemizedlist>
- </sect2>
-
- <sect2 id="example-cluster-pgpool-config">
- <title><productname>Pgpool-II</productname> Configuration</title>
- <para>
- Since from <productname>Pgpool-II</productname> 4.2, all configuration parameters are
- identical on all hosts, you can edit <filename>pgpool.conf</filename> on any pgpool node
- and copy the edited <filename>pgpool.conf</filename> file to the other pgpool nodes.
- </para>
-
- <sect3 id="example-cluster-pgpool-config-config-file">
- <title>Clustering mode</title>
- <para>
- <productname>Pgpool-II</productname> has several clustering modes. To set the clustering
- mode, <xref linkend="GUC-BACKEND-CLUSTERING-MODE"> can be used. In this configuration
- example, streaming replication mode is used.
- </para>
- <para>
- When installing <productname>Pgpool-II</productname> using RPM, all the
- <productname>Pgpool-II</productname> configuration sample files are in <filename>/etc/pgpool-II</filename>.
- In this example, we copy the sample configuration file for streaming replication mode.
- </para>
- <programlisting>
-# cp -p /etc/pgpool-II/pgpool.conf.sample-stream /etc/pgpool-II/pgpool.conf
- </programlisting>
- </sect3>
-
- <sect3 id="example-cluster-pgpool-config-listen-addresses">
- <title>listen_addresses</title>
- <para>
- To allow Pgpool-II to accept all incoming connections, we set <varname>listen_addresses = '*'</varname>.
- </para>
- <programlisting>
-listen_addresses = '*'
- </programlisting>
- </sect3>
-
- <sect3 id="example-cluster-pgpool-config-port">
- <title>port</title>
- <para>
- Specify the port number Pgpool-II listen on.
- </para>
- <programlisting>
-port = 9999
- </programlisting>
- </sect3>
-
- <sect3 id="example-cluster-pgpool-config-sr-check">
- <title>Streaming Replication Check</title>
- <para>
- Specify replication delay check user and password in <xref linkend="GUC-SR-CHECK-USER">
- and <xref linkend="GUC-SR-CHECK-PASSWORD">. In this example, we leave
- <xref linkend="GUC-SR-CHECK-PASSWORD"> empty, and create the entry in
- <xref linkend="GUC-POOL-PASSWD">. See <xref linkend="example-cluster-pgpool-config-auth">
- for how to create the entry in <xref linkend="GUC-POOL-PASSWD">.
- From <productname>Pgpool-II</productname> 4.0, if these parameters are left blank,
- <productname>Pgpool-II</productname> will first try to get the password for that
- specific user from <xref linkend="GUC-POOL-PASSWD"> file before using the empty password.
- </para>
- <programlisting>
-sr_check_user = 'pgpool'
-sr_check_password = ''
- </programlisting>
- </sect3>
-
- <sect3 id="example-cluster-pgpool-config-health-check">
- <title>Health Check</title>
- <para>
- Enable health check so that <productname>Pgpool-II</> performs failover. Also, if the network is unstable,
- the health check fails even though the backend is running properly, failover or degenerate operation may occur.
- In order to prevent such incorrect detection of health check, we set <varname>health_check_max_retries = 3</varname>.
- Specify <xref linkend="GUC-HEALTH-CHECK-USER"> and <xref linkend="GUC-HEALTH-CHECK-PASSWORD"> in
- the same way like <xref linkend="GUC-SR-CHECK-USER"> and <xref linkend="GUC-SR-CHECK-PASSWORD">.
- </para>
- <programlisting>
-health_check_period = 5
- # Health check period
- # Disabled (0) by default
-health_check_timeout = 30
- # Health check timeout
- # 0 means no timeout
-health_check_user = 'pgpool'
-health_check_password = ''
-
-health_check_max_retries = 3
- </programlisting>
- </sect3>
-
- <sect3 id="example-cluster-pgpool-config-backend-settings">
- <title>Backend Settings</title>
- <para>
- Specify the <productname>PostgreSQL</productname> backend information.
- Multiple backends can be specified by adding a number at the end of the parameter name.
- </para>
- <programlisting>
-# - Backend Connection Settings -
-
-backend_hostname0 = 'server1'
- # Host name or IP address to connect to for backend 0
-backend_port0 = 5432
- # Port number for backend 0
-backend_weight0 = 1
- # Weight for backend 0 (only in load balancing mode)
-backend_data_directory0 = '/var/lib/pgsql/13/data'
- # Data directory for backend 0
-backend_flag0 = 'ALLOW_TO_FAILOVER'
- # Controls various backend behavior
- # ALLOW_TO_FAILOVER or DISALLOW_TO_FAILOVER
-backend_hostname1 = 'server2'
-backend_port1 = 5432
-backend_weight1 = 1
-backend_data_directory1 = '/var/lib/pgsql/13/data'
-backend_flag1 = 'ALLOW_TO_FAILOVER'
-
-backend_hostname2 = 'server3'
-backend_port2 = 5432
-backend_weight2 = 1
-backend_data_directory2 = '/var/lib/pgsql/13/data'
-backend_flag2 = 'ALLOW_TO_FAILOVER'
- </programlisting>
- <para>
- To show "replication_state" and "replication_sync_state" column in <xref linkend="SQL-SHOW-POOL-NODES">
- command result, <xref linkend="GUC-BACKEND-APPLICATION-NAME"> parameter is required.
- Here we specify each backend's hostname in these parameters. (<productname>Pgpool-II</productname> 4.1 or later)
- </para>
- <programlisting>
-...
-backend_application_name0 = 'server1'
-...
-backend_application_name1 = 'server2'
-...
-backend_application_name2 = 'server3'
- </programlisting>
- </sect3>
-
- <sect3 id="example-cluster-pgpool-config-failover">
- <title>Failover configuration</title>
- <para>
- Specify failover.sh script to be executed after failover in <varname>failover_command</varname>
- parameter.
- If we use 3 PostgreSQL servers, we need to specify follow_primary_command to run after failover on the primary node failover.
- In case of two PostgreSQL servers, follow_primary_command setting is not necessary.
- </para>
- <para>
- <productname>Pgpool-II</productname> replaces the following special characters with the backend specific
- information while executing the scripts.
- See <xref linkend="GUC-FAILOVER-COMMAND"> for more details about each character.
- </para>
- <programlisting>
-failover_command = '/etc/pgpool-II/failover.sh %d %h %p %D %m %H %M %P %r %R %N %S'
-follow_primary_command = '/etc/pgpool-II/follow_primary.sh %d %h %p %D %m %H %M %P %r %R'
- </programlisting>
- <note>
- <para>
- <emphasis>%N</emphasis> and <emphasis>%S</emphasis> are added in <productname>Pgpool-II</productname> 4.1.
- Please note that these characters cannot be specified if using Pgpool-II 4.0 or earlier.
- </para>
- </note>
- <para>
- Sample scripts <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/failover.sh.sample;hb=refs/heads/master">failover.sh</ulink>
- and <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/follow_primary.sh.sample;hb=refs/heads/master">follow_primary.sh</ulink>
- are installed in <filename>/etc/pgpool-II/</filename>. Create failover scripts using these sample files.
- </para>
- <programlisting>
-[all servers]# cp -p /etc/pgpool-II/failover.sh{.sample,}
-[all servers]# cp -p /etc/pgpool-II/follow_primary.sh{.sample,}
-[all servers]# chown postgres:postgres /etc/pgpool-II/{failover.sh,follow_primary.sh}
- </programlisting>
- <para>
- Basically, it should work if you change <emphasis>PGHOME</emphasis> according to PostgreSQL installation directory.
- </para>
- <programlisting>
-[all servers]# vi /etc/pgpool-II/failover.sh
-...
-PGHOME=/usr/pgsql-13
-...
-
-[all servers]# vi /etc/pgpool-II/follow_primary.sh
-...
-PGHOME=/usr/pgsql-13
-...
- </programlisting>
-
- <para>
- Since user authentication is required to use the <literal>PCP</literal> command in
- <varname>follow_primary_command</varname> script,
- we need to specify user name and md5 encrypted password in <filename>pcp.conf</filename>
- in format "<literal>username:encrypted password</literal>".
- </para>
- <para>
- if <literal>pgpool</literal> user is specified in <varname>PCP_USER</varname> in <filename>follow_primary.sh</filename>,
- </para>
- <programlisting>
-# cat /etc/pgpool-II/follow_primary.sh
-...
-PCP_USER=pgpool
-...
- </programlisting>
- <para>
- then we use <xref linkend="PG-MD5"> to create the encrypted password entry for <literal>pgpool</literal> user as below:
- </para>
- <programlisting>
-[all servers]# echo 'pgpool:'`pg_md5 PCP password` >> /etc/pgpool-II/pcp.conf
- </programlisting>
- <para>
- Since <filename>follow_primary.sh</filename> script must execute PCP command without entering a
- password, we need to create <filename>.pcppass</filename> in the home directory of
- <productname>Pgpool-II</productname> startup user (postgres user) on each server.
- </para>
- <programlisting>
-[all servers]# su - postgres
-[all servers]$ echo 'localhost:9898:pgpool:<pgpool user password>' > ~/.pcppass
-[all servers]$ chmod 600 ~/.pcppass
- </programlisting>
- </sect3>
-
- <sect3 id="example-cluster-pgpool-config-online-recovery">
- <title>Pgpool-II Online Recovery Configurations</title>
- <para>
- Next, in order to perform online recovery with <productname>Pgpool-II</productname> we specify
- the <productname>PostgreSQL</productname> user name and online recovery command
- <command>recovery_1st_stage</command>.
- Because <emphasis>Superuser</emphasis> privilege in <productname>PostgreSQL</productname>
- is required for performing online recovery, we specify <literal>postgres</literal> user in <xref linkend="GUC-RECOVERY-USER">.
- Then, we create <filename>recovery_1st_stage</filename> and <filename>pgpool_remote_start</filename>
- in database cluster directory of <productname>PostgreSQL</productname> primary server (server1), and add execute permission.
-
- </para>
- <programlisting>
-recovery_user = 'postgres'
- # Online recovery user
-recovery_password = ''
- # Online recovery password
-
-recovery_1st_stage_command = 'recovery_1st_stage'
- </programlisting>
- <para>
- Online recovery sample scripts<ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/recovery_1st_stage.sample;hb=refs/heads/master">recovery_1st_stage</ulink>
- and <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/pgpool_remote_start.sample;hb=refs/heads/master">pgpool_remote_start</ulink>
- are installed in <filename>/etc/pgpool-II/</filename>. Copy these files to the data directory of the primary server (server1).
- </para>
- <programlisting>
-[server1]# cp -p /etc/pgpool-II/recovery_1st_stage.sample /var/lib/pgsql/13/data/recovery_1st_stage
-[server1]# cp -p /etc/pgpool-II/pgpool_remote_start.sample /var/lib/pgsql/13/data/pgpool_remote_start
-[server1]# chown postgres:postgres /var/lib/pgsql/13/data/{recovery_1st_stage,pgpool_remote_start}
- </programlisting>
- <para>
- Basically, it should work if you change <emphasis>PGHOME</emphasis> according to PostgreSQL installation directory.
- </para>
- <programlisting>
-[server1]# vi /var/lib/pgsql/13/data/recovery_1st_stage
-...
-PGHOME=/usr/pgsql-13
-...
-
-[server1]# vi /var/lib/pgsql/13/data/pgpool_remote_start
-...
-PGHOME=/usr/pgsql-13
-...
- </programlisting>
-
- <para>
- In order to use the online recovery functionality, the functions of
- <function>pgpool_recovery</function>, <function>pgpool_remote_start</function>,
- <function>pgpool_switch_xlog</function> are required, so we need install
- <function>pgpool_recovery</function> on template1 of <productname>PostgreSQL</productname> server
- <literal>server1</literal>.
- </para>
- <programlisting>
-[server1]# su - postgres
-[server1]$ psql template1 -c "CREATE EXTENSION pgpool_recovery"
- </programlisting>
- </sect3>
-
- <sect3 id="example-cluster-pgpool-config-auth">
- <title>Client Authentication Configuration</title>
- <para>
- Because in the section <link linkend="EXAMPLE-CLUSTER-PRE-SETUP">Before Starting</link>,
- we already set <productname>PostgreSQL</productname> authentication method to
- <acronym>scram-sha-256</acronym>, it is necessary to set a client authentication by
- <productname>Pgpool-II</productname> to connect to backend nodes.
- When installing with RPM, the <productname>Pgpool-II</productname> configuration file
- <filename>pool_hba.conf</filename> is in <filename>/etc/pgpool-II</filename>.
- By default, pool_hba authentication is disabled, set <varname>enable_pool_hba = on</varname>
- to enable it.
- </para>
- <programlisting>
-enable_pool_hba = on
- </programlisting>
- <para>
- The format of <filename>pool_hba.conf</filename> file follows very closely PostgreSQL's
- <filename>pg_hba.conf</filename> format. Set <literal>pgpool</literal> and <literal>postgres</literal> user's authentication method to <literal>scram-sha-256</literal>.
- </para>
- <programlisting>
-host all pgpool 0.0.0.0/0 scram-sha-256
-host all postgres 0.0.0.0/0 scram-sha-256
- </programlisting>
- <note>
- <para>
- Please note that in <productname>Pgpool-II</productname> 4.0 only AES encrypted password or clear text password
- can be specified in <xref linkend="guc-health-check-password">, <xref linkend="guc-sr-check-password">,
- <xref linkend="guc-wd-lifecheck-password">, <xref linkend="guc-recovery-password"> in <filename>pgpool.conf</filename>.
- </para>
- </note>
- <para>
- The default password file name for authentication is <xref linkend="GUC-POOL-PASSWD">.
- To use <literal>scram-sha-256</literal> authentication, the decryption key to decrypt the passwords
- is required. We create the <literal>.pgpoolkey</literal> file in <productname>Pgpool-II</productname>
- start user <literal>postgres</literal>'s (<productname>Pgpool-II</productname> 4.1 or later) home directory.
- (<productname>Pgpool-II</productname> 4.0 or before, by default <productname>Pgpool-II</productname>
- is started as <literal>root</literal>)
- <programlisting>
-[all servers]# su - postgres
-[all servers]$ echo 'some string' > ~/.pgpoolkey
-[all servers]$ chmod 600 ~/.pgpoolkey
- </programlisting>
- </para>
- <para>
- Execute command <command>pg_enc -m -k /path/to/.pgpoolkey -u username -p</command> to register user
- name and <literal>AES</literal> encrypted password in file <filename>pool_passwd</filename>.
- If <filename>pool_passwd</filename> doesn't exist yet, it will be created in the same directory as
- <filename>pgpool.conf</filename>.
- </para>
- <programlisting>
-[all servers]# su - postgres
-[all servers]$ pg_enc -m -k ~/.pgpoolkey -u pgpool -p
-db password: [pgpool user's password]
-[all servers]$ pg_enc -m -k ~/.pgpoolkey -u postgres -p
-db password: [postgres user's password]
-
-# cat /etc/pgpool-II/pool_passwd
-pgpool:AESheq2ZMZjynddMWk5sKP/Rw==
-postgres:AESHs/pWL5rtXy2IwuzroHfqg==
- </programlisting>
- </sect3>
-
- <sect3 id="example-cluster-pgpool-config-watchdog">
- <title>Watchdog Configuration</title>
- <para>
- Enable watchdog functionality on <literal>server1</literal>, <literal>server2</literal>, <literal>server3</literal>.
- </para>
- <programlisting>
-use_watchdog = on
- </programlisting>
- <para>
- Specify virtual IP address that accepts connections from clients on
- <literal>server1</literal>, <literal>server2</literal>, <literal>server3</literal>.
- Ensure that the IP address set to virtual IP isn't used yet.
- </para>
- <programlisting>
-delegate_IP = '192.168.137.150'
- </programlisting>
-
- <para>
- To bring up/down the virtual IP and send the ARP requests, we set <xref linkend="GUC-IF-UP-CMD">, <xref linkend="GUC-IF-DOWN-CMD"> and <xref linkend="GUC-ARPING-CMD">.
- The network interface used in this example is "enp0s8".
- Since root privilege is required to execute <varname>if_up/down_cmd</varname> or
- <varname>arping_cmd</varname> command, use setuid on these command or allow
- <productname>Pgpool-II</productname> startup user, <literal>postgres</literal> user (Pgpool-II 4.1 or later) to run <command>sudo</command> command without a password.
- </para>
- <note>
- <para>
- If <productname>Pgpool-II</productname> is installed using RPM, the <literal>postgres</literal>
- user has been configured to run <command>ip/arping</command> via <command>sudo</command> without
- a password.
- <programlisting>
-postgres ALL=NOPASSWD: /sbin/ip
-postgres ALL=NOPASSWD: /usr/sbin/arping
- </programlisting>
- </para>
- </note>
- <para>
- Here we configure the following parameters to run <varname>if_up/down_cmd</varname> or <varname>arping_cmd</varname> with sudo.
- </para>
- <programlisting>
-if_up_cmd = '/usr/bin/sudo /sbin/ip addr add $_IP_$/24 dev enp0s8 label enp0s8:0'
-if_down_cmd = '/usr/bin/sudo /sbin/ip addr del $_IP_$/24 dev enp0s8'
-arping_cmd = '/usr/bin/sudo /usr/sbin/arping -U $_IP_$ -w 1 -I enp0s8'
- </programlisting>
- <note>
- <para>
- If "Defaults requiretty" is set in the <filename>/etc/sudoers</filename>,
- please ensure that the <productname>pgpool</productname> startup user can execute the <command>if_up_cmd</command>, <command>if_down_cmd</command> and <command>arping_cmd</command> command without a tty.
- </para>
- </note>
- <para>
- Set <xref linkend="GUC-IF-CMD-PATH"> and <xref linkend="GUC-ARPING-PATH"> according to the
- command path.
- If <varname>if_up/down_cmd</varname> or <varname>arping_cmd</varname> starts with "/", these parameters will be ignored.
- </para>
- <programlisting>
-if_cmd_path = '/sbin'
-arping_path = '/usr/sbin'
- </programlisting>
- <para>
- Specify all <productname>Pgpool-II</productname> nodes information for configuring watchdog.
- Specify <varname>pgpool_portX</varname> using the port number specified in <varname>port</varname> in
- <xref linkend="example-cluster-pgpool-config-port">.
- </para>
- <programlisting>
-hostname0 = 'server1'
- # Host name or IP address of pgpool node
- # for watchdog connection
- # (change requires restart)
-wd_port0 = 9000
- # Port number for watchdog service
- # (change requires restart)
-pgpool_port0 = 9999
- # Port number for pgpool
- # (change requires restart)
-
-hostname1 = 'server2'
-wd_port1 = 9000
-pgpool_port1 = 9999
-
-hostname2 = 'server3'
-wd_port2 = 9000
-pgpool_port2 = 9999
- </programlisting>
- <para>
- Specify the method of lifecheck <xref linkend="guc-wd-lifecheck-method">
- and the lifecheck interval <xref linkend="guc-wd-interval">.
- Here, we use <literal>heartbeat</literal> method to perform watchdog lifecheck.
- </para>
- <programlisting>
-wd_lifecheck_method = 'heartbeat'
- # Method of watchdog lifecheck ('heartbeat' or 'query' or 'external')
- # (change requires restart)
-wd_interval = 10
- # lifecheck interval (sec) > 0
- # (change requires restart)
- </programlisting>
- <para>
- Specify all <productname>Pgpool-II</productname> nodes information for sending and receiving heartbeat signal.
- </para>
- <programlisting>
-heartbeat_hostname0 = 'server1'
- # Host name or IP address used
- # for sending heartbeat signal.
- # (change requires restart)
-heartbeat_port0 = 9694
- # Port number used for receiving/sending heartbeat signal
- # Usually this is the same as heartbeat_portX.
- # (change requires restart)
-heartbeat_device0 = ''
- # Name of NIC device (such like 'eth0')
- # used for sending/receiving heartbeat
- # signal to/from destination 0.
- # This works only when this is not empty
- # and pgpool has root privilege.
- # (change requires restart)
-
-heartbeat_hostname1 = 'server2'
-heartbeat_port1 = 9694
-heartbeat_device1 = ''
-heartbeat_hostname2 = 'server3'
-heartbeat_port2 = 9694
-heartbeat_device2 = ''
- </programlisting>
- <para>
- If the <xref linkend="guc-wd-lifecheck-method"> is set to <literal>heartbeat</literal>,
- specify the time to detect a fault <xref linkend="guc-wd-heartbeat-deadtime"> and
- the interval to send heartbeat signals <xref linkend="guc-wd-heartbeat-deadtime">.
- </para>
- <programlisting>
-wd_heartbeat_keepalive = 2
- # Interval time of sending heartbeat signal (sec)
- # (change requires restart)
-wd_heartbeat_deadtime = 30
- # Deadtime interval for heartbeat signal (sec)
- # (change requires restart)
- </programlisting>
-
- <para>
- When <literal>Watchdog</literal> process is abnormally terminated, the virtual IP may be "up" on both of the old and new active pgpool nodes.
- To prevent this, configure <xref linkend="guc-wd-escalation-command"> to bring down the virtual IP on other pgpool nodes before bringing up the virtual IP on the new active pgpool node.
- </para>
- <programlisting>
-wd_escalation_command = '/etc/pgpool-II/escalation.sh'
- # Executes this command at escalation on new active pgpool.
- # (change requires restart)
- </programlisting>
- <para>
- The sample script <ulink url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/escalation.sh.sample;hb=refs/heads/master">escalation.sh</ulink> is installed in <filename>/etc/pgpool-II/</filename>.
- </para>
- <programlisting>
-[all servers]# cp -p /etc/pgpool-II/escalation.sh{.sample,}
-[all servers]# chown postgres:postgres /etc/pgpool-II/escalation.sh
- </programlisting>
-
- <para>
- Basically, it should work if you change the following variables according to your environment.
- PGPOOL is tha array of the hostname that running Pgpool-II.
- VIP is the virtual IP address that you set as delegate_IP.
- DEVICE is the network interface for the virtual IP.
- </para>
- <programlisting>
-[all servers]# vi /etc/pgpool-II/escalation.sh
-...
-PGPOOLS=(server1 server2 server3)
-VIP=192.168.137.150
-DEVICE=enp0s8
-...
- </programlisting>
-
- <note>
- <para>
- If you have even number of watchdog nodes, you need to turn on <xref linkend="guc-enable-consensus-with-half-votes"> parameter.
- </para>
- </note>
- <note>
- <para>
- If use_watchdog = on, please make sure the pgpool node number is specified
- in <filename>pgpool_node_id</filename> file.
- See <xref linkend="example-cluster-pgpool-node-id"> for details.
- </para>
- </note>
- </sect3>
-
- <sect3 id="example-cluster-pgpool-config-log">
- <title>Logging</title>
- <para>
- Since Pgpool-II 4.2, the logging collector process has been implemented.
- In the example, we enable logging collector.
- </para>
- <programlisting>
-log_destination = 'stderr'
-logging_collector = on
-log_directory = '/var/log/pgpool_log'
-log_filename = 'pgpool-%Y-%m-%d_%H%M%S.log'
-log_truncate_on_rotation = on
-log_rotation_age = 1d
-log_rotation_size = 10MB
- </programlisting>
- <para>
- Create the log directory on all servers.
- </para>
- <programlisting>
-[all servers]# mkdir /var/log/pgpool_log/
-[all servers]# chown postgres:postgres /var/log/pgpool_log/
- </programlisting>
-
- <para>
- The configuration of <filename>pgpool.conf</filename> on server1 is completed. Copy the <filename>pgpool.conf</filename>
- to other <productname>Pgpool-II</productname> nodes (server2 and server3).
- </para>
- <programlisting>
-[server1]# scp -p /etc/pgpool-II/pgpool.conf root@server2:/etc/pgpool-II/pgpool.conf
-[server1]# scp -p /etc/pgpool-II/pgpool.conf root@server3:/etc/pgpool-II/pgpool.conf
- </programlisting>
- </sect3>
- </sect2>
-
- <sect2 id="example-cluster-pgpool-config-sysconfig">
- <title>/etc/sysconfig/pgpool Configuration</title>
- <para>
- When starting <productname>Pgpool-II</productname>, if the <filename>pgpool_status</filename>
- file exists, <productname>Pgpool-II</productname> will read the backend status (up/down) from the
- <filename>pgpool_status</filename> file.
- </para>
- <para>
- If you want to ignore the <filename>pgpool_status</filename> file at startup of
- <productname>Pgpool-II</productname>, add "- D" to the start option OPTS to
- <filename>/etc/sysconfig/pgpool</filename>.
- </para>
- <programlisting>
-[all servers]# vi /etc/sysconfig/pgpool
-...
-OPTS=" -D -n"
- </programlisting>
- </sect2>
-
- <sect2 id="example-cluster-start-stop">
- <title>Starting/Stopping Pgpool-II</title>
- <para>
- Next we start <productname>Pgpool-II</productname>. Before starting
- <productname>Pgpool-II</productname>, please start
- <productname>PostgreSQL</productname> servers first.
- Also, when stopping <productname>PostgreSQL</productname>, it is necessary to
- stop Pgpool-II first.
- </para>
- <itemizedlist>
- <listitem>
- <para>
- Starting <productname>Pgpool-II</productname>
- </para>
- <para>
- In section <link linkend="EXAMPLE-CLUSTER-PRE-SETUP">Before Starting</link>,
- we already set the auto-start of <productname>Pgpool-II</productname>. To start
- <productname>Pgpool-II</productname>, restart the whole system or execute the following command.
- </para>
- <programlisting>
-# systemctl start pgpool.service
- </programlisting>
- </listitem>
- <listitem>
- <para>
- Stopping <productname>Pgpool-II</productname>
- </para>
- <programlisting>
-# systemctl stop pgpool.service
- </programlisting>
- </listitem>
- </itemizedlist>
- </sect2>
-
- <sect2 id="example-cluster-try">
- <title>How to use</title>
- <para>
- Let's start to use <productname>Pgpool-II</productname>.
- First, let's start <productname>Pgpool-II</productname> on <literal>server1</literal>,
- <literal>server2</literal>, <literal>server3</literal> by using the following command.
- </para>
- <programlisting>
-# systemctl start pgpool.service
- </programlisting>
-
- <sect3 id="example-cluster-try-standby">
- <title>Set up PostgreSQL standby server</title>
- <para>
- First, we should set up <productname>PostgreSQL</productname> standby server by
- using <productname>Pgpool-II</productname> online recovery functionality. Ensure
- that <filename>recovery_1st_stage</filename> and <filename>pgpool_remote_start</filename>
- scripts used by <command>pcp_recovery_node</command> command are in database
- cluster directory of <productname>PostgreSQL</productname> primary server (<literal>server1</literal>).
- </para>
- <programlisting>
-# pcp_recovery_node -h 192.168.137.150 -p 9898 -U pgpool -n 1
-Password:
-pcp_recovery_node -- Command Successful
-
-# pcp_recovery_node -h 192.168.137.150 -p 9898 -U pgpool -n 2
-Password:
-pcp_recovery_node -- Command Successful
- </programlisting>
- <para>
- After executing <command>pcp_recovery_node</command> command,
- verify that <literal>server2</literal> and <literal>server3</literal>
- are started as <productname>PostgreSQL</productname> standby server.
- </para>
- <programlisting>
-# psql -h 192.168.137.150 -p 9999 -U pgpool postgres -c "show pool_nodes"
-Password for user pgpool
-node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay | replication_state | replication_sync_state | last_status_change
----------+----------+------+--------+-----------+---------+------------+-------------------+-------------------+-------------------+------------------------+---------------------
-0 | server1 | 5432 | up | 0.333333 | primary | 0 | false | 0 | | | 2019-08-06 11:13:17
-1 | server2 | 5432 | up | 0.333333 | standby | 0 | true | 0 | streaming | async | 2019-08-06 11:13:25
-2 | server3 | 5432 | up | 0.333333 | standby | 0 | false | 0 | streaming | async | 2019-08-06 11:14:20
-(3 rows)
- </programlisting>
- </sect3>
-
- <sect3 id="example-cluster-try-watchdog">
- <title>Switching active/standby watchdog</title>
- <para>
- Confirm the watchdog status by using <command>pcp_watchdog_info</command>. The <command>Pgpool-II</command> server which is started first run as <literal>LEADER</literal>.
- </para>
- <programlisting>
-# pcp_watchdog_info -h 192.168.137.150 -p 9898 -U pgpool
-Password:
-3 YES server1:9999 Linux server1 server1
-
-server1:9999 Linux server1 server1 9999 9000 4 LEADER #The Pgpool-II server started first became "LEADER".
-server2:9999 Linux server2 server2 9999 9000 7 STANDBY #run as standby
-server3:9999 Linux server3 server3 9999 9000 7 STANDBY #run as standby
- </programlisting>
- <para>
- Stop active server <literal>server1</literal>, then <literal>server2</literal> or
- <literal>server3</literal> will be promoted to active server. To stop
- <literal>server1</literal>, we can stop <productname>Pgpool-II</productname>
- service or shutdown the whole system. Here, we stop <productname>Pgpool-II</productname> service.
- </para>
- <programlisting>
-[server1]# systemctl stop pgpool.service
-
-# pcp_watchdog_info -p 9898 -h 192.168.137.150 -U pgpool
-Password:
-3 YES server2:9999 Linux server2 server2
-
-server2:9999 Linux server2 server2 9999 9000 4 LEADER #server2 is promoted to LEADER
-server1:9999 Linux server1 server1 9999 9000 10 SHUTDOWN #server1 is stopped
-server3:9999 Linux server3 server3 9999 9000 7 STANDBY #server3 runs as STANDBY
- </programlisting>
- <para>
- Start <productname>Pgpool-II</productname> (<literal>server1</literal>) which we have stopped again,
- and verify that <literal>server1</literal> runs as a standby.
- </para>
- <programlisting>
-[server1]# systemctl start pgpool.service
-
-[server1]# pcp_watchdog_info -p 9898 -h 192.168.137.150 -U pgpool
-Password:
-3 YES server2:9999 Linux server2 server2
-
-server2:9999 Linux server2 server2 9999 9000 4 LEADER
-server1:9999 Linux server1 server1 9999 9000 7 STANDBY
-server3:9999 Linux server3 server3 9999 9000 7 STANDBY
- </programlisting>
- </sect3>
-
- <sect3 id="example-cluster-try-failover">
- <title>Failover</title>
- <para>
- First, use <command>psql</command> to connect to <productname>PostgreSQL</productname> via virtual IP,
- and verify the backend information.
- </para>
- <programlisting>
-# psql -h 192.168.137.150 -p 9999 -U pgpool postgres -c "show pool_nodes"
-Password for user pgpool:
-node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay | replication_state | replication_sync_state | last_status_change
----------+----------+------+--------+-----------+---------+------------+-------------------+-------------------+-------------------+------------------------+---------------------
-0 | server1 | 5432 | up | 0.333333 | primary | 0 | false | 0 | | | 2019-08-06 11:13:17
-1 | server2 | 5432 | up | 0.333333 | standby | 0 | true | 0 | streaming | async | 2019-08-06 11:13:25
-2 | server3 | 5432 | up | 0.333333 | standby | 0 | false | 0 | streaming | async | 2019-08-06 11:14:20
-(3 rows)
- </programlisting>
- <para>
- Next, stop primary <productname>PostgreSQL</productname> server
- <literal>server1</literal>, and verify automatic failover.
- </para>
- <programlisting>
-[server1]$ pg_ctl -D /var/lib/pgsql/13/data -m immediate stop
- </programlisting>
- <para>
- After stopping <productname>PostgreSQL</productname> on <literal>server1</literal>,
- failover occurs and <productname>PostgreSQL</productname> on
- <literal>server2</literal> becomes new primary DB.
- </para>
- <programlisting>
-# psql -h 192.168.137.150 -p 9999 -U pgpool postgres -c "show pool_nodes"
-Password for user pgpool:
-node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay | replication_state | replication_sync_state | last_status_change
----------+----------+------+--------+-----------+---------+------------+-------------------+-------------------+-------------------+------------------------+---------------------
-0 | server1 | 5432 | down | 0.333333 | standby | 0 | false | 0 | | | 2019-08-06 11:36:03
-1 | server2 | 5432 | up | 0.333333 | primary | 0 | true | 0 | | | 2019-08-06 11:36:03
-2 | server3 | 5432 | up | 0.333333 | standby | 0 | false | 0 | streaming | async | 2019-08-06 11:36:15
-(3 rows)
- </programlisting>
- <para>
- <literal>server3</literal> is running as standby of new primary <literal>server2</literal>.
- </para>
-
- <programlisting>
-[server3]# psql -h server3 -p 5432 -U pgpool postgres -c "select pg_is_in_recovery()"
-pg_is_in_recovery
--------------------
-t
-
-[server2]# psql -h server2 -p 5432 -U pgpool postgres -c "select pg_is_in_recovery()"
-pg_is_in_recovery
--------------------
-f
-
-[server2]# psql -h server2 -p 5432 -U pgpool postgres -c "select * from pg_stat_replication" -x
--[ RECORD 1 ]----+------------------------------
-pid | 11059
-usesysid | 16392
-usename | repl
-application_name | server3
-client_addr | 192.168.137.103
-client_hostname |
-client_port | 48694
-backend_start | 2019-08-06 11:36:07.479161+09
-backend_xmin |
-state | streaming
-sent_lsn | 0/75000148
-write_lsn | 0/75000148
-flush_lsn | 0/75000148
-replay_lsn | 0/75000148
-write_lag |
-flush_lag |
-replay_lag |
-sync_priority | 0
-sync_state | async
-reply_time | 2019-08-06 11:42:59.823961+09
- </programlisting>
- </sect3>
-
- <sect3 id="example-cluster-try-online-recovery">
- <title>Online Recovery</title>
- <para>
- Here, we use <productname>Pgpool-II</productname> online recovery functionality to
- restore <literal>server1</literal> (old primary server) as a standby. Before
- restoring the old primary server, please ensure that
- <filename>recovery_1st_stage</filename> and <filename>pgpool_remote_start</filename> scripts
- exist in database cluster directory of current primary server <literal>server2</literal>.
- </para>
- <programlisting>
-# pcp_recovery_node -h 192.168.137.150 -p 9898 -U pgpool -n 0
-Password:
-pcp_recovery_node -- Command Successful
- </programlisting>
- <para>
- Then verify that <literal>server1</literal> is started as a standby.
- </para>
- <programlisting>
-# psql -h 192.168.137.150 -p 9999 -U pgpool postgres -c "show pool_nodes"
-Password for user pgpool:
-node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay | replication_state | replication_sync_state | last_status_change
----------+----------+------+--------+-----------+---------+------------+-------------------+-------------------+-------------------+------------------------+---------------------
-0 | server1 | 5432 | up | 0.333333 | standby | 0 | false | 0 | streaming | async | 2019-08-06 11:48:05
-1 | server2 | 5432 | up | 0.333333 | primary | 0 | false | 0 | | | 2019-08-06 11:36:03
-2 | server3 | 5432 | up | 0.333333 | standby | 0 | true | 0 | streaming | async | 2019-08-06 11:36:15
-(3 rows)
- </programlisting>
- </sect3>
- </sect2>
-</sect1>
+++ /dev/null
-<!-- doc/src/sgml/examples.sgml -->
-
-<part id="examples">
- <title>Examples</title>
-
- <partintro>
- <para>
- Various examples
- </para>
- </partintro>
-
- <chapter id="example-configs">
- <title>Configuration Examples</title>
- &example-basic;
- &example-cluster;
- &example-AWS;
- &example-Aurora;
- &example-Kubernetes;
- </chapter>
-</part>
+++ /dev/null
-<!-- doc/src/sgml/config.sgml -->
-
-<sect1 id="runtime-config-failover">
- <title>Failover and Failback</title>
-
- <para>
- <emphasis>Failover</emphasis> means automatically detaching
- <productname>PostgreSQL</productname>backend node which is not
- accessible by <productname>Pgpool-II</productname>. This happens
- automatically regardless the configuration parameter settings and is
- so called <emphasis>automatic failover</emphasis>
- process. <productname>Pgpool-II</productname> confirms the
- inaccessibility of <productname>PostgreSQL</productname> backend node
- by using following methods:
-
- <itemizedlist>
- <listitem>
- <para>
- Regular health check process
- (see <xref linkend="runtime-config-health-check"> for more
- details). The heath check process tries to connect
- from <productname>Pgpool-II</productname>
- to <productname>PostgreSQL</productname> node to confirm
- its healthiness. If it fails to connect, it is possible
- that there's something wrong with network connection
- between <productname>Pgpool-II</productname>
- and <productname>PostgreSQL</productname>,
- and/or <productname>PostgreSQL</productname> does not work
- properly. <productname>Pgpool-II</productname> does not
- distinguish each case and just decides that the
- particular <productname>PostgreSQL</productname> node is
- not available if health check fails.
- </para>
- </listitem>
-
- <listitem>
- <para>
- An error occurs while connecting
- to <productname>PostgreSQL</productname>, or network level
- errors occur while communicating with it.
- <productname>Pgpool-II</productname> will just disconnect
- the session to client
- if <xref linkend="guc-failover-on-backend-error"> is off in
- that case However.
- </para>
- </listitem>
-
- <listitem>
- <para>
- In the case When clients already connect
- to <productname>Pgpool-II</productname>
- and <productname>PostgreSQL</productname> is shutdown
- (please note that if no client connects
- to <productname>Pgpool-II</productname> at all, shutting
- down of <productname>PostgreSQL</productname> does not
- trigger a failover).
- </para>
- </listitem>
- </itemizedlist>
-
- </para>
-
- <para>
- If <xref linkend="guc-failover-command"> is configured and a
- failover happens, <xref linkend="guc-failover-command"> gets
- executed. <xref linkend="guc-failover-command"> should be provided
- by user. From 4.1 an example script for failover command is provided
- as <filename>failover.sh.sample</filename> which can be a good
- starting point for you.
- </para>
- <para>
- The major role of failover command is choosing new primary server
- from existing standby servers and promoting it for example. Another
- example would be let the administrator know that a failover happens
- by sending a mail.
- </para>
-
- <para>
- While a failover could happen when a failure occurs, it is
- possible to trigger it by hand. This is called a <emphasis>switch
- over</emphasis>. For instance, switching over
- a <productname>PostgreSQL</productname> to take its backup would
- be possible. Note that switching over just sets the status to
- down and never bringing <productname>PostgreSQL</productname>
- down. A switch over can be triggered by
- using <xref linkend="PCP-DETACH-NODE"> command.
- </para>
-
- <para>
- A <productname>PostgreSQL</productname> node detached by failover or
- switch over will never return to the previous state (attached state)
- automatically in the default setting. Restarting
- <productname>Pgpool-II</productname> with -D option or running <xref
- linkend="PCP-ATTACH-NODE"> makes it to the attached state again. It
- is recommended to confirm the replication_state of <xref
- linkend="SQL-SHOW-POOL-NODES"> is "streaming" before doing that. The
- state indicates that the standby server is properly connected to the
- primary server through streaming replication and both databases are
- in sync.
- </para>
- <para>
- From 4.1 a new parameter <xref linkend="guc-auto-failback"> can be
- used to do above automatically. See <xref
- linkend="guc-auto-failback"> for more details.
- </para>
-
- <sect2 id="runtime-config-failover-settings">
-
- <title>Failover and Failback Settings</title>
-
- <variablelist>
-
- <varlistentry id="guc-failover-command" xreflabel="failover_command">
- <term><varname>failover_command</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>failover_command</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies a user command to run when a <productname>PostgreSQL</> backend node gets detached.
- <productname>Pgpool-II</productname> replaces the following special characters
- with the backend specific information.
- </para>
-
- <table id="failover-command-table">
- <title>failover command options</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Special character</entry>
- <entry>Description</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>%d</entry>
- <entry>DB node ID of the detached node</entry>
- </row>
- <row>
- <entry>%h</entry>
- <entry>Hostname of the detached node</entry>
- </row>
- <row>
- <entry>%p</entry>
- <entry>Port number of the detached node</entry>
- </row>
- <row>
- <entry>%D</entry>
- <entry>Database cluster directory of the detached node</entry>
- </row>
- <row>
- <entry>%m</entry>
- <entry>New main node ID</entry>
- </row>
- <row>
- <entry>%H</entry>
- <entry>Hostname of the new main node</entry>
- </row>
- <row>
- <entry>%M</entry>
- <entry>Old main node ID</entry>
- </row>
- <row>
- <entry>%P</entry>
- <entry>Old primary node ID</entry>
- </row>
- <row>
- <entry>%r</entry>
- <entry>Port number of the new main node</entry>
- </row>
- <row>
- <entry>%R</entry>
- <entry>Database cluster directory of the new main node</entry>
- </row>
- <row>
- <entry>%N</entry>
- <entry>Hostname of the old primary node (<productname>Pgpool-II</productname> 4.1 or after)</entry>
- </row>
- <row>
- <entry>%S</entry>
- <entry>Port number of the old primary node (<productname>Pgpool-II</productname> 4.1 or after)</entry>
- </row>
- <row>
- <entry>%%</entry>
- <entry>'%' character</entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
-
- <note>
- <para>
- The "main node" refers to a node which has the
- "youngest (or the smallest) node id" among live the
- database nodes. In <link linkend="running-mode">streaming
- replication mode</link>, this may be different from
- primary node. In <xref linkend="failover-command-table">,
- %m is the new main node chosen
- by <productname>Pgpool-II</productname>. It is the node
- being assigned the youngest (smallest) node id which is
- alive. For example if you have 3 nodes, namely node 0, 1,
- 2. Suppose node 1 the primary and all of them are healthy
- (no down node). If node 1 fails, failover_command is
- called with %m = 0. And, if all standby nodes are down and primary node
- failover happens, failover_command is called with %m = -1 and %H,%R,$r = "".
- </para>
- </note>
-
- <note>
- <para>
- When a failover is performed,
- basically <productname>Pgpool-II</productname> kills all
- its child processes, which will in turn terminate all the
- active sessions to
- <productname>Pgpool-II</productname>. After that <productname>Pgpool-II</productname>
- invokes the <command>failover_command</command> and after the command completion
- <productname>Pgpool-II</productname> starts new child processes
- which makes it ready again to accept client connections.
- </para>
- <para>
- However from <productname>Pgpool-II</productname> 3.6, in the
- steaming replication mode, client sessions will not be
- disconnected any more when a failover occurs if the session
- does not use the failed standby server. Please note that if a
- query is sent while failover is processing, the session will be
- disconnected. If the primary server goes down, still all
- sessions will be disconnected. Health check timeout case will
- also cause the full session disconnection. Other health check
- error, including retry over case does not trigger full session
- disconnection.
- </para>
- </note>
-
- <note>
- <para>
- You can run <command>psql</command> (or whatever command)
- against backend to retrieve some information in the
- script, but you cannot run <command>psql</command> against
- <productname>Pgpool-II</productname> itself, since the
- script is called from <productname>Pgpool-II</productname>
- and it needs to run
- while <productname>Pgpool-II</productname> is working on
- failover.
- </para>
- </note>
-
- <para>
- A complete failover_command example can be found
- in <xref linkend="example-cluster">.
- </para>
-
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-failback-command" xreflabel="failback_command">
- <term><varname>failback_command</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>failback_command</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies a user command to run when a <productname>PostgreSQL</> backend node gets attached to
- <productname>Pgpool-II</productname>. <productname>Pgpool-II</productname>
- replaces the following special characters with the backend specific information.
- before executing the command.
- </para>
-
- <table id="failback-command-table">
- <title>failback command options</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Special character</entry>
- <entry>Description</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>%d</entry>
- <entry>DB node ID of the attached node</entry>
- </row>
- <row>
- <entry>%h</entry>
- <entry>Hostname of the attached node</entry>
- </row>
- <row>
- <entry>%p</entry>
- <entry>Port number of the attached node</entry>
- </row>
- <row>
- <entry>%D</entry>
- <entry>Database cluster directory of the attached node</entry>
- </row>
- <row>
- <entry>%M</entry>
- <entry>Old main node ID</entry>
- </row>
- <row>
- <entry>%m</entry>
- <entry>New main node ID</entry>
- </row>
- <row>
- <entry>%H</entry>
- <entry>Hostname of the new main node</entry>
- </row>
- <row>
- <entry>%P</entry>
- <entry>Old primary node ID</entry>
- </row>
- <row>
- <entry>%r</entry>
- <entry>Port number of the new main node</entry>
- </row>
- <row>
- <entry>%R</entry>
- <entry>Database cluster directory of the new main node</entry>
- </row>
- <row>
- <entry>%N</entry>
- <entry>Hostname of the old primary node (<productname>Pgpool-II</productname> 4.1 or after)</entry>
- </row>
- <row>
- <entry>%S</entry>
- <entry>Port number of the old primary node (<productname>Pgpool-II</productname> 4.1 or after)</entry>
- </row>
- <row>
- <entry>%%</entry>
- <entry>'%' character</entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
-
- <note>
- <para>
- You can run <command>psql</command> (or whatever command)
- against backend to retrieve some information in the
- script, but you cannot run <command>psql</command> against
- <productname>Pgpool-II</productname> itself, since the
- script is called from <productname>Pgpool-II</productname>
- and it needs to run
- while <productname>Pgpool-II</productname> is working on
- failover.
- </para>
- </note>
-
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-follow-primary-command" xreflabel="follow_primary_command">
- <term><varname>follow_primary_command</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>follow_primary_command</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
-
- <para>
- Specifies a user command to run after failover on the
- primary node failover. In case of standby node failover, the
- command will not be executed. This command also runs if a
- node promote request is issued by
- <xref linkend="PCP-PROMOTE-NODE"> command. This works only
- in streaming replication mode.
- </para>
-
- <para>
- Since the command is executed within a child process forked
- off by <productname>Pgpool-II</productname> after failover
- is completed, execution of follow primary command does not
- block the service
- of <productname>Pgpool-II</productname>. Here is a pseud
- code to illustrate how the command is executed:
- <programlisting>
-for each backend node
-{
- if (the node is not the new primary)
- set down node status to shared memory status
- memorize that follow primary command is needed to execute
-}
-if (we need to executed follow primary command)
-{
- fork a child process
- (within the child process)
-
- for each backend node
- {
- if (the node status in shared memory is down)
- execute follow primary command
- }
-}
- </programlisting>
- </para>
-
- <para>
- <productname>Pgpool-II</productname> replaces the following special characters
- with the backend specific information before executing the command.
- </para>
-
- <table id="follow-primary-command-table">
- <title>follow primary command options</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Special character</entry>
- <entry>Description</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>%d</entry>
- <entry>DB node ID of the detached node</entry>
- </row>
- <row>
- <entry>%h</entry>
- <entry>Hostname of the detached node</entry>
- </row>
- <row>
- <entry>%p</entry>
- <entry>Port number of the detached node</entry>
- </row>
- <row>
- <entry>%D</entry>
- <entry>Database cluster directory of the detached node</entry>
- </row>
- <row>
- <entry>%m</entry>
- <entry>New primary node ID</entry>
- </row>
- <row>
- <entry>%H</entry>
- <entry>Hostname of the new primary node</entry>
- </row>
- <row>
- <entry>%M</entry>
- <entry>Old main node ID</entry>
- </row>
- <row>
- <entry>%P</entry>
- <entry>Old primary node ID</entry>
- </row>
- <row>
- <entry>%r</entry>
- <entry>Port number of the new primary node</entry>
- </row>
- <row>
- <entry>%R</entry>
- <entry>Database cluster directory of the new primary node</entry>
- </row>
- <row>
- <entry>%N</entry>
- <entry>Hostname of the old primary node (<productname>Pgpool-II</productname> 4.1 or after)</entry>
- </row>
- <row>
- <entry>%S</entry>
- <entry>Port number of the old primary node (<productname>Pgpool-II</productname> 4.1 or after)</entry>
- </row>
- <row>
- <entry>%%</entry>
- <entry>'%' character</entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
-
- <note>
- <para>
- If <varname>follow_primary_command</varname> is not empty, then after failover
- on the primary node gets completed in Native Replication mode with streaming replication,
- <productname>Pgpool-II</productname> degenerates all nodes except the new primary
- and starts new child processes to be ready again to accept connections from the clients.
- After this, <productname>Pgpool-II</productname> executes the command configured
- in the <varname>follow_primary_command</varname> for each degenerated backend nodes.
- </para>
- </note>
- <para>
- Typically <varname>follow_primary_command</varname> command
- is used to recover the standby from the new primary by calling
- the pcp_recovery_node command. In
- the <varname>follow_primary_command</varname>, it is
- recommended to check whether
- target <productname>PostgreSQL</productname> node is running
- or not using pg_ctl since already stopped node usually has a
- reason to be stopped: for example, it's broken by hardware
- problems or administrator is maintaining the node. If the
- node is stopped, skip the node. If the node is running, stop
- the node first and recovery it. A
- complete <varname>follow_primary_command</varname> example
- can be found in <xref linkend="example-cluster">.
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-failover-on-backend-error" xreflabel="failover_on_backend_error">
- <term><varname>failover_on_backend_error</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>failover_on_backend_error</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- When set to on, <productname>Pgpool-II</productname> considers the reading/writing
- errors on the PostgreSQL backend connection as the backend node failure and trigger the
- failover on that node after disconnecting the current session.
- When this is set to off, <productname>Pgpool-II</productname> only report an error
- and disconnect the session in case of such errors.
- </para>
- <note>
- <para>
- It is recommended to turn on the backend health checking
- (see <xref linkend="runtime-config-health-check">)
- when <varname>failover_on_backend_error</varname> is set to off.
- Note, however, that <productname>Pgpool-II</productname> still triggers the
- failover when it detects the administrative shutdown of
- <productname>PostgreSQL</> backend server.
- If you want to avoid a fail over even in this case, you need to specify DISALLOW_TO_FAILOVER on <xref linkend="guc-backend-flag">.
- </para>
- </note>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- <note>
- <para>
- Prior to <productname>Pgpool-II</productname> <emphasis>V4.0</emphasis>,
- this configuration parameter name was <varname>fail</varname><emphasis>_</emphasis><varname>over_on_backend_error</varname>.
- </para>
- </note>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-search-primary-node-timeout" xreflabel="search_primary_node_timeout">
- <term><varname>search_primary_node_timeout</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>search_primary_node_timeout</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the maximum amount of time in seconds to search for the
- primary node when a failover scenario occurs.
- <productname>Pgpool-II</productname> will give up looking for the primary
- node if it is not found with-in this configured time.
- Default is 300 and Setting this parameter to 0 means keep trying forever.
- </para>
- <para>
- This parameter is only applicable in the streaming replication mode.
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-detach-false-primary" xreflabel="detach_false_primary">
- <term><varname>detach_false_primary</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>detach_false_primary</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- If set to on, detach false primary node. The default is
- off. This parameter is only valid in streaming replication
- mode and for <productname>PostgreSQL</productname> 9.6 or
- after since this feature
- uses <function>pg_stat_wal_receiver</function>.
- If <productname>PostgreSQL</productname> 9.5.x or older
- version is used, no error is raised, just the feature is
- ignored.
- </para>
- <para>
- If there's no primary node, no checking will be performed.
- </para>
- <para>
- If there's no standby node, and there's only one primary
- node, no checking will be performed.
- </para>
- <para>
- If there's no standby node, and there's multiple primary
- nodes, leave the primary node which has the youngest node
- id and detach rest of primary nodes.
- </para>
- <para>
- If there are one or more primaries and one or more standbys,
- check the connectivity between primary and standby nodes by
- using <function>pg_stat_wal_receiver</function>
- if <productname>PostgreSQL</productname> 9.6 or after. In
- this case if a primary node connects to all standby nodes,
- the primary is regarded as "true" primary. Other primaries
- are regarded as "false" primary and the false primaries will
- be detached if <varname>detach_false_primary</varname> is
- true. If no "true" primary is found, nothing will happen.
- </para>
- <para>
- When <productname>Pgpool-II</productname> starts, the
- checking of false primaries are performed only once in
- the <productname>Pgpool-II</productname> main
- process. If <xref linkend="guc-sr-check-period"> is greater
- than 0, the false primaries checking will be performed at
- the same timing of streaming replication delay checking.
- </para>
-
- <note>
- <para>
- <xref linkend="guc-sr-check-user"> must
- be <productname>PostgreSQL</productname> super user or
- in "pg_monitor" group to use this feature. To
- make <xref linkend="guc-sr-check-user"> in pg_monitor
- group, execute following SQL command
- by <productname>PostgreSQL</productname> super user
- (replace "sr_check_user" with the setting
- of <xref linkend="guc-sr-check-user">):
- <programlisting>
- GRANT pg_monitor TO sr_check_user;
- </programlisting>
- For <productname>PostgreSQL</productname> 9.6, there's
- no pg_monitor group
- and <xref linkend="guc-sr-check-user"> must
- be <productname>PostgreSQL</productname> super user.
- </para>
- </note>
-
- <para>
- This parameter is only applicable in the streaming replication mode.
- </para>
- <para>
- This parameter can be changed by reloading
- the <productname>Pgpool-II</productname> configurations.
- </para>
-
- <para>
- <figure>
- <title>Detecting false primaries</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="detach_false_primary.gif">
- </imageobject>
- </mediaobject>
- </figure>
- </para>
-
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-auto-failback" xreflabel="auto_failback">
- <term><varname>auto_failback</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>auto_failback</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- When set to on, standby node be automatically failback, if the node status
- is down but streaming replication works normally. This is useful when
- standby node is degenerated by pgpool because of the temporary network failure.
- </para>
-
- <para>
- To use this feature, streaming replication check (see <xref linkend="runtime-streaming-replication-check"> for more details)
- must be enabled, and <productname>PostgreSQL</productname> 9.1 or later
- is required as backend nodes. This feature uses <function>pg_stat_replication</function>
- on primary node. The automatic failback is performed on standby node only.
- Note that failback_command will be executed as well if failback_command is not empty.
- If you plan to detach standby node for maintenance, set this parameter to off beforehand.
- Otherwise it's possible that standby node is reattached against your intention.
- </para>
- <para>
- The default is off. This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
-
- <note>
- <para>
- <xref linkend="guc-auto-failback"> may not work, when replication slot is used.
- There is possibility that the streaming replication is stopped, because
- <xref linkend="guc-failover-command"> is executed and replication slot is deleted by
- the command.
- </para>
- </note>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-auto-failback-interval" xreflabel="auto_failback_interval">
- <term><varname>auto_failback_interval</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>auto_failback_interval</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the minimum amount of time in seconds for execution interval of auto failback.
- Next auto failback won't execute until that specified time have passed
- after previous auto failback. When <productname>Pgpool-II</productname> frequently detect
- backend down because of network error for example, you may avoid repeating
- failover and failback by setting this parameter to large enough value.
- The default is 60. Setting this parameter to 0 means that auto failback don't wait.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </sect2>
-
- <sect2 id="runtime-config-failover-in-the-raw-mode">
-
- <title>Failover in the raw Mode</title>
-
- <para>
- Failover can be performed in raw mode if multiple backend servers are defined.
- <productname>Pgpool-II</> usually accesses the backend specified by
- <literal>backend_hostname0</> during normal operation. If the
- <literal>backend_hostname0</> fails for some reason,
- <productname>Pgpool-II</> tries to access the backend specified by
- <literal>backend_hostname1</>. If that fails, <productname>Pgpool-II</>
- tries the <literal>backend_hostname2, 3</> and so on.
- </para>
-
- </sect2>
-
-</sect1>
+++ /dev/null
-<!-- doc/src/sgml/filelist.sgml -->
-
-<!ENTITY history SYSTEM "history.sgml">
-<!ENTITY info SYSTEM "info.sgml">
-<!ENTITY intro SYSTEM "intro.sgml">
-<!ENTITY legal SYSTEM "legal.sgml">
-<!ENTITY notation SYSTEM "notation.sgml">
-<!ENTITY problems SYSTEM "problems.sgml">
-<!ENTITY restrictions SYSTEM "restrictions.sgml">
-
-<!-- tutorial -->
-<!ENTITY advanced SYSTEM "advanced.sgml">
-<!ENTITY query SYSTEM "query.sgml">
-<!ENTITY start SYSTEM "start.sgml">
-
-<!-- administrator's guide -->
-<!ENTITY client-auth SYSTEM "client-auth.sgml">
-<!ENTITY installation SYSTEM "installation.sgml">
-<!ENTITY installation-rpm SYSTEM "installation-rpm.sgml">
-<!ENTITY installation-tips SYSTEM "installation-tips.sgml">
-<!ENTITY maintenance SYSTEM "maintenance.sgml">
-<!ENTITY manage-ag SYSTEM "manage-ag.sgml">
-<!ENTITY monitoring SYSTEM "monitoring.sgml">
-<!ENTITY regress SYSTEM "regress.sgml">
-<!ENTITY recovery-config SYSTEM "recovery-config.sgml">
-<!ENTITY runtime SYSTEM "runtime.sgml">
-<!ENTITY config SYSTEM "config.sgml">
-<!ENTITY connection-settings SYSTEM "connection-settings.sgml">
-<!ENTITY connection-pooling SYSTEM "connection-pooling.sgml">
-<!ENTITY loadbalance SYSTEM "loadbalance.sgml">
-<!ENTITY healthcheck SYSTEM "healthcheck.sgml">
-<!ENTITY failover SYSTEM "failover.sgml">
-<!ENTITY online-recovery SYSTEM "online-recovery.sgml">
-<!ENTITY stream-check SYSTEM "stream-check.sgml">
-<!ENTITY memcache SYSTEM "memcache.sgml">
-<!ENTITY ssl SYSTEM "ssl.sgml">
-<!ENTITY watchdog SYSTEM "watchdog.sgml">
-<!ENTITY performance SYSTEM "performance.sgml">
-<!ENTITY misc-config SYSTEM "misc-config.sgml">
-<!ENTITY config-last SYSTEM "config-last.sgml">
-
-<!ENTITY examples SYSTEM "examples.sgml">
-<!ENTITY example-basic SYSTEM "example-basic.sgml">
-<!ENTITY example-watchdog SYSTEM "example-watchdog.sgml">
-<!ENTITY example-cluster SYSTEM "example-cluster.sgml">
-<!ENTITY example-AWS SYSTEM "example-AWS.sgml">
-<!ENTITY example-Aurora SYSTEM "example-Aurora.sgml">
-<!ENTITY example-Kubernetes SYSTEM "example-Kubernetes.sgml">
-
-<!-- reference pages -->
-<!ENTITY % allfiles SYSTEM "ref/allfiles.sgml">
-%allfiles;
-
-<!-- appendixes -->
-<!ENTITY release SYSTEM "release.sgml">
-<!ENTITY release-4.2 SYSTEM "release-4.2.sgml">
-<!ENTITY release-4.1 SYSTEM "release-4.1.sgml">
-<!ENTITY release-4.0 SYSTEM "release-4.0.sgml">
-<!ENTITY release-3.7 SYSTEM "release-3.7.sgml">
-<!ENTITY release-3.6 SYSTEM "release-3.6.sgml">
-<!ENTITY release-3.5 SYSTEM "release-3.5.sgml">
-<!ENTITY release-3.4 SYSTEM "release-3.4.sgml">
-<!ENTITY release-3.3 SYSTEM "release-3.3.sgml">
-<!ENTITY release-3.2 SYSTEM "release-3.2.sgml">
-<!ENTITY release-3.1 SYSTEM "release-3.1.sgml">
-<!ENTITY release-old SYSTEM "release-old.sgml">
-
-<!-- back matter -->
-<!ENTITY biblio SYSTEM "biblio.sgml">
-<!ENTITY bookindex SYSTEM "bookindex.sgml">
-
-<!--
- Some parts of the documentation are also source for some plain-text
- files used during installation. To selectively ignore or include
- some parts (e.g., external xref's) when generating these files we use
- these parameter entities. See also standalone-install.sgml.
- -->
-<!ENTITY % standalone-ignore "INCLUDE">
-<!ENTITY % standalone-include "IGNORE">
-
-<!--
- By default, no index is included. Use -i include-index on the command line
- to include it.
- -->
-<!ENTITY % include-index "IGNORE">
-
-<!--
- Create empty index element for processing by XSLT stylesheet.
- -->
-<!ENTITY % include-xslt-index "IGNORE">
+++ /dev/null
-#!/bin/sh
-# fixrtf
-
-# doc/src/sgml/fixrtf
-
-# Repair (slightly) damaged RTF generated by jade
-# Applixware wants the s0 stylesheet defined, whereas
-# M$Word does not care about it.
-# (c) 2001, Thomas Lockhart, PostgreSQL Inc.
-
-flist=""
-RPAT=""
-for i in $@ ; do
- case "$i" in
- -r|--refentry)
- RPAT='-e s/\\\keepn/\\\keep/g'
- ;;
- -?|--help)
- echo "$0 [--refentry] <rtf file> ..."
- exit 0
- ;;
- -*)
- echo "Command $i not recognized"
- $0 --help
- exit 1
- ;;
- *)
- flist="$flist $i"
- esac
-done
-
-if [ "$flist" = "" ] ; then
- flist=*.rtf
-fi
-
-for f in $flist ; do
- echo -n "Repairing '$f' ..."
- if [ -r $f ] ; then
- (sed -e 's/{\\stylesheet{\\s1/{\\stylesheet{\\s0 Normal 0;}{\\s1/g' $RPAT $f > $f.new \
- && mv -f $f.new $f \
- && echo " done") || echo " failed"
- else
- echo " file not found"
- fi
-done
-exit
+++ /dev/null
-#!/usr/bin/perl
-#
-# Generate the errcodes-table.sgml file from errcodes.txt
-# Copyright (c) 2000-2016, PostgreSQL Global Development Group
-
-use warnings;
-use strict;
-
-print
- "<!-- autogenerated from src/backend/utils/errcodes.txt, do not edit -->\n";
-
-open my $errcodes, $ARGV[0] or die;
-
-while (<$errcodes>)
-{
- chomp;
-
- # Skip comments
- next if /^#/;
- next if /^\s*$/;
-
- # Emit section headers
- if (/^Section:/)
- {
-
- # Remove the Section: string
- s/^Section: //;
-
- # Escape dashes for SGML
- s/-/—/;
-
- # Wrap PostgreSQL in <productname/>
- s/PostgreSQL/<productname>PostgreSQL<\/>/g;
-
- print "\n\n";
- print "<row>\n";
- print "<entry spanname=\"span12\">";
- print "<emphasis role=\"bold\">$_</></entry>\n";
- print "</row>\n";
-
- next;
- }
-
- die unless /^([^\s]{5})\s+([EWS])\s+([^\s]+)(?:\s+)?([^\s]+)?/;
-
- (my $sqlstate, my $type, my $errcode_macro, my $condition_name) =
- ($1, $2, $3, $4);
-
- # Skip lines without PL/pgSQL condition names
- next unless defined($condition_name);
-
- print "\n";
- print "<row>\n";
- print "<entry><literal>$sqlstate</literal></entry>\n";
- print "<entry><symbol>$condition_name</symbol></entry>\n";
- print "</row>\n";
-}
-
-close $errcodes;
+++ /dev/null
-<!-- doc/src/sgml/healthcheck.sgml -->
-
-<sect1 id="runtime-config-health-check">
- <title>Health Check</title>
-
- <para>
- <productname>Pgpool-II</productname> periodically connects to the configured
- PostgreSQL backends to detect any error on the servers or networks.
- This error check procedure is called "health check".
- If an error is detected, <productname>Pgpool-II</productname> performs failover
- or degeneration depending on the configurations.
- <caution>
- <para>
- Health check requires one extra connection to each backend node,
- so <literal>max_connections</literal> in the <filename>postgresql.conf</filename>
- needs to be adjusted accordingly.
- </para>
- </caution>
- </para>
-
- <para>
- The health check process collects various statistics data such as
- number of health check count in total. To inspect the statistics
- data, use <xref linkend="SQL-SHOW-POOL-HEALTH-CHECK-STATS">
- command. Please note that the data is stored in the shared memory
- area and it will be initialized upon
- <productname>Pgpool-II</productname> starting up.
- </para>
-
- <para>
- Following parameter names can also have numeric suffix at the end
- of each name. The suffix corresponds to backend id, which is
- defined in backend information, such
- as <xref linkend="guc-backend-hostname">.
- example, <varname>health_check_timeout0</varname> is applied to
- backend 0's <varname>health_check_timeout</varname> value.
- </para>
- <para>
- If there's no parameter with suffix, the value for the backend
- is taken from the parameter name which does not have a suffix. In
- this sense, parameter names without suffix work like "global
- variables".
- </para>
-
- <variablelist>
-
- <varlistentry id="guc-health-check-timeout" xreflabel="health_check_timeout">
- <term><varname>health_check_timeout</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>health_check_timeout</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the timeout in seconds to give up connecting to the backend
- <productname>PostgreSQL</> if the TCP connect does not succeed within this time.
- </para>
- <para>
- This parameter serves to prevent the health check from waiting for a
- long time when the network cable is unplugged.
- Default value is 20. Setting it to 0, disables the timeout (waits until TCP/IP timeout).
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-health-check-period" xreflabel="health_check_period">
- <term><varname>health_check_period</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>health_check_period</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the interval between the health checks in seconds.
- Default is 0, which means health check is disabled.
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-health-check-user" xreflabel="health_check_user">
- <term><varname>health_check_user</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>health_check_user</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the <productname>PostgreSQL</> user name to perform health check.
- The same user must exist in all the <productname>PostgreSQL</> backends.
- Otherwise, health check causes an error.
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-health-check-password" xreflabel="health_check_password">
- <term><varname>health_check_password</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>health_check_password</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the password for the <productname>PostgreSQL</> user name configured in
- <xref linkend="guc-health-check-user"> to perform health check.
- The user and password must be same in all the <productname>PostgreSQL</> backends.
- Otherwise, health check results in an error.
- </para>
- <para>
- If <varname>health_check_password</varname> is left blank <productname>Pgpool-II</productname>
- will first try to get the password for <xref linkend="guc-health-check-user"> from
- <xref linkend="guc-pool-passwd"> file before using the empty password.
- </para>
- <para>
- <productname>Pgpool-II</productname> accepts following forms
- of password in either <varname>health_check_password</varname>
- or <xref linkend="guc-pool-passwd"> file:
- <variablelist>
-
- <varlistentry>
- <term>AES256-CBC encrypted password</term>
- <listitem>
- <para>
- Most secure and recommended way to store password. The
- password string must be prefixed
- with <literal>AES</literal>.
- You can use <xref linkend="PG-ENC"> utility to create the correctly formatted
- <literal>AES</literal> encrypted password strings.
- <productname>Pgpool-II</productname> will require a valid decryption key at the
- startup to use the encrypted passwords.
- see <xref linkend="auth-aes-decryption-key"> for more details on providing the
- decryption key to <productname>Pgpool-II</productname>
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>MD5 hashed password</term>
- <listitem>
- <para>
- Not so secure as AES256, but still better than clear
- text password. The password string must be prefixed
- with <literal>MD5</literal>. Note that the backend
- must set up MD5 authentication as well. You can
- use <xref linkend="PG-MD5"> utility to create the
- correctly formatted
- <literal>MD5</literal> hashed password strings.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>Plain text password</term>
- <listitem>
- <para>
- Not encrypted, clear text password. You should avoid
- to use this if possible. The password string must be
- prefixed with <literal>TEXT</literal>. For example if
- you want to set <literal>mypass</literal> as a
- password, you should
- specify <literal>TEXTmypass</literal> in the password
- field. In the absence of a valid
- prefix, <productname>Pgpool-II</productname> will
- considered the string as a plain text password.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </para>
-
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-health-check-database" xreflabel="health_check_database">
- <term><varname>health_check_database</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>health_check_database</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the PostgreSQL database name to perform health check.
- The default is <literal>''</literal>(empty), which tries <literal>"postgres"</literal>
- database first, then <literal>"template1"</literal> database until it succeeds
- </para>
- <para>
- <varname>health_check_database</varname> was introduced in
- <productname>Pgpool-II</productname> <emphasis>V3.5</emphasis>.
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-health-check-max-retries" xreflabel="health_check_max_retries">
- <term><varname>health_check_max_retries</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>health_check_max_retries</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the maximum number of retries to do before giving up and
- initiating failover when health check fails.
- <tip>
- <para>
- This setting can be useful in spotty networks, when it is expected that
- health checks will fail occasionally even when the primary node is fine.
- </para>
- </tip>
- <tip>
- <para>
- It is advised that <xref linkend="guc-failover-on-backend-error"> must be disabled,
- if you want to enable <varname>health_check_max_retries</>.
- </para>
- </tip>
- Default is 0, which means do not retry.
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-health-check-retry-delay" xreflabel="health_check_retry_delay">
- <term><varname>health_check_retry_delay</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>health_check_retry_delay</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the amount of time in seconds to sleep between failed
- health check retries (not used unless <xref linkend="guc-health-check-max-retries"> is > 0).
- If 0, then retries are immediate without delay.
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-connect-timeout" xreflabel="connect_timeout">
- <term><varname>connect_timeout</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>connect_timeout</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the amount of time in milliseconds before giving up connecting
- to backend using <function>connect()</> system call.
- Default is 10000 ms (10 second). The flaky network user may want to increase the value.
- 0 means no timeout.
- <note>
- <para>
- <varname>connect_timeout</varname> value is not only used for a health check,
- but also for creating ordinary connection pools.
- </para>
- </note>
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
-</sect1>
+++ /dev/null
-<!-- doc/src/sgml/history.sgml -->
-
-<sect1 id="history">
- <!--
- <title>A Brief History of <productname>Pgpool-II</productname></title>
- -->
- <title><productname>Pgpool-II</productname>简史</title>
-
- <indexterm zone="history">
- <primary>history</primary>
- <secondary>of Pgpool-II</secondary>
- </indexterm>
- <para>
- <productname>Pgpool-II</productname> started its life as a personal
- project by Tatsuo Ishii. In the project it was just a simple
- connection pooling software. So the
- name <productname>Pgpool</productname> came from the fact. The
- first version was in public in 2003.
- </para>
- <para>
- In 2004, <productname>Pgpool</productname> 1.0 was released with
- the native replication feature (SQL statement based
- replication). In the same year 2.0 was released with load
- balancing, and support for version 3 frontend/backend protocol. In
- 2005, automated fail over and master slave mode support were added.
- </para>
- <para>
- In 2006, <productname>Pgpool</productname>
- became <productname>Pgpool-II</productname>. The first release 1.0
- eliminated many of restrictions
- in <productname>Pgpool</productname>, for example the number
- of <productname>PostgreSQL</productname> servers was up to 2 in
- <productname>Pgpool</productname>. Also many new features such as
- parallel query mode and PCP commands (PCP stands for "Pgpool
- Control Protocol") were added. Probably the most important change
- made between <productname>Pgpool</productname>
- and <productname>Pgpool-II</productname> was that the project was
- changed from a personal project to a group project owned by the
- Pgpool Development Group.
- </para>
-</sect1>
+++ /dev/null
-<!-- doc/src/sgml/info.sgml -->
-
-<sect1 id="resources">
- <!--
- <title>Further Information</title>
- -->
- <title>进一步的信息</title>
-
- <para>
- Besides the documentation, that is, this book, there are other
- resources about <productname>Pgpool-II</productname>:
-
- <variablelist>
-
- <varlistentry>
- <term>Web Site</term>
- <listitem>
- <para>
- The <productname>Pgpool-II</productname>
- <ulink url="http://pgpool.net">web site</ulink> is a central place providing official information regarding
- <productname>Pgpool-II</productname>: downloads, documentation, FAQ, mailing list archives and more.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>Mailing Lists</term>
- <listitem>
- <para>
- The mailing lists are a good place to have your questions
- answered, to share experiences with other users, and to contact
- the developers. Consult the <productname>Pgpool-II</> web site
- for details.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>Yourself!</term>
- <listitem>
- <para>
- <productname>pgpool-II</productname> is an open-source project.
- As such, it depends on the user community for ongoing support.
- As you begin to use <productname>Pgpool-II</productname>, you
- will rely on others for help, either through the documentation
- or through the mailing lists. Consider contributing your
- knowledge back. Read the mailing lists and answer questions. If
- you learn something which is not in the documentation, write it
- up and contribute it. If you add features to the code,
- contribute them.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </para>
-</sect1>
+++ /dev/null
-<!-- doc/src/sgml/installation-rpm.sgml -->
-
- <sect1 id="install-rpm">
- <title>Installation from RPM</title>
- <para>
- This chapter describes the installation
- of <productname>Pgpool-II</productname> from RPM. If you are
- going to install from the source code, please
- check <xref linkend="install-source">.
- </para>
-
- <sect2 id="installing-rpm">
- <title>Installing RPM</title>
- <para>
- <productname>Pgpool-II</productname> official RPMs can be
- obtained from
- <ulink url="https://www.pgpool.net/yum">https://www.pgpool.net/yum</ulink>.
- </para>
-
- <para>
- For RHEL and its derivatives do following once:
- <programlisting>
- yum install https://www.pgpool.net/yum/rpms/4.1/redhat/rhel-7-x86_64/pgpool-II-release-4.1-2.noarch.rpm
- </programlisting>
- Then:
- <programlisting>
- yum install pgpool-II-pg12
- </programlisting>
-
- <literal>pg12</literal> means <literal>PostgreSQL
- 12</literal>. <productname>Pgpool-II</productname>
- needs <productname>PostgreSQL</productname>'s library and
- extensions directory. Since the directory paths are different in
- the particular <productname>PostgreSQL</productname> versions,
- You must choose appropriate RPM for
- your <productname>PostgreSQL</productname> rpm installation. We
- also assume you are
- using <ulink url="https://www.postgresql.org/download/linux/redhat/"><productname>PostgreSQL</productname>
- community rpms</ulink>.
-
- Optionally you can install:
- <programlisting>
- yum install pgpool-II-pg12-debuginfo
- </programlisting>
- which makes it easier to retrieve debugging symbols from the core
- or the backtrace. We recommend to install it.
-
- There is an optional package for developers.
- <programlisting>
- yum install pgpool-II-pg12-devel
- </programlisting>
- This installs header files which developers are interested in.
- </para>
-
- <para>
- On all the <productname>PostgreSQL</productname> servers you need
- to install:
- <programlisting>
- yum install pgpool-II-pg12-extensions
- </programlisting>
-
- </para>
- </sect2>
-
- <sect2 id="configure-rpm">
- <title>Configuration with RPM</title>
- <para>
- All the <productname>Pgpool-II</productname> configuration files
- live in <filename>/etc/pgpool-II</filename>. Please refer
- to <xref linkend="configuring-pgpool"> to see how to set up
- configuration files.
- </para>
- </sect2>
-
- <sect2 id="start-rpm">
- <title>Starting/stopping Pgpool-II</title>
- <para>
- On RHEL7/CentOS 7, do this once.
- Do this once, if set the automatic startup of <productname>Pgpool-II</productname>.
- <programlisting>
- systemctl enable pgpool.service
- </programlisting>
-
- After this, restart the whole system or do this. Please note that
- <productname>PostgreSQL</productname> servers must have been started
- before this.
-
- <programlisting>
- systemctl start pgpool.service
- </programlisting>
-
- To stop <productname>Pgpool-II</productname>, do this once.
- <productname>Pgpool-II</productname> must need to stop, before <productname>PostgreSQL</productname> is stopped.
- <programlisting>
- systemctl stop pgpool.service
- </programlisting>
-
- After this, you can stop <productname>PostgreSQL</productname>
- servers.
- </para>
- <para>
- On RHEL6/CentOS 6, do this once.
-
- <programlisting>
- chkconfig pgpool on
- </programlisting>
-
- After this, restart the whole system or:
-
- <programlisting>
- service start pgpool
- </programlisting>
-
- Please note that <productname>PostgreSQL</productname> servers
- must have been started before this.
-
- To stop <productname>Pgpool-II</productname>:
- <programlisting>
- service stop pgpool
- </programlisting>
-
- After this, you can stop <productname>PostgreSQL</productname>
- servers.
- </para>
-
- </sect2>
-
- </sect1>
+++ /dev/null
-<!-- doc/src/sgml/installation-tips.sgml -->
-
- <sect1 id="installation-tips">
- <title>Tips for Installation</title>
- <para>
- This chapter gathers random tips for installing <productname>Pgpool-II</productname>.
- </para>
-
- <sect2 id="firewall">
- <title>Firewalls</title>
- <para>
- When <productname>Pgpool-II</productname> connects to
- other <productname>Pgpool-II</productname> servers
- or <productname>PostgreSQL</productname> servers, the target port
- must be accessible by enabling firewall management softwares.
- </para>
-
- <para>
- First, allow to access port that <productname>Pgpool-II</productname> use.
-
- In the example below, let <link linkend="guc-port">Pgpool-II listen
- port number</link> be 9999, <link linkend="guc-pcp-port">PCP listen
- port number</link> be 9898, <link linkend="guc-wd-port">watchdog
- listen port number</link> be 9000 and <link
- linkend="guc-heartbeat-port">heartbeat listen port number</link> be
- 9694. Notice that only heartbeat port uses UDP and others use TCP.
-
- <programlisting>
- firewall-cmd --permanent --zone=public --add-port=9999/tcp --add-port=9898/tcp --add-port=9000/tcp
- firewall-cmd --permanent --zone=public --add-port=9694/udp
- firewall-cmd --reload
- </programlisting>
- </para>
-
- <para>
- Here is an example for CentOS/RHEL7 when access
- to <productname>PostgreSQL</productname> is required.
-
- <programlisting>
- firewall-cmd --permanent --zone=public --add-service=postgresql
- firewall-cmd --reload
- </programlisting>
- "postgresql" is the service name assigned
- to <productname>PostgreSQL</productname>. The list of service
- names can be obtained by:
- <programlisting>
- firewall-cmd --get-services
- </programlisting>
- Note that you can define your own service name in
- /usr/lib/firewalld/services/.
- </para>
-
- <para>
- If <productname>PostgreSQL</productname> is listening on 11002
- port, rather than the standard 5432 port, you can do:
- <programlisting>
- firewall-cmd --zone=public --remove-service=postgresql --permanent
- firewall-cmd --zone=public --add-port=11002/tcp --permanent
- firewall-cmd --reload
- </programlisting>
- </para>
-
- </sect2>
-
- </sect1>
+++ /dev/null
-<!-- doc/src/sgml/installation.sgml -->
-
- <chapter id="installation">
- <title>Installation of <productname>Pgpool-II</productname></title>
-
- <indexterm zone="installation">
- <primary>installation</primary>
- </indexterm>
-
- <sect1 id="planning">
- <title>Planning</title>
- <para>
- Since <productname>Pgpool-II</productname> is a tool to manage
- <productname>PostgreSQL</productname>, we need to decide how to
- deploy them first. In addition, it is possible to have multiple
- number of <productname>Pgpool-II</productname> installations to
- enhance the availability of <productname>Pgpool-II</productname>
- itself. We need to plan how many installations of
- <productname>Pgpool-II</productname> is required before hand. In
- this chapter we first discuss the running mode of
- <productname>PostgreSQL</productname> then the deployment of
- <productname>Pgpool-II</productname>.
- </para>
-
- <sect2 id="planning-postgresql">
- <title>Clustering mode of PostgreSQL</title>
- <para>
- It is possible to have more than or equal to one installation of
- <productname>PostgreSQL</productname>, it is common to have more
- than 2 installations of it because if there's only one
- installation, the whole database system goes down if the
- <productname>PostgreSQL</productname> is not available. When we
- use two or more <productname>PostgreSQL</productname> servers, it
- is necessary to sync the databases in some way. We call the
- methods of syncing databases as "clustering running mode". The
- most popular mode ever used is "streaming replication mode".
- Unless there's necessity to have special consideration, it is
- recommended to use the streaming replication mode. See <xref
- linkend="running-mode"> for more details of running mode.
- </para>
- <para>
- The next thing we need to consider is how many
- <productname>PostgreSQL</productname> installations we want. If
- there are two, we can continue to operate the database
- system. However it is not uncommon to use more than two
- <productname>PostgreSQL</productname> if you want to employ read
- query load balancing by running multiple read quires on multiple
- servers. <productname>Pgpool-II</productname> provides rich
- variety of options to tune load balancing. See <xref
- linkend="runtime-config-load-balancing"> for more details.
- </para>
- <para>
- Since it is possible to add <productname>PostgreSQL</productname>
- servers later on in <productname>Pgpool-II</productname>, two
- <productname>PostgreSQL</productname> can be a good starter for
- you.
- </para>
- </sect2>
-
- <sect2 id="planning-pgpool">
- <title>Deployment of Pgpool-II</title>
- <para>
- Although it is possible to use only one
- <productname>Pgpool-II</productname>, we recommend to use more
- than 1 <productname>Pgpool-II</productname> to avoid whole
- database unavailability due to the
- <productname>Pgpool-II</productname> being down. Multiple
- <productname>Pgpool-II</productname> work together and monitor
- each other. One of them is called "leader" and it has a virtual
- IP. Clients do not need to aware that there are multiple
- <productname>Pgpool-II</productname> because they always access
- the same VIP. (See <xref linkend="tutorial-watchdog-intro"> for
- watchdog). If one of <productname>Pgpool-II</productname> goes
- down, other <productname>Pgpool-II</productname> takes over the
- leader role.
- </para>
- <para>
- Since it is not allowed to have multiple leader, watchdog votes to
- decide a new leader. If there are even number of
- <productname>Pgpool-II</productname>, it is impossible to decide
- the new leader by voting. Thus we recommend to deploy
- <productname>Pgpool-II</productname> in more than 3 odd numbers.
- </para>
- <para>
- Please note that it is possible to have
- <productname>Pgpool-II</productname> and
- <productname>PostgreSQL</productname> on a same server. For
- example you can have only three servers to run both
- <productname>Pgpool-II</productname> and
- <productname>PostgreSQL</productname> on each of it.
- </para>
- <para>
- You can find a production level detailed example using three
- <productname>Pgpool-II</productname> and two
- <productname>PostgreSQL</productname> in streaming replication
- mode in <xref linkend="example-cluster"> for those who want to
- have a production level <productname>Pgpool-II</productname>
- installation today.
- </para>
- </sect2>
- </sect1>
-
- <sect1 id="install-source">
- <title>Installation of Pgpool-II</title>
- <para>
- This chapter describes the installation
- of <productname>Pgpool-II</productname>. First, installation from
- source code distribution is explained. Then installation from RPM
- packages is explained.
- </para>
- </sect1>
-
- <sect1 id="install-requirements">
- <title>Requirements</title>
-
- <para>
- In general, a modern Unix-compatible platform should be able to run
- <productname>Pgpool-II</>. Windows is not supported.
- </para>
-
- <para>
- The following software packages are required for building
- <productname>Pgpool-II</>:
-
- <itemizedlist>
- <listitem>
- <para>
- <indexterm>
- <primary>make</primary>
- </indexterm>
-
- <acronym>GNU</> <application>make</> version 3.80 or newer is required; other
- <application>make</> programs or older <acronym>GNU</> <application>make</> versions will <emphasis>not</> work.
- (<acronym>GNU</> <application>make</> is sometimes installed under
- the name <filename>gmake</filename>.) To test for <acronym>GNU</acronym>
- <application>make</application> enter:
- <screen>
- <userinput>make --version</userinput>
- </screen>
- </para>
- </listitem>
-
- <listitem>
- <para>
- You need an <acronym>ISO</>/<acronym>ANSI</> C compiler (at least
- C89-compliant). Recent
- versions of <productname>GCC</> are recommended, but
- <productname>Pgpool-II</> is known to build using a wide variety
- of compilers from different vendors.
- </para>
- </listitem>
-
- <listitem>
- <para>
- <application>tar</> is required to unpack the source
- distribution, in addition to <application>gzip</>.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Several packages of <productname>PostgreSQL</productname> are required to
- install <productname>Pgpool-II</productname>. You install postgresql-libs
- and postgresql-devel packages from rpm.
- </para>
- </listitem>
- </itemizedlist>
- </para>
-
- <para>
- If you are building from a <productname>Git</productname> tree instead of
- using a released source package, or if you want to do server development,
- you also need the following packages:
- </para>
-
- <para>
- <itemizedlist>
- <listitem>
- <para>
- <indexterm>
- <primary>flex</primary>
- </indexterm>
- <indexterm>
- <primary>lex</primary>
- </indexterm>
- <indexterm>
- <primary>bison</primary>
- </indexterm>
- <indexterm>
- <primary>yacc</primary>
- </indexterm>
-
- <application>Flex</> and <application>Bison</>
- are needed to build from a Git checkout, or if you changed the actual
- scanner and parser definition files. If you need them, be sure
- to get <application>Flex</> 2.5.31 or later and
- <application>Bison</> 1.875 or later. Other <application>lex</>
- and <application>yacc</> programs cannot be used.
- </para>
- </listitem>
-
- </itemizedlist>
- </para>
-
- <para>
- If you need to get a <acronym>GNU</acronym> package, you can find
- it at your local <acronym>GNU</acronym> mirror site (see <ulink
- url="http://www.gnu.org/order/ftp.html"></>
- for a list) or at <ulink
- url="ftp://ftp.gnu.org/gnu/"></ulink>.
- </para>
-
- <para>
- Also check that you have sufficient disk space. You will need about
- 40 MB for the source tree during compilation and about 20 MB for
- the installation directory. If you are going to
- run the regression tests you will temporarily need up to an extra
- 4 GB. Use the <command>df</command> command to check free disk
- space.
- </para>
- </sect1>
-
- <sect1 id="install-getsource">
- <title>Getting The Source</title>
-
- <para>
- The <productname>Pgpool-II</> &version; sources can be obtained
- from the download section of our
- website: <ulink url="http://www.pgpool.net"></ulink>. You should
- get a file
- named <filename>pgpool-II-&version;.tar.gz</filename>. After you
- have obtained the file, unpack it:
- <screen>
- <userinput>tar xf pgpool-II-&version;.tar.gz</userinput>
- </screen>
- This will create a directory
- <filename>pgpool-II-&version;</filename> under the current directory
- with the <productname>Pgpool-II</> sources.
- Change into that directory for the rest
- of the installation procedure.
- </para>
-
- </sect1>
-
- <sect1 id="install-pgpool">
- <title>Installing Pgpool-II</title>
- <para>
- After extracting the source tarball, execute the <filename>configure</> script.
- <programlisting>
- ./configure
- </programlisting>
- </para>
-
- <para>
- You can customize the build and installation process by supplying one
- or more of the following command line options to
- <filename>configure</filename>:
- </para>
-
- <variablelist>
-
- <varlistentry>
- <term><option>--prefix=path</option></term>
- <listitem>
- <para>
- Specifies the top directory where <productname>Pgpool-II</> binaries and related
- files like docs will be installed in. Default value is <filename>/usr/local</filename>.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>--with-pgsql=path</option></term>
- <listitem>
- <para>
- Specifies the top directory where <productname>PostgreSQL</>'s client libraries are
- installed. Default value is the path provided by <command>pg_config</command> command.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>--with-openssl</option></term>
- <listitem>
- <para>
- <productname>Pgpool-II</productname> binaries will be built
- with <productname>OpenSSL</productname>
- support. <productname>OpenSSL</productname> support is
- disabled by default.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>--enable-sequence-lock</option></term>
- <listitem>
- <para>
- Use insert_lock compatible
- with <productname>Pgpool-II</productname> 3.0 series
- (until 3.0.4). <productname>Pgpool-II</productname> locks
- against a row in the sequence
- table. <productname>PostgreSQL</productname> 8.2 or later
- which was released after June 2011 cannot use this lock
- method.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>--enable-table-lock</option></term>
- <listitem>
- <para>
- Use insert_lock compatible
- with <productname>Pgpool-II</productname> 2.2 and 2.3
- series. <productname>Pgpool-II</productname> locks
- against the insert target table. This lock method is
- deprecated because it causes a lock conflict
- with <command>VACUUM</command>.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>--with-memcached=path</option></term>
- <listitem>
- <para>
- <productname>Pgpool-II</productname> binaries will use <productname>memcached</productname> for in
- memory query cache. You have to
- install <ulink url="http://libmemcached.org/libMemcached.html">libmemcached</ulink>.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>--with-pam</option></term>
- <listitem>
- <para>
- <productname>Pgpool-II</productname> binaries will be built with PAM authentication support.
- PAM authentication support is disabled by default.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
-
- <para>
- <programlisting>
- make
- make install
- </programlisting>
- This will install <productname>Pgpool-II</>. (If you use <productname>Solaris</> or <productname>FreeBSD</>, replace <command>make</> with <command>gmake</>)
- </para>
-
- </sect1>
-
- <sect1 id="install-pgpool-recovery">
- <title>Installing pgpool_recovery</title>
- <para>
- <productname>Pgpool-II</productname> need function of <function>pgpool_recovery</function>,
- <function>pgpool_remote_start</function> and <function>pgpool_switch_xlog</function>,
- when you use the online recovery that describes latter.
- Also pgpoolAdmin of management tool, stop, restart or reload a
- <productname>PostgreSQL</productname> on the screen by use <function>pgpool_pgctl</function>.
- It is enough, if these function installed in template1 first. These
- function do not needed that install in all databases.
- </para>
-
- <para>
- This is required in all <productname>Pgpool-II</productname>
- installation.
- <programlisting>
- $ cd pgpool-II-&version/src/sql/pgpool-recovery
- $ make
- $ make install
- </programlisting>
- After this:
- <programlisting>
- $ psql template1
- =# CREATE EXTENSION pgpool_recovery;
- </programlisting>
-
- or
- <programlisting>
- $ psql -f pgpool-recovery.sql template1
- </programlisting>
-
- </para>
-
- <para>
- With <productname>Pgpool-II</productname> 3.3 or later, you need
- to tweak <filename>postgresql.conf</filename>. Suppose the path
- to <command>pg_ctl</command>
- is <filename>/usr/local/pgsql/bin/pg_ctl</filename>. Then you
- add following to <filename>postgresql.conf</filename>.
-
- <programlisting>
- pgpool.pg_ctl = '/usr/local/pgsql/bin/pg_ctl'
- </programlisting>
-
- Probably you want to execute following after this:
- <programlisting>
- $ pg_ctl reload -D /usr/local/pgsql/data
- </programlisting>
-
- </para>
- </sect1>
-
- <sect1 id="install-pgpool-regclass">
- <title>Installing pgpool-regclass</title>
- <para>
- If you are using <productname>PostgreSQL</productname> 9.4 or
- later, you can skip this section.
- </para>
-
- <para>
- If you are using <productname>PostgreSQL</productname> 8.0
- to <productname>PostgreSQL</productname> 9.3, installing
- <function>pgpool_regclass</function> function on
- all <productname>PostgreSQL</productname> to be accessed by
- <productname>Pgpool-II</productname> is strongly recommended, as
- it is used internally by <productname>Pgpool-II</productname>.
- Without this, handling of duplicate table names in different
- schema might cause trouble (temporary tables aren't a problem).
- If you are using <productname>PostgreSQL</productname> 9.4 or
- later, installing <function>pgpool_regclass</function> is not
- necessary since an equivalent (<function>to_regclass</function>)
- is included in the <productname>PostgreSQL</productname> core.
- </para>
-
- <para>
- <programlisting>
- $ cd pgpool-II-&version/src/sql/pgpool-regclass
- $ make
- $ make install
- </programlisting>
- After this:
-
- <programlisting>
- $ psql template1
- =# CREATE EXTENSION pgpool_regclass;
- </programlisting>
-
- or
-
- <programlisting>
- $ psql -f pgpool-regclass.sql template1
- </programlisting>
-
- Executing <command>CREATE EXTENSION</command>
- or <filename>pgpool-regclass.sql</filename> should be performed
- on every databases accessed
- via <productname>Pgpool-II</productname>. However, you do not need to
- do this for a database created after the execution of
- <command>CREATE EXTENSION</command> or
- <command>psql -f pgpool-regclass.sql template1</command>,
- as this template database will be cloned to create new databases.
- </para>
-
- </sect1>
-
- <sect1 id="create-installlock-table">
- <title>Creating insert_lock table</title>
-
- <para>
- If you are not going to use the native replication mode, you can skip this section.
- </para>
-
- <para>
- If you plan to use native replication mode and insert_lock,
- creating <structname>pgpool_catalog.insert_lock</structname>
- table for mutual exclusion is strongly recommended. Without
- this, insert_lock works so far. However in that
- case <productname>Pgpool-II</productname> locks against the
- insert target table. This behavior is same
- table lock conflicts with <command>VACUUM</command>, so <command>INSERT</command>
- processing may be thereby kept waiting for a long time.
-
- <programlisting>
- $ cd pgpool-II-&version/src/sql
- $ psql -f insert_lock.sql template1
- </programlisting>
-
- </para>
-
- <para>
- Executing <filename>insert_lock.sql</filename> should be
- performed on every databases accessed
- via <productname>Pgpool-II</productname>. You do not need to
- do this for a database created after the execution of
- <command>psql -f insert_lock.sql template1</command>, as this
- template database will be cloned to create new databases.
- </para>
- </sect1>
-
- <sect1 id="install-docs">
- <title>Compiling and installing documents</title>
-
- <sect2 id="install-docs-tool-sets">
- <title>Tool Sets</title>
-
- <para>
- <productname>Pgpool-II</productname> documents are written in
- SGML (more precisely, DocBook, which is a language implemented
- using SGML). To generate readable HTML documents, you need to
- compile them using docbook tools. To install Docbook tools on
- RHEL or similar systems, use:
- <programlisting>
- yum install docbook-dtds docbook-style-dsssl docbook-style-xsl libxslt openjade
- </programlisting>
- </para>
- </sect2>
-
- <sect2 id="install-docs-make">
- <title>Compiling docs</title>
- <para>
- Once the tool sets are installed on the system, you can compile the docs:
- <programlisting>
- $ cd doc
- $ make
- $ cd ..
- $ cd doc.ja
- $ make
- </programlisting>
- You will see English HTML docs under doc/src/sgml/html, and online docs under sgml/man[1-8].
- Japanese docs can be found under doc.ja/src/sgml/html, and online docs under sgml/man[1-8].
- </para>
- </sect2>
- </sect1>
-
- &installation-rpm;
-
- &installation-tips;
-
-</chapter>
+++ /dev/null
-<!-- doc/src/sgml/intro.sgml -->
-
-<preface id="preface">
- <!--
- <title>Preface</title>
- -->
- <title>前言</title>
-
- <para>
- This book is the official documentation of
- <productname>Pgpool-II</productname>. It has been written by the
- <productname>Pgpool-II</productname> developers and other
- volunteers in parallel to the development of the
- <productname>Pgpool-II</productname> software. It describes all
- the functionality that the current version of
- <productname>Pgpool-II</productname> officially supports.
- </para>
-
- <para>
- To make the large amount of information about
- <productname>Pgpool-II</productname> manageable, this book has been
- organized in several parts. Each part is targeted at a different
- class of users, or at users in different stages of their
- <productname>Pgpool-II</productname> experience:
-
- <itemizedlist>
- <listitem>
- <para>
- <xref linkend="tutorial"> is an informal introduction for new users.
- </para>
- </listitem>
-
- <listitem>
- <para>
- <xref linkend="admin"> describes the installation and
- administration of the server. Everyone who runs a
- <productname>Pgpool-II</productname> server, be it for private
- use or for others, should read this part.
- </para>
- </listitem>
-
- <listitem>
- <para>
- <xref linkend="examples"> explains several configuration examples
- so that users can choose the starting point of their actual systems.
- </para>
- </listitem>
-
- <listitem>
- <para>
- <xref linkend="reference"> contains reference information about
- SQL commands, client and server programs. This part supports
- the other parts with structured information sorted by command or
- program.
- </para>
- </listitem>
-
- <listitem>
- <para>
- <xref linkend="appendixes"> is an appendix information such as release notes.
- </para>
- </listitem>
-
- <!--
- <listitem>
- <para>
- <xref linkend="internals"> contains assorted information that might be of
- use to <productname>PostgreSQL</> developers.
- </para>
- </listitem>
- -->
-
- </itemizedlist>
- </para>
-
- <sect1 id="intro-whatis">
- <!--
- <title> What is <productname>Pgpool-II</productname>?</title>
- -->
- <title>什么是<productname>Pgpool-II</productname>?</title>
- <para>
- <productname>Pgpool-II</productname> is a proxy software that sits
- between <productname>PostgreSQL</productname> servers and a
- <productname>PostgreSQL</productname> database client. It provides
- the following features:
-
- <variablelist>
-
- <varlistentry>
- <term>Connection Pooling</term>
- <listitem>
- <para>
- <productname>Pgpool-II</productname> maintains established
- connections to the <productname>PostgreSQL</productname>
- servers, and reuses them whenever a new connection with the
- same properties (i.e. user name, database, protocol version, and other connection parameters if any)
- comes in. It reduces the connection overhead, and improves
- system's overall throughput.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>Load Balancing</term>
- <listitem>
- <para>
- If a database is replicated (because running in either
- replication mode or native replication mode), performing a SELECT
- query on any server will return the same result. <productname>Pgpool-II</productname>
- takes advantage of the replication feature in order to reduce
- the load on each PostgreSQL server. It does that by
- distributing SELECT queries among available servers, improving
- the system's overall throughput. In an ideal scenario, read
- performance could improve proportionally to the number of
- PostgreSQL servers. Load balancing works best in a scenario
- where there are a lot of users executing many read-only
- queries at the same time.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>Automated fail over</term>
- <listitem>
- <para>
- If one of the database servers goes down or becomes unreachable,
- <productname>Pgpool-II</productname> will detach it and will continue operations by using the rest
- of database servers. There are some sophisticated features that
- help the automated failover including timeouts and retries.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>Online Recovery</term>
- <listitem>
- <para>
- <productname>Pgpool-II</productname> can perform online recovery of database
- node by executing one command. When the online recovery is used with the
- automated fail over, a detached node by fail over is possible to attach as
- standby node automatically. It is possible to synchronize and attach new
- <productname>PostgreSQL</productname> server too.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>Replication</term>
- <listitem>
- <para>
- <productname>Pgpool-II</productname> can manage
- multiple <productname>PostgreSQL</productname>
- servers. Activating the replication feature makes it possible
- to create a real time backup on 2 or
- more <productname>PostgreSQL</productname> clusters, so that
- the service can continue without interruption if one of those
- clusters fails. <productname>Pgpool-II</productname> has
- built-in replication (native replication). However user can
- use external replication features including streaming
- replication of <productname>PostgreSQL</productname>.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>Limiting Exceeding Connections</term>
- <listitem>
- <para>
- There is a limit on the maximum number of concurrent
- connections with <productname>PostgreSQL</productname>, and
- new connections are rejected when this number is
- reached. Raising this maximum number of connections, however,
- increases resource consumption and has a negative impact on
- overall system
- performance. <productname>Pgpool-II</productname> also has a
- limit on the maximum number of connections, but extra
- connections will be queued instead of returning an error
- immediately. However, you can configure to return an error
- when the connection limit is exceeded (4.1 or later).
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>Watchdog</term>
- <listitem>
- <para>
- Watchdog can coordinate multiple <productname>Pgpool-II</productname>,
- create a robust cluster system and avoid the single point of failure or split brain.
- To avoid the split brain, you need at least 3 <productname>Pgpool-II</productname> nodes.
- Watchdog can perform lifecheck against other <productname>pgpool-II</productname> nodes,
- to detect a fault of <productname>Pgpool-II</productname>.
- If active <productname>Pgpool-II</productname> goes down, standby
- <productname>Pgpool-II</productname> can be promoted to active, and take over Virtual IP.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>In Memory Query Cache</term>
- <listitem>
- <para>
- In memory query cache allows to save a pair of SELECT statement and its result.
- If an identical SELECTs comes in, <productname>Pgpool-II</productname> returns the
- value from cache. Since no SQL parsing nor access to <productname>PostgreSQL</productname>
- are involved, using in memory cache is extremely fast. On the other hand, it might
- be slower than the normal path in some cases, because it adds some overhead of storing cache data.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
-
- </para>
-
- <para>
- <productname>Pgpool-II</productname> speaks PostgreSQL's backend
- and frontend protocol, and relays messages between a backend and a
- frontend. Therefore, a database application (frontend) thinks
- that <productname>Pgpool-II</productname> is the
- actual <productname>PostgreSQL</productname> server, and the
- server (backend) sees <productname>Pgpool-II</productname> as one
- of its clients. Because
- <productname>Pgpool-II</productname> is transparent to both the server and the client, an
- existing database application can be used with <productname>Pgpool-II</productname> almost
- without a change to its source code.
- </para>
-
- <para>
- <productname>Pgpool-II</productname> works on Linux, Solaris,
- FreeBSD, and most of the UNIX-like architectures. Windows is not
- supported. Supported PostgreSQL server's versions are 7.4 and
- higher. You must also make
- sure that all of your <productname>PostgreSQL</productname>
- servers are using the same major version. In addition to this, we
- do not recommend mixing
- different <productname>PostgreSQL</productname> installation with
- different build options: including supporting SSL or not, to use
- --disable-integer-datetimes or not, different block size. These
- might affect part of functionality
- of <productname>Pgpool-II</productname>. The difference of
- <productname>PostgreSQL</productname> minor versions is not
- usually a problem. However we do not test every occurrence of
- minor versions and we recommend to use exact same minor version of
- <productname>PostgreSQL</productname>.
- </para>
-
- <para>
- There are some restrictions to using SQL via <productname>Pgpool-II</productname>.
- See <link linkend="restrictions">Restrictions</link> for more details.
- </para>
-
- </sect1>
-
- &history;
- ¬ation;
- &info;
- &restrictions;
- &problems;
-
-</preface>
+++ /dev/null
-% doc/src/sgml/jadetex.cfg
-%
-% This file redefines \FlowObjectSetup and some related macros to greatly
-% reduce the number of control sequence names created, and also to avoid
-% creation of many useless hyperlink anchors (bookmarks) in PDF files.
-%
-% The original coding of \FlowObjectSetup defined a control sequence x@LABEL
-% for pretty nearly every flow object in the file, whether that object was
-% cross-referenced or not. Worse yet, it created a hyperlink anchor for
-% every such object, which not only bloated the output PDF with useless
-% anchors but consumed an additional control sequence name per anchor.
-% This results in overrunning TeX's limited-size string pool.
-%
-% To fix, extend \PageLabel's already-existing mechanism whereby a p@LABEL
-% control sequence is filled in only for labels that are referenced by at
-% least one \Pageref call. We now also fill in p@LABEL for labels that are
-% referenced by a \Link. Then, we can drop x@LABEL entirely, and use p@LABEL
-% to control emission of both a hyperlink anchor and a page-number label.
-% Now, both of those things are emitted for all and only the flow objects
-% that have either a hyperlink reference or a page-number reference.
-% We consume about one control sequence name per flow object plus one per
-% referenced object, which is a lot better than three per flow object.
-%
-% (With a more invasive patch, we could track the need for an anchor and a
-% page-number label separately, but that would probably require two control
-% sequences for every flow object. Besides, many objects that have one kind
-% of reference will have the other one too; that's certainly true for objects
-% referenced in either the TOC or the index, for example.)
-%
-%
-% In addition to checking p@LABEL not x@LABEL, this version of \FlowObjectSetup
-% is fixed to clear \Label and \Element whether or not it emits an anchor
-% and page label. Failure to do that seems to explain some pre-existing bugs
-% in which certain SGML constructs weren't correctly cross-referenced.
-%
-\def\FlowObjectSetup#1{%
-\ifDoFOBSet
- \ifLabelElements
- \ifx\Label\@empty\let\Label\Element\fi
- \fi
- \ifx\Label\@empty\else
- \expandafter\ifx\csname p@\Label\endcsname\relax
- \else
- \bgroup
- \ifNestedLink
- \else
- \hyper@anchorstart{\Label}\hyper@anchorend
- \PageLabel{\Label}%
- \fi
- \egroup
- \fi
- \let\Label\@empty
- \let\Element\@empty
- \fi
-\fi
-}
-%
-% Adjust \PageLabel so that the p@NAME control sequence acquires a correct
-% value immediately; this seems to be needed to avoid scenarios wherein
-% additional TeX runs are needed to reach a stable state of the .aux file.
-%
-\def\PageLabel#1{%
- \@bsphack
- \expandafter\ifx\csname p@#1\endcsname\relax
- \else
- \protected@write\@auxout{}%
- {\string\pagelabel{#1}{\thepage}}%
- % Ensure the p@NAME control sequence acquires correct value immediately
- \expandafter\xdef\csname p@#1\endcsname{\thepage}%
- \fi
- \@esphack}
-%
-% In \Link, add code to emit an aux-file entry if the p@NAME sequence isn't
-% defined. Much as in \@Setref, this ensures we'll process the referenced
-% item correctly on the next TeX run.
-%
-\def\Link#1{%
- \begingroup
- \SetupICs{#1}%
- \ifx\Label\@empty\let\Label\Element\fi
-% \typeout{Made a Link at \the\inputlineno, to \Label}%
- \hyper@linkstart{\LinkType}{\Label}%
- \NestedLinktrue
- % If p@NAME control sequence isn't defined, emit dummy def to aux file
- % so it will get defined properly on next run, much as in \@Setref
- \expandafter\ifx\csname p@\Label\endcsname\relax
- \immediate\write\@mainaux{\string\pagelabel{\Label}{qqq}}%
- \fi
-}
+++ /dev/null
-<!-- doc/src/sgml/legal.sgml -->
-
-<date>2020</date>
-
-<copyright>
- <year>2003-2020</year>
- <holder>The Pgpool Global Development Group</holder>
-</copyright>
-
-<legalnotice id="legalnotice">
- <title>Legal Notice</title>
-
- <para>
- <productname>Pgpool and Pgpool-II</productname> are Copyright © 2003-2020
- by the Pgpool Global Development Group.
- </para>
-
- <para>
- <productname>PostgreSQL</productname> are Copyright © 1996-2020
- by the PostgreSQL Global Development Group.
- </para>
-
- <para>
- Permission to use, copy, modify, and distribute this software and
- its documentation for any purpose, without fee, and without a
- written agreement is hereby granted, provided that the above
- copyright notice and this paragraph and the following two paragraphs
- appear in all copies.
- </para>
-
- <para>
- IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY
- PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
- DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS
- SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA
- HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- </para>
-
- <para>
- THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
- PROVIDED HEREUNDER IS ON AN <quote>AS-IS</quote> BASIS, AND THE UNIVERSITY OF
- CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
- UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
- </para>
-
-</legalnotice>
+++ /dev/null
-<!-- doc/src/sgml/config.sgml -->
-
-<sect1 id="runtime-config-load-balancing">
- <title>Load Balancing</title>
-
- <para>
- <productname>Pgpool-II</productname> load balancing of SELECT queries
- works with any clustering mode except raw mode. When enabled
- <productname>Pgpool-II</productname> sends the writing queries to the
- <acronym>primary node</acronym> in Native Replication mode, all of the
- backend nodes in Replication mode, and other queries get load
- balanced among all backend nodes. To which node the load
- balancing mechanism sends read queries is decided at the session
- start time and will not be changed until the session ends unless <xref linkend="guc-statement-level-load-balance"> is specified. However
- there are some exceptions. See below for more details.
- </para>
- <note>
- <para>
- Queries which are sent to primary node or replicated because they cannot be balanced are
- also accounted for in the load balancing algorithm.
- </para>
- </note>
-
- <note>
- <para>
- You can check which DB node is assigned as the load balancing
- node by using <xref linkend="sql-show-pool-nodes">.
- </para>
- </note>
-
- <sect2 id="runtime-config-load-balancing-condition">
- <title>Condition for Load Balancing</title>
-
- <para>
- For a query to be load balanced, all the following requirements
- must be met:
- <itemizedlist>
- <listitem>
- <para>
- <productname>PostgreSQL</> version 7.4 or later
- </para>
- </listitem>
- <listitem>
- <para>
- either in replication mode or native replication mode
- </para>
- </listitem>
- <listitem>
- <para>
- the query must not be in an explicitly declared transaction
- (i.e. not in a BEGIN ~ END block)
- </para>
- <itemizedlist>
- <listitem>
- <para>
- However, if following conditions are met, load balance is possible
- even if in an explicit transaction
- <itemizedlist>
- <listitem>
- <para>
- transaction isolation level is not SERIALIZABLE
- </para>
- </listitem>
- <listitem>
- <para>
- transaction has not issued a write query yet (until a write
- query is issued, load balance is possible. Here "write query"
- means non SELECT DML or DDL. <EMPHASIS>Before <productname>Pgpool-II</> 4.1</>,
- SELECTs having write functions as specified in write or
- read_only function list is not regarded as a write query.)
- </para>
- </listitem>
- <listitem>
- <para>
- If write and read_only function list is empty, SELECT having
- functions which are not volatile is regarded as a read only query.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </itemizedlist>
- </listitem>
- <listitem>
- <para>
- it's not SELECT INTO
- </para>
- </listitem>
- <listitem>
- <para>
- it's not SELECT FOR UPDATE nor FOR SHARE
- </para>
- </listitem>
- <listitem>
- <para>
- it starts with "SELECT" or one of COPY TO STDOUT, EXPLAIN,
- EXPLAIN ANALYZE SELECT... <xref linkend="guc-ignore-leading-white-space"> = <literal>true</>
- will ignore leading white space.
- (Except for SELECTs using writing functions specified in <xref linkend="guc-write-function-list"> or
- <xref linkend="guc-read-only-function-list">)
- </para>
- </listitem>
- <listitem>
- <para>
- in native replication mode, in addition to above, following conditions must be met:
- </para>
- <itemizedlist>
- <listitem>
- <para>
- does not use temporary tables
- </para>
- </listitem>
- <listitem>
- <para>
- does not use unlogged tables
- </para>
- </listitem>
- <listitem>
- <para>
- does not use system catalogs
- </para>
- </listitem>
- </itemizedlist>
- </listitem>
- </itemizedlist>
- </para>
-
- <note>
- <para>
- You could suppress load balancing by inserting arbitrary
- comments just in front of the SELECT query:
- </para>
- <programlisting>
- /*REPLICATION*/ SELECT ...
- </programlisting>
- <para>
- If you want to use comments without suppressing load balancing, you can set
- <xref linkend="guc-allow-sql-comments"> to on.
- Please refer to <xref linkend="guc-replicate-select"> as well.
- </para>
- </note>
-
- <note>
- <para>
- The JDBC driver has an autocommit option. If the autocommit is false,
- the JDBC driver sends "BEGIN" and "COMMIT" by itself. In this case
- the same restriction above regarding load balancing will be applied.
- </para>
- </note>
-
- </sect2>
-
- <sect2 id="runtime-config-writing-queries-may-affect-load-balancing">
-
- <title>Writing queries may affect Load Balancing</title>
- <para>
- In general, read queries are load balanced if certain conditions
- are met. However, writing queries may affect the load
- balancing. Here "writing queries" mean all the queries except
- below:
- </para>
-
- <para>
- <itemizedlist>
-
- <listitem>
- <para>
- SELECT/WITH without writing functions.
- Volatile functions are regarded writing functions.
- You can define your own writing functions by using <xref linkend="guc-write-function-list">
- or <xref linkend="guc-read-only-function-list">.
- </para>
- </listitem>
-
- <listitem>
- <para>
- SELECT/WITH without FOR UPDATE/SHARE
- </para>
- </listitem>
-
- <listitem>
- <para>
- WITH without DML statements
- </para>
- </listitem>
-
- <listitem>
- <para>
- COPY TO STDOUT
- </para>
- </listitem>
-
- <listitem>
- <para>
- EXPLAIN
- </para>
- </listitem>
-
- <listitem>
- <para>
- EXPLAIN ANALYZE and the query is SELECT not including writing functions
- </para>
- </listitem>
-
- <listitem>
- <para>
- SHOW
- </para>
- </listitem>
-
- </itemizedlist>
- </para>
-
- <para>
- If writing queries appear, succeeding read queries may not be
- load balanced. i.e. sent to primary node (in streaming
- replication mode) or main node (in other mode) depending on the
- setting of <xref linkend="guc-disable-load-balance-on-write">.
- </para>
- </sect2>
-
- <sect2 id="runtime-config-load-balancing-in-streaming-replication">
-
- <title>Load Balancing in Streaming Replication</title>
-
- <para>
- While using Streaming replication and Hot Standby, it is important to
- determine which query can be sent to the primary or the standby,
- and which one should not be sent to the standby.
- <productname>Pgpool-II</>'s Streaming Replication mode carefully
- takes care of this.
- </para>
-
- <para>
- We distinguish which query should be sent to which node by looking
- at the query itself.
- <itemizedlist>
- <listitem>
- <para>
- These queries should be sent to the primary node only
- <itemizedlist>
- <listitem>
- <para>
- INSERT, UPDATE, DELETE, COPY FROM, TRUNCATE, CREATE, DROP, ALTER, COMMENT
- </para>
- </listitem>
- <listitem>
- <para>
- SELECT ... FOR SHARE | UPDATE
- </para>
- </listitem>
- <listitem>
- <para>
- SELECT in transaction isolation level SERIALIZABLE
- </para>
- </listitem>
- <listitem>
- <para>
- LOCK command more strict than ROW EXCLUSIVE MODE
- </para>
- </listitem>
- <listitem>
- <para>
- DECLARE, FETCH, CLOSE
- </para>
- </listitem>
- <listitem>
- <para>
- SHOW
- </para>
- </listitem>
- <listitem>
- <para>
- Some transactional commands:
- <itemizedlist>
- <listitem>
- <para>
- BEGIN READ WRITE, START TRANSACTION READ WRITE
- </para>
- </listitem>
- <listitem>
- <para>
- SET TRANSACTION READ WRITE, SET SESSION CHARACTERISTICS AS TRANSACTION READ WRITE
- </para>
- </listitem>
- <listitem>
- <para>
- SET transaction_read_only = off
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- <listitem>
- <para>
- Two phase commit commands: PREPARE TRANSACTION, COMMIT PREPARED, ROLLBACK PREPARED
- </para>
- </listitem>
- <listitem>
- <para>
- LISTEN, UNLISTEN, NOTIFY
- </para>
- </listitem>
- <listitem>
- <para>
- VACUUM
- </para>
- </listitem>
- <listitem>
- <para>
- Some sequence functions (nextval and setval)
- </para>
- </listitem>
- <listitem>
- <para>
- Large objects creation commands
- </para>
- </listitem>
- <listitem>
- <para>
- Multi-statement queries (multiple SQL commands on single line)
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- <listitem>
- <para>
- These queries can be sent to both the primary node and the standby node.
- If load balancing is enabled, these types of queries can be sent to the standby node.
- However, if delay_threshold is set and the replication delay is higher than
- <xref linkend="guc-delay-threshold">, queries are sent to the primary node.
-
- <itemizedlist>
- <listitem>
- <para>
- SELECT not listed above
- </para>
- </listitem>
-
- <listitem>
- <para>
- COPY TO STDOUT
- </para>
- </listitem>
-
- <listitem>
- <para>
- EXPLAIN
- </para>
- </listitem>
-
- <listitem>
- <para>
- EXPLAIN ANALYZE and the query is SELECT not including writing functions
- </para>
- </listitem>
-
- <listitem>
- <para>
- SHOW
- </para>
- </listitem>
-
- </itemizedlist>
- </para>
- </listitem>
- <listitem>
- <para>
- These queries are sent to both the primary node and the standby node
- <itemizedlist>
- <listitem>
- <para>
- SET
- </para>
- </listitem>
- <listitem>
- <para>
- DISCARD
- </para>
- </listitem>
- <listitem>
- <para>
- DEALLOCATE ALL
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </itemizedlist>
- </para>
-
- <para>
- In an explicit transaction:
- <itemizedlist>
-
- <listitem>
- <para>
- Transaction starting commands such as BEGIN are sent to both the primary node
- and the standby node.
- </para>
- </listitem>
- <listitem>
- <para>
- Following SELECT and some other queries that can be sent to both
- primary or standby are executed in the transaction or on the standby node.
- </para>
- </listitem>
- <listitem>
- <para>
- Commands which cannot be executed on the standby such as INSERT are sent
- to the primary.
- After one of these commands, even SELECTs are sent to the primary node,
- This is because these SELECTs might want to see the result of an INSERT immediately.
- This behavior continues until the transaction closes or aborts.
- </para>
- </listitem>
- </itemizedlist>
- </para>
-
- <para>
- In the extended protocol, it is possible to determine if the query can
- be sent to standby or not in load balance mode while parsing the query.
- The rules are the same as for the non extended protocol.
- For example, INSERTs are sent to the primary node.
- Following bind, describe and execute will be sent to the primary node as well.
- </para>
-
- <note>
- <para>
- If the parse of a SELECT statement is sent to the standby node due to load
- balancing, and then a DML statement, such as an INSERT, is sent to <productname>Pgpool-II</>,
- then the parsed SELECT will have to be executed on the primary node.
- Therefore, we re-parse the SELECT on the primary node.
- </para>
- </note>
-
- <para>
- Lastly, queries that <productname>Pgpool-II</>'s parser thinks to be an
- error are sent to the primary node.
- </para>
- </sect2>
-
- <sect2 id="runtime-config-load-balancing-settings">
-
- <title>Load Balancing Settings</title>
-
- <variablelist>
-
- <varlistentry id="guc-load-balance-mode" xreflabel="load_balance_mode">
- <term><varname>load_balance_mode</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>load_balance_mode</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- When set to on, <productname>Pgpool-II</productname> enables the
- load balancing on incoming <acronym>SELECT</acronym> queries.
- i.e. <acronym>SELECT</acronym> queries from the clients gets distributed to
- the configured <productname>PostgreSQL</> backends.
- Default is off.
- </para>
- <para>
- This parameter can only be set at server start.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-ignore-leading-white-space" xreflabel="ignore_leading_white_space">
- <term><varname>ignore_leading_white_space</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>ignore_leading_white_space</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- When set to on, <productname>Pgpool-II</productname> ignores the
- white spaces at the beginning of SQL queries in load balancing.
- It is useful if used with APIs like DBI/DBD:Pg which adds
- white spaces against the user's intention.
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-read-only-function-list" xreflabel="read_only_function_list">
- <term><varname>read_only_function_list</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>read_only_function_list</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies a comma separated list of function names that
- <emphasis>DO NOT</emphasis> update the database. SELECTs including
- functions <emphasis>not specified </emphasis> in this list are not load balanced.
- These are replicated among all the DB nodes in Replication mode,
- sent to the primary node only in other mode.
- </para>
- <para>
- You can use regular expression to match function names,
- to which <literal>^</> and <literal>$</> are automatically added.
- </para>
-
- <example id="example-read-only-function-list-1">
- <title>Using regular expression</title>
- <para>
- If you have prefixed all your read only function
- with 'get_' or 'select_', You can
- set the <xref linkend="guc-read-only-function-list"> like below:
- <programlisting>
- read_only_function_list = 'get_.*,select_.*'
- </programlisting>
- </para>
- </example>
-
- <note>
- <para>
- If the queries can refer to the function with and without the schema
- qualification then you must add both entries (with and without
- schema name) in the list.
- <programlisting>
- #For example:
- #If the queries sometime use "f1()" and other times "public.f1()"
- #to refer the function f1 then the read_only_function_list
- #would be configured as follows.
-
- read_only_function_list = "f1,public.f1"
-
- </programlisting>
-
- </para>
- </note>
-
- <note>
- <para>
- If this parameter and <xref linkend="guc-write-function-list">
- is empty string, function's volatile proper will be checked. If
- the property is volatile, the function is regarded as a writing
- function. This is convenient and recommended way. However this
- requires one extra query against system catalog for the first
- time (in the next time cached query result is used and no extra
- query will be sent). If you don't want to send such query, you
- can keep on using this parameter.
- </para>
- </note>
-
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-write-function-list" xreflabel="write_function_list">
- <term><varname>write_function_list</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>write_function_list</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies a comma separated list of function names that
- <emphasis>DO</emphasis> update the database.
- SELECTs including functions <emphasis>specified</emphasis> in this list are
- not load balanced.
- These are replicated among all the DB nodes in Replication mode,
- sent to the primary node only in other mode.
- </para>
- <para>
- You can use regular expression to match function names,
- to which <literal>^</> and <literal>$</> are automatically added.
- </para>
-
- <example id="example-write-function-list-1">
- <title>Using regular expression</title>
- <para>
- If you have prefixed all your updating functions
- with 'set_', 'update_', 'delete_' or 'insert_', You can
- set the <xref linkend="guc-write-function-list"> like below:
- <programlisting>
- write_function_list = 'nextval,setval,set_.*,update_.*,delete_.*,insert_.*'
- </programlisting>
- </para>
- </example>
-
- <note>
- <para>
- If the queries can refer the function with and without the schema
- qualification then you must add both entries(with and without
- schema name) in the list.
- <programlisting>
- #For example:
- #If the queries sometime use "f1()" and other times "public.f1()"
- #to refer the function f1 then the write_function_list
- #would be configured as follows.
-
- write_function_list = "f1,public.f1"
-
- </programlisting>
-
- </para>
- </note>
-
- <note>
- <para>
- <xref linkend="guc-write-function-list"> and <xref linkend="guc-read-only-function-list">
- are mutually exclusive and only one of the two lists can be set in the configuration.
- </para>
- </note>
-
- <example id="example-write-function-list-2">
- <title>Configuring using <literal>nextval()</literal> and <literal>setval()</literal> to land on proper backend</title>
- <para>
- Prior to <productname>Pgpool-II</productname><emphasis>V3.0</emphasis>,
- <literal>nextval()</literal> and <literal>setval()</literal> were known as functions writing to the database.
- You can configure this by setting <xref linkend="guc-write-function-list">
- and <xref linkend="guc-read-only-function-list"> as follows
- <programlisting>
- read_only_function_list = ''
- write_function_list = 'nextval,setval,lastval,currval'
- </programlisting>
- </para>
- </example>
-
- <note>
- <para>
- <productname>PostgreSQL</> also contains <literal>lastval()</literal> and
- <literal>currval()</literal> in addition to
- <literal>nextval()</literal> and <literal>setval()</literal>.
- Though <literal>lastval()</literal> and <literal>currval()</literal>
- are not writing function type, but it is advised to treat
- <literal>lastval()</literal> and <literal>currval()</literal>
- as writing functions to avoid errors which occur when
- these functions are accidentally load balanced.
- </para>
- </note>
-
- <note>
- <para>
- If this parameter and <xref linkend="guc-read-only-function-list">
- is empty string, function's volatile proper will be checked. If
- the property is volatile, the function is regarded as a writing
- function. This is convenient and recommended way. However this
- requires one extra query against system catalog for the first
- time (in the next time cached query result is used and no extra
- query will be sent). If you don't want to send such query, you
- can keep on using this parameter.
- </para>
- </note>
-
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-primary-routing-query-pattern-list" xreflabel="primary_routing_query_pattern_list">
- <term><varname>primary_routing_query_pattern_list</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>primary_routing_query_pattern_list</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies a semicolon separated list of SQL patterns that
- should be sent to primary node.
- SQL that matched patterns specified in this list are
- not load balanced.
- Other than Only Native Replication mode is supported.
- </para>
- <para>
- You can use regular expression to match SQL patterns,
- to which <literal>^</> and <literal>$</> are automatically added.
- When using special characters in regular expressions
- (such as "'", ";", "*", "(", ")", "|", "+", ".", "\", "?", "^", "$",
- "{","}", "{" or "}", etc.)
- in SQL patterns, you need to escape them by using "\".
- SQL pattern specified in this parameter is case-insensitive.
- </para>
-
- <example id="example-primary-routing-query-pattern-list-1">
- <title>Using regular expression</title>
- <para>
- If the following SQL should be sent to the primary node only, You can
- set the <xref linkend="guc-primary-routing-query-pattern-list"> like below:
- <itemizedlist>
- <listitem>
- <para>
- SELECT * FROM table_name1;
- </para>
- </listitem>
- <listitem>
- <para>
- SELECT col1, col2 FROM table_name2 WHERE col1 LIKE '%a%';
- </para>
- </listitem>
- <listitem>
- <para>
- SQL including table_name3
- </para>
- </listitem>
- </itemizedlist>
- </para>
-
- <para>
- <programlisting>
- primary_routing_query_pattern_list = 'SELECT \* FROM table_name1\;;SELECT col1, col2 FROM table_name2 WHERE col1 LIKE \'%a%\'\;;.*table_name3.*'
- </programlisting>
- </para>
- </example>
-
- <note>
- <para>
- If SQL matches both <xref linkend="guc-write-function-list"> and
- <xref linkend="guc-read-only-function-list">, <xref linkend="guc-read-only-function-list">
- setting is ignored and the SQL should be sent only to the primary node.
- </para>
- </note>
- <para>
- Depending on the SQL patterns, performance might be 1-2% lower when using this feature.
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-database-redirect-preference-list" xreflabel="database_redirect_preference_list">
- <term><varname>database_redirect_preference_list</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>database_redirect_preference_list</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the list of <replaceable>"database-name:node id(ratio)"</replaceable> pairs
- to send <acronym>SELECT</acronym> queries to a particular backend
- node for a particular database connection at a specified load balance ratio.
- The load balance ratio specifies a value between 0 and 1. The default is 1.0.
- </para>
- <para>
- For example, by specifying "test:1(0.5)", <productname>Pgpool-II</productname>
- will redirect 50% <acronym>SELECT</acronym> queries to the backend node of ID 1 for
- the connection to "test" database.
- You can specify multiple <replaceable>"database name:node id"</replaceable> pair by separating them
- using comma (,).
- </para>
- <para>
- Regular expressions are also accepted for database name.
- You can use special keywords as <replaceable>node id</replaceable>.
- If <emphasis>"primary"</emphasis> is specified, queries are sent to the primary node, and
- if <emphasis>"standby"</emphasis> is specified, one of the standby nodes are selected randomly
- based on weights (<xref linkend="guc-backend-weight">).
- </para>
-
- <example id="example-database-redirect-list">
- <title>Using database_redirect_preference_list</title>
- <para>
- If you want to configure the following <acronym>SELECT</acronym> query routing rules:
- </para>
-
- <itemizedlist>
- <listitem>
- <para>
- Route all <acronym>SELECT</acronym> queries on <literal>postgres</literal>
- database to the primary backend node.
- </para>
- </listitem>
- <listitem>
- <para>
- Route 30% <acronym>SELECT</acronym> queries on <literal>mydb0</literal> or on
- <literal>mydb1</literal> databases to backend node of ID.
- The other 70% <acronym>SELECT</acronym> queries will be sent to other backend nodes.
- </para>
- </listitem>
- <listitem>
- <para>
- Route all <acronym>SELECT</acronym> queries on <literal>mydb2</literal>
- database to standby backend nodes.
- </para>
- </listitem>
-
- </itemizedlist>
- <para>
- then the <xref linkend="guc-database-redirect-preference-list"> will be configured as follows:
- <programlisting>
- database_redirect_preference_list = 'postgres:primary,mydb[01]:1(0.3),mydb2:standby'
- </programlisting>
- </para>
- </example>
-
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-app-name-redirect-preference-list" xreflabel="app_name_redirect_preference_list">
- <term><varname>app_name_redirect_preference_list</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>app_name_redirect_preference_list</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
-
- <para>
- Specifies the list of <replaceable>"application-name:node id(ratio)"</replaceable> pairs
- to send <acronym>SELECT</acronym> queries to a particular backend
- node for a particular client application connection at a specified load balance ratio.
- </para>
-
- <note>
- <para>
- In <productname>PostgreSQL</> <emphasis>V9.0</> or later the "Application name" is a name specified
- by a client when it connects to database.
- </para>
- </note>
-
- <para>
- For example, application name of <command>psql</command> command is
- <literal>"psql"</literal>.
- </para>
-
- <note>
- <para>
- <productname>Pgpool-II</productname> recognizes the application name
- only specified in the start-up packet.
- Although a client can provide the application name
- later in the session, but that does not get considered by the
- <productname>Pgpool-II</productname> for query routing.
- </para>
- </note>
-
- <para>
- The notion of <xref linkend="guc-app-name-redirect-preference-list">
- is same as the <xref linkend="guc-database-redirect-preference-list">
- thus you can also use the regular expressions for application names.
- Similarly special keyword <emphasis>"primary"</emphasis> indicates the primary node and
- <emphasis>"standby"</emphasis> indicates one of standby nodes.
- The load balance weight specifies a value between 0 and 1. The default is 1.0.
- </para>
-
- <example id="example-app-name-redirect-list">
- <title>Using app-name_redirect_preference_list</title>
- <para>
- If you want to configure the following <acronym>SELECT</acronym> query routing rules:
- </para>
-
- <itemizedlist>
- <listitem>
- <para>
- Route all <acronym>SELECT</acronym> from <literal>psql</literal>
- client to the primary backend node.
- </para>
- </listitem>
- <listitem>
- <para>
- Route 30% <acronym>SELECT</acronym> queries from <literal>myapp1</literal>
- client to backend node of ID 1. The other 70% SELECT queries will be sent to other backend nodes.
- </para>
- </listitem>
- <listitem>
- <para>
- Route all <acronym>SELECT</acronym> queries from <literal>myapp2</literal>
- client to standby backend nodes.
- </para>
- </listitem>
-
- </itemizedlist>
- <para>
- then the <xref linkend="guc-app-name-redirect-preference-list"> will be configured as follows:
- <programlisting>
- app_name_redirect_preference_list = 'psql:primary,myapp1:1(0.3),myapp2:standby'
- </programlisting>
- </para>
- </example>
-
- <note>
- <para>
- <xref linkend="guc-app-name-redirect-preference-list"> takes precedence
- over the <xref linkend="guc-database-redirect-preference-list">.
- </para>
- <para>
- For example, if you set
- <literal>database_redirect_preference_list = 'postgres:standby(1.0)'</literal> and
- <literal>app_name_redirect_preference_list = 'myapp1:primary(1.0)'</literal>,
- all SELECT from application myapp1 on postgres database will be sent to primary backend node.
- </para>
- </note>
-
- <note>
- <para>
- By specifying of <xref linkend="guc-app-name-redirect-preference-list"> and
- <xref linkend="guc-database-redirect-preference-list">, when multiple database
- names and application names are matched, the first setting will be used.
- </para>
- <para>
- For example, if you set
- <literal>database_redirect_preference_list = 'postgres:primary,postgres:standby'</literal>,
- <literal>"postgres: primary"</literal> will be used.
- </para>
- </note>
-
- <caution>
- <para>
- <acronym>JDBC</acronym> driver PostgreSQL-9.3 and earlier versions
- does not send the application name in the startup packet even if
- the application name is specified using the <acronym>JDBC</acronym>
- driver option <literal>"ApplicationName"</literal> and
- <literal>"assumeMinServerVersion=9.0"</literal>.
- So if you want to use the <xref linkend="guc-app-name-redirect-preference-list">
- feature through <acronym>JDBC</acronym>, Use PostgreSQL-9.4 or later version of the driver.
- </para>
- </caution>
-
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-allow-sql-comments" xreflabel="allow_sql_comments">
- <term><varname>allow_sql_comments</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>allow_sql_comments</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- When set to on, <productname>Pgpool-II</productname> ignore the
- <acronym>SQL</acronym> comments when identifying if the load balance
- or query cache is possible on the query.
- When this parameter is set to off, the <acronym>SQL</acronym> comments
- on the query could effectively prevent the query from being
- load balanced or cached (pre <productname>Pgpool-II</productname>
- <emphasis>V3.4</emphasis> behavior).
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- You can also use <xref linkend="SQL-PGPOOL-SET"> command to alter the value of
- this parameter for a current session.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-disable-load-balance-on-write" xreflabel="disable_load_balance_on_write">
- <term><varname>disable_load_balance_on_write</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>disable_load_balance_on_write</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specify load balance behavior after write queries appear.
- This parameter is especially useful in streaming replication
- mode. When write queries are sent to primary server, the
- changes are applied to standby servers but there's a time
- lag. So if a client read the same row right after the write
- query, the client may not see the latest value of the
- row. If that's the problem, clients should always read data
- from the primary server. However this effectively disables
- load balancing, which leads to lesser performance. This
- parameter allows a fine tuning for the trade off between
- not-clustering-aware applications compatibility and
- performance.
- </para>
- <para>
- If this parameter is set to <varname>off</varname>, read
- queries are load balanced even if write queries appear. This
- gives the best load balance performance but clients may see
- older data. This is useful for an environment where
- PostgreSQL parameter synchronous_commit = 'remote_apply', or
- in the native replication mode, since there's no replication
- delay in such environments.
- </para>
- <para>
- If this parameter is set to <varname>transaction</varname>
- and write queries appear in an explicit transaction,
- subsequent read queries are not load balanced until the
- transaction ends. Please note that read queries not in an
- explicit transaction are not affected by the parameter. This
- setting gives the best balance in most cases and you should
- start from this. This is the default and same behavior in
- <productname>Pgpool-II 3.7</productname> or before.
- </para>
- <para>
- If this parameter is set
- to <varname>trans_transaction</varname> and write queries
- appear in an explicit transaction, subsequent read queries
- are not load balanced in the transaction and subsequent
- explicit transaction until the session ends. So this
- parameter is safer for older applications but give lesser
- performance than <varname>transaction</varname>. Please note
- that read queries not in an explicit transaction are not
- affected by the parameter.
- </para>
-
- <para>
- If this parameter is set to <varname>always</varname> and
- write queries appear, subsequent read queries are not load
- balanced until the session ends regardless they are in
- explicit transactions or not. This gives the highest
- compatibility with not-clustering-aware applications and the
- lowest performance.
- </para>
-
- <para>
- If this parameter is set to <varname>dml_adaptive</varname> <productname>Pgpool-II</>
- keep track of each TABLE referenced in the WRITE statements within
- the explicit transactions and will not load balances the subsequent
- READ queries if the TABLE they are reading from is previously modified
- inside the same transaction.
- Dependent functions, triggers, and views on the tables can be configured
- using <xref linkend="guc-dml-adaptive-object-relationship-list">
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-dml-adaptive-object-relationship-list" xreflabel="dml_adaptive_object_relationship_list">
- <term><varname>dml_adaptive_object_relationship_list</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>dml_adaptive_object_relationship_list</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
-
- <para>
- To prevent load balancing of READ dependent objects, you may specify the object name
- followed by a colon(<literal>:</>) and then a comma(<literal>,</>) separated list of dependent object names.
- <replaceable>"[object]:[dependent-object]"</replaceable>
- In an explicit transaction block after a WRITE statement has been issues, this will prevent
- load balancing of any READ statements containing references of dependent object(s).
- <example id="example-dml-adaptive-object-relationship-list-1">
- <title>Configuring dml adaptive object relationship</title>
- <para>
- If you have a trigger installed on table_1 that do INSERT in <literal>table_2</> for each
- INSERT on <literal>table_1</>. Then you would want to make sure that
- read on <literal>table_2</> must not get load-balanced within the same transaction
- after INSERT into <literal>table_1</>.
- For this configuration you can set
- <programlisting>
- dml_adaptive_object_relationship_list = 'table_1:table_2'
- </programlisting>
- </para>
- </example>
-
- This parameter is only valid for
- <xref linkend="guc-disable-load-balance-on-write">=<emphasis>'dml_adaptive'</emphasis>
-
- <note>
- <para>
- To configure the dependency on the function,
- The function must be present in the <xref linkend="guc-write-function-list">
- </para>
- </note>
-
- </para>
-
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-statement-level-load-balance" xreflabel="statement_level_load_balance">
- <term><varname>statement_level_load_balance</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>statement_level_load_balance</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- When set to on, the load balancing node is decided for each read query.
- When set to off, load balancing node is decided at the session start time
- and will not be changed until the session ends.
- For example, in applications that use connection pooling remain connections
- open to the backend server, because the session may be held for a long time,
- the load balancing node does not change until the session ends.
- In such applications, When <varname>statement_level_load_balance</varname> is enabled,
- it is possible to decide load balancing node per query, not per session.
- The default is off.
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </sect2>
-</sect1>
+++ /dev/null
-<!-- doc/src/sgml/config.sgml -->
-
-<sect1 id="runtime-in-memory-query-cache">
- <title>In Memory Query Cache</title>
-
- <para>
- In memory query cache can be used with all modes of
- <productname>Pgpool-II</productname>.
- <productname>Pgpool-II</productname> does not
- need a restart when the cache gets outdated because of
- the underlying table updates.
- </para>
- <para>
- In memory cache saves the pair of SELECT statement
- and its result
- (along with the Bind parameters, if the SELECT is an
- extended query). If the same SELECTs comes in,
- <productname>Pgpool-II</productname> returns the value from
- cache. Since no <acronym>SQL</acronym> parsing nor access
- to <productname>PostgreSQL</productname> are involved, the serving
- of results from the in memory cache is extremely fast.
- </para>
-
- <note>
- <para>
- Basically following SELECTs will not be cached:
- <programlisting>
- SELECTs including non immutable functions
- SELECTs including temp tables, unlogged tables
- SELECT result is too large (memqcache_maxcache)
- SELECT FOR SHARE/UPDATE
- SELECT starting with "/*NO QUERY CACHE*/" comment
- SELECT including system catalogs
- SELECT uses TABLESAMPLE
- </programlisting>
- However, VIEWs and SELECTs accessing unlogged tables can be
- cached by specifying in
- the <xref linkend="guc-cache-safe-memqcache-table-list">.
- </para>
- </note>
-
- <para>
- On the other hand, it might be slower than the normal path
- in some cases, because it adds some overhead to store cache.
- Moreover when a table is updated, <productname>Pgpool-II
- </productname> automatically deletes all the caches related to the
- table. Therefore, the performance will be degraded by a system with
- a lot of updates. If the query cache hit ratio (it can be checked
- by using <xref linkend="SQL-SHOW-POOL-CACHE">) is lower than 70%,
- you might want to disable in memory cache.
- </para>
-
- <sect2 id="runtime-in-memory-query-cache-enabling">
- <title>Enabling in memory query cache</title>
-
- <variablelist>
-
- <varlistentry id="guc-memory-cache-enabled" xreflabel="memory_cache_enabled">
- <term><varname>memory_cache_enabled</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>memory_cache_enabled</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Setting to on enables the memory cache.
- Default is off.
- </para>
- <para>
- This parameter can only be set at server start.
- </para>
-
- <note>
- <para>
- The query cache will also be used by shared relation cache if
- <xref linkend="guc-enable-shared-relcache"> is set to on. Moreover the
- query cache is used even if <xref linkend="guc-memory-cache-enabled">
- parameter is set to off. See <xref linkend="runtime-misc"> for more details to relation cache.
- </para>
- </note>
- </listitem>
- </varlistentry>
- </variablelist>
- </sect2>
-
- <sect2 id="runtime-in-memory-query-cache-choose-storage">
- <title>Choosing cache storage</title>
-
- <variablelist>
-
- <varlistentry id="guc-memqcache-method" xreflabel="memqcache_method">
- <term><varname>memqcache_method</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>memqcache_method</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the storage type to be used for the cache.
- Below table contains the list of all valid values for the parameter.
- </para>
-
- <table id="memqcache-method-table">
- <title>Memcache method options</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Value</entry>
- <entry>Description</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry><literal>'shmem'</literal></entry>
- <entry>Use shared memory</entry>
- </row>
-
- <row>
- <entry><literal>'memcached'</literal></entry>
- <entry>Use <ulink url="http://memcached.org/">memcached</ulink></entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
-
- <para>
- Default is <literal>'shmem'</literal>.
- </para>
-
- <para>
- This parameter can only be set at server start.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </sect2>
-
- <sect2 id="runtime-in-memory-query-cache-config">
- <title>Common configurations</title>
- <para>
- These below parameter are valid for both <literal>shmem</literal>
- and <literal>memcached</literal> type query cache.
- </para>
- <variablelist>
-
- <varlistentry id="guc-memqcacheexpire" xreflabel="memqcache_expire">
- <term><varname>memqcache_expire</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>memqcache_expire</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the life time of query cache in seconds.
- Default is 0. which means no cache expiration and cache remains
- valid until the table is updated.
- </para>
- <para>
- This parameter can be changed by reloading
- the <productname>Pgpool-II</productname> configurations.
- </para>
-
- <note>
- <para>
- <varname>memqcache_expire</varname> and
- <xref linkend="guc-memqcache-auto-cache-invalidation"> are orthogonal to each other.
- </para>
- </note>
-
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-memqcache-auto-cache-invalidation" xreflabel="memqcache_auto_cache_invalidation">
- <term><varname>memqcache_auto_cache_invalidation</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>memqcache_auto_cache_invalidation</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Setting to on, automatically deletes the cache related to the updated tables.
- When off, cache is not deleted.
- </para>
- <para>
- Default is on.
- </para>
- <note>
- <para>
- This parameters <xref linkend="guc-memqcache-auto-cache-invalidation">
- and <xref linkend="guc-memqcacheexpire"> are orthogonal to each other.
- </para>
- </note>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</productname> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-memqcache-maxcache" xreflabel="memqcache_maxcache">
- <term><varname>memqcache_maxcache</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>memqcache_maxcache</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the maximum size in bytes of the SELECT query result to be cached.
- The result with data size larger than this value will not be cached by
- <productname>Pgpool-II</productname>.
- When the caching of data is rejected because of the size constraint the following
- message is shown.
- <programlisting>
- LOG: pid 13756: pool_add_temp_query_cache: data size exceeds memqcache_maxcache. current:4095 requested:111 memq_maxcache:4096
- </programlisting>
- </para>
- <note>
- <para>
- For the shared memory query(<literal>'shmem'</literal>) cache the
- <varname>memqcache_maxcache</varname> must be set lower than
- <xref linkend="guc-memqcache-cache-block-size"> and for <literal>'memcached'</literal>
- it must be lower than the size of slab (default is 1 MB).
- </para>
- </note>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</productname> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-cache-safe-memqcache-table-list" xreflabel="cache_safe_memqcache_table_list">
- <term><varname>cache_safe_memqcache_table_list</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>cache_safe_memqcache_table_list</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
-
- <para>
- Specifies a comma separated list of table names whose
- SELECT results should be cached by
- <productname>Pgpool-II</productname>. This parameter only
- applies to VIEWs and SELECTs accessing unlogged tables.
- Regular tables can be cached unless specified
- by <xref linkend="guc-cache-unsafe-memqcache-table-list">.
- </para>
-
- <para>
- You can use regular expression into the list to match table name
- (to which ^ and $ are automatically added).
- </para>
-
- <note>
- <para>
- If the queries can refer the table with and without the schema
- qualification then you must add both entries(with and without
- schema name) in the list.
- <programlisting>
- #For example:
- #If the queries sometime use "table1" and other times "public.table1"
- #to refer the table1 then the cache_safe_memqcache_table_list
- #would be configured as follows.
-
- cache_safe_memqcache_table_list = "table1,public.table1"
-
- </programlisting>
-
- </para>
- </note>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</productname> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-cache-unsafe-memqcache-table-list" xreflabel="cache_unsafe_memqcache_table_list">
- <term><varname>cache_unsafe_memqcache_table_list</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>cache_unsafe_memqcache_table_list</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies a comma separated list of table names whose SELECT
- results should <emphasis>NOT</emphasis> be cached by the <productname>
- Pgpool-II</productname>.
- </para>
-
- <para>
- You can use regular expression into the list to match table name
- (to which ^ and $ are automatically added),
- </para>
-
- <note>
- <para>
- If the queries can refer the table with and without the schema
- qualification then you must add both entries(with and without
- schema name) in the list.
- <programlisting>
- #For example:
- #If the queries sometime use "table1" and other times "public.table1"
- #to refer the table1 then the cache_unsafe_memqcache_table_list
- #would be configured as follows.
-
- cache_unsafe_memqcache_table_list = "table1,public.table1"
-
- </programlisting>
-
- </para>
- </note>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</productname> configurations.
- </para>
- <note>
- <para>
- <varname>cache_unsafe_memqcache_table_list</varname>
- precedence over <xref linkend="guc-cache-safe-memqcache-table-list">
- </para>
- </note>
-
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-memqcache-oiddir" xreflabel="memqcache_oiddir">
- <term><varname>memqcache_oiddir</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>memqcache_oiddir</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the full path to the directory for storing the
- <literal>oids</literal> of tables used by SELECT queries.
- </para>
- <para>
- <varname>memqcache_oiddir</varname> directory contains the sub directories
- for the databases. The directory name is the OID of the database. In addition, each
- database directory contains the files for each table used by SELECT statement.
- Again the name of the file is the OID of the table.
- These files contains the pointers to query cache which are used as key for
- deleting the caches.
- </para>
- <note>
- <para>
- Normal restart of <productname>Pgpool-II</productname> does not clear the
- contents of <varname>memqcache_oiddir</varname>.
- </para>
- </note>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</productname> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </sect2>
-
- <sect2 id="runtime-in-memory-query-cache-shmem-config">
- <title>Configurations to use shared memory</title>
-
- <para>
- These are the parameters used with shared memory as the cache storage.
- </para>
-
- <variablelist>
-
- <varlistentry id="guc-memqcache-total-size" xreflabel="memqcache_total_size">
- <term><varname>memqcache_total_size</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>memqcache_total_size</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the shared memory cache size in bytes.
- </para>
- <para>
- This parameter can only be set at server start.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-memqcache-max-num-cache" xreflabel="memqcache_max_num_cache">
- <term><varname>memqcache_max_num_cache</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>memqcache_max_num_cache</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the number of cache entries. This is used to define the size of cache management space.
- </para>
- <note>
- <para>
- The management space size can be calculated by:
- <varname>memqcache_max_num_cache</varname> * 48 bytes.
- Too small number will cause an error while registering cache.
- On the other hand too large number will just waste space.
- </para>
- </note>
- <para>
- This parameter can only be set at server start.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-memqcache-cache-block-size" xreflabel="memqcache_cache_block_size">
- <term><varname>memqcache_cache_block_size</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>memqcache_cache_block_size</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the cache block size. <productname>Pgpool-II</productname> uses the
- cache memory arranged in <varname>memqcache_cache_block_size</varname> blocks.
- SELECT result is packed into the block and must fit in a single block.
- And the results larger than <varname>memqcache_cache_block_size</varname> are
- not cached.
- </para>
-
- <para>
- <varname>memqcache_cache_block_size</varname> must be set to at least 512.
- </para>
-
- <para>
- This parameter can only be set at server start.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </sect2>
-
- <sect2 id="runtime-in-memory-query-cache-memcached-config">
- <title>Configurations to use memcached</title>
-
- <para>
- These are the parameters used with memcached as the cache storage.
- </para>
-
- <variablelist>
-
- <varlistentry id="guc-memqcache-memcached-host" xreflabel="memqcache_memcached_host">
- <term><varname>memqcache_memcached_host</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>memqcache_memcached_host</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the host name or the IP address on which <literal>memcached</literal>
- works. You can use <literal>'localhost'</literal> if <literal>memcached</literal>
- and <productname>Pgpool-II</productname> resides on same server.
- </para>
- <para>
- This parameter can only be set at server start.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-memqcache-memcached-port" xreflabel="memqcache_memcached_port">
- <term><varname>memqcache_memcached_port</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>memqcache_memcached_port</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the port number of <acronym>memcached</acronym>.
- Default is 11211.
- </para>
- <para>
- This parameter can only be set at server start.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </sect2>
-
-</sect1>
+++ /dev/null
-<!-- doc/src/sgml/config.sgml -->
-
-<sect1 id="runtime-misc">
- <title>Misc Configuration Parameters</title>
-
- <variablelist>
-
- <varlistentry id="guc-relcache-expire" xreflabel="relcache_expire">
- <term><varname>relcache_expire</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>relcache_expire</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
-
- <para>
- Specifies the relation cache expiration time in seconds.
- The relation cache is used for caching the query result of
- <productname>PostgreSQL</> system catalogs that is used by <productname>Pgpool-II
- </productname> to get various information including the table
- structures and to check table types(e.g. To check if the referred
- table is a temporary table or not). The cache is maintained in
- the local memory space of <productname>Pgpool-II</productname>
- child process and its lifetime is same as of the child process.
- The cache is also maintained in shared memory to share among child
- processes,if enable <xref linkend="guc-enable-shared-relcache">.
- So If the table is modified using <command>ALTER TABLE</command>
- or some other means, the relcache becomes inconsistent.
- For this purpose, <varname>relcache_expire</varname> controls
- the life time of the cache.
- Default is 0, which means the cache never expires.
- </para>
-
- <para>
- This parameter can only be set at server start.
- </para>
-
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-relcache-size" xreflabel="relcache_size">
- <term><varname>relcache_size</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>relcache_size</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
-
- <para>
- Specifies the number of relcache entries. Default is 256.
- The cache is created about 10 entries per table. So you can estimate
- the required number of relation cache at "number of using table * 10".
- </para>
- <note>
- <para>
- If the below message frequently appears in the
- <productname>Pgpool-II</productname> log, you may need to
- increase the <varname>relcache_size</varname> for better performance.
- <programlisting>
- "pool_search_relcache: cache replacement happened"
- </programlisting>
- </para>
- </note>
- <para>
- This parameter can only be set at server start.
- </para>
-
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-enable-shared-relcache" xreflabel="enable_shared_relcache">
- <term><varname>enable_shared_relcache</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>enable_shared_relcache</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- By setting to on, relation cache is shared among
- <productname>Pgpool-II</productname> child processes using the in
- memory query cache (see <xref
- linkend="runtime-in-memory-query-cache-enabling"> for more
- details). Default is on. Each child process needs to access to
- the system catalog from <productname>PostgreSQL</productname>.
- By enabling this feature, other process can extract the catalog
- lookup result from the query cache and it should reduce the
- frequency of the query. Cache invalidation is not happen even if
- the system catalog is modified. So it is strongly recommend to
- set time out base cache invalidation by using <xref
- linkend="guc-relcache-expire"> parameter.
- </para>
- <para>
- This parameter can be used even if <xref
- linkend="guc-memory-cache-enabled"> is off. In this case some
- query cache parameters(<xref linkend="guc-memqcache-method">,
- <xref linkend="guc-memqcache-maxcache"> and each cache storage
- parameter) is used together.
- </para>
- <para>
- <productname>Pgpool-II</productname> search the local relation
- cache first. If it is not found on the cache, the shared relation
- query cache is searched if this feature is enabled. If it is
- found on query cache, it is copied into the local relation
- cache. If a cache entry is not found on anywhere,
- <productname>Pgpool-II</productname> executes the query against
- <productname>PostgreSQL</productname>, and the result is stored
- into the shared relation cache and the local cache.
- </para>
- <para>
- This parameter can only be set at server start.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-relcache-query-target" xreflabel="relcache_query_target">
- <term><varname>relcache_query_target</varname> (<type>enum</type>)
- <indexterm>
- <primary><varname>relcache_query_target</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- The target node to send queries to create relation cache
- entries. If set to <literal>primary</literal>, queries will
- be sent to primary node. This is the default and
- recommended to most users because the query could get the
- latest information. If you want to lower the load of
- primary node, you can set the parameter to
- <literal>load_balance_node</literal>, which will send
- queries to the load balance node. This is especially useful
- for such a system
- where <productname>Pgpool-II</productname>/primary server is
- on a continent A while
- other <productname>Pgpool-II</productname>/standby server is
- on other continent B. Clients on B want read data from the
- standby because it's much geographically closer. In this
- case you can set backend_weight0 (this represents primary)
- to 0, backend_weight1 to 1 (this represents standby) and set
- relcache_query_target
- to <literal>load_balance_node</literal>.
- </para>
- <para>
- Note, however, if you send query to the standby node,
- recently created tables and rows might not be available on
- the standby server yet because of replication delay. Thus
- such a configuration is not recommended for systems where
- data modification activity is high.
- </para>
- <para>
- This parameter can be changed by reloading
- the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-check-temp-table" xreflabel="check_temp_table">
- <term><varname>check_temp_table</varname> (<type>enum</type>)
- <indexterm>
- <primary><varname>check_temp_table</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
-
- <para>
- Setting to <literal>catalog</literal>
- or <literal>trace</literal>, enables the temporary table
- check in the <acronym>SELECT</acronym> statements. To check
- the temporary table <productname>Pgpool-II</productname>
- queries the system catalog of
- primary/main <productname>PostgreSQL</productname> backend
- if <literal>catalog</literal> is specified, which
- increases the load on the primary/main server.
- </para>
- <para>
- If <literal>trace</literal> is
- set, <productname>Pgpool-II</productname> traces temporary
- table creation and dropping to obtain temporary table
- info. So no need to access system catalogs. However, if
- temporary table creation is invisible
- to <productname>Pgpool-II</productname> (done in functions
- or triggers, for
- example), <productname>Pgpool-II</productname> cannot
- recognize the creation of temporary tables.
- </para>
- <para>
- If you are absolutely sure that your system never uses
- temporary tables, then you can safely set to none.
- </para>
- <note>
- <para>
- For a backward compatibility sake for 4.0 or
- before, <productname>Pgpool-II</productname>
- accepts <literal>on</literal>, which is same
- as <literal>catalog</literal> and <literal>off</literal>,
- which is same as <literal>none</literal>, they may be
- deleted in the future version.
- </para>
- </note>
- <para>
- Default is <literal>catalog</literal>.
- </para>
- <para>
- This parameter can be changed by reloading
- the <productname>Pgpool-II</productname> configurations.
- You can also use <xref linkend="SQL-PGPOOL-SET"> command to
- alter the value of this parameter for a current session.
- </para>
-
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-check-unlogged-table" xreflabel="check_unlogged_table">
- <term><varname>check_unlogged_table</varname> (<type>boolean</type>)
- <indexterm>
- <primary><varname>check_unlogged_table</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
-
- <para>
- Setting to on, enables the unlogged table check in the <acronym>SELECT</acronym>
- statements. To check the unlogged table <productname>Pgpool-II</productname>
- queries the system catalog of primary/main <productname>PostgreSQL</> backend which increases
- the load on the primary/main server.
- If you are absolutely sure that your system never uses the unlogged tables
- (for example, you are using 9.0 or earlier version of <productname>PostgreSQL</>) then you
- can safely turn off the <varname>check_unlogged_table</varname>.
- Default is on.
- </para>
-
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- You can also use <xref linkend="SQL-PGPOOL-SET"> command to alter the value of
- this parameter for a current session.
- </para>
-
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-pid-file-name" xreflabel="pid_file_name">
- <term><varname>pid_file_name</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>pid_file_name</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
-
- <para>
- Specifies the full path to a file to store the <productname>Pgpool-II
- </productname> process id.
- The pid_file_name path can be specified as relative to the
- location of pgpool.conf file or as an absolute path
- Default is <literal>"/var/run/pgpool/pgpool.pid"</literal>.
- </para>
-
- <para>
- This parameter can only be set at server start.
- </para>
-
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-logdir" xreflabel="logdir">
- <term><varname>logdir</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>logdir</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
-
- <para>
- Specifies the full path to a directory to store the <literal>pgpool_status</literal>.
- Default is <literal>'/tmp'</literal>.
- </para>
-
- <para>
- This parameter can only be set at server start.
- </para>
-
- </listitem>
- </varlistentry>
-
- </variablelist>
-</sect1>
+++ /dev/null
-# /usr/bin/perl -w
-
-# doc/src/sgml/mk_feature_tables.pl
-
-my $yesno = $ARGV[0];
-
-open PACK, $ARGV[1] or die;
-
-my %feature_packages;
-
-while (<PACK>)
-{
- chomp;
- my ($fid, $pname) = split /\t/;
- if ($feature_packages{$fid})
- {
- $feature_packages{$fid} .= ", $pname";
- }
- else
- {
- $feature_packages{$fid} = $pname;
- }
-}
-
-close PACK;
-
-open FEAT, $ARGV[2] or die;
-
-print "<tbody>\n";
-
-while (<FEAT>)
-{
- chomp;
- my ($feature_id, $feature_name, $subfeature_id,
- $subfeature_name, $is_supported, $comments) = split /\t/;
-
- $is_supported eq $yesno || next;
-
- $feature_name =~ s/</</g;
- $feature_name =~ s/>/>/g;
- $subfeature_name =~ s/</</g;
- $subfeature_name =~ s/>/>/g;
-
- print " <row>\n";
-
- if ($subfeature_id)
- {
- print " <entry>$feature_id-$subfeature_id</entry>\n";
- }
- else
- {
- print " <entry>$feature_id</entry>\n";
- }
- print " <entry>" . $feature_packages{$feature_id} . "</entry>\n";
- if ($subfeature_id)
- {
- print " <entry>$subfeature_name</entry>\n";
- }
- else
- {
- print " <entry>$feature_name</entry>\n";
- }
- print " <entry>$comments</entry>\n";
-
- print " </row>\n";
-}
-
-print "</tbody>\n";
-
-close FEAT;
+++ /dev/null
-<!-- doc/src/sgml/notation.sgml -->
-
-<sect1 id="notation">
- <!--
- <title>Conventions</title>
- -->
- <title>约定</title>
-
- <para>
- The following conventions are used in the synopsis of a command:
- brackets (<literal>[</literal> and <literal>]</literal>) indicate
- optional parts. (In the synopsis of a Tcl command, question marks
- (<literal>?</>) are used instead, as is usual in Tcl.) Braces
- (<literal>{</literal> and <literal>}</literal>) and vertical lines
- (<literal>|</literal>) indicate that you must choose one
- alternative. Dots (<literal>...</>) mean that the preceding element
- can be repeated.
- </para>
-
- <para>
- Where it enhances the clarity, SQL commands are preceded by the
- prompt <literal>=></>, and shell commands are preceded by the
- prompt <literal>$</>. Normally, prompts are not shown, though.
- </para>
-
- <para>
- An <firstterm>administrator</firstterm> is generally a person who is
- in charge of installing and running the server. A <firstterm>user</firstterm>
- could be anyone who is using, or wants to use, any part of the
- <productname>Pgpool-II</productname> system. These terms should not
- be interpreted too narrowly; this book does not have fixed
- presumptions about system administration procedures.
- </para>
-</sect1>
+++ /dev/null
-<!-- doc/src/sgml/config.sgml -->
-
-<sect1 id="runtime-online-recovery">
- <title>Online Recovery</title>
-
- <para>
- <productname>Pgpool-II</productname> can synchronize database
- nodes and attach a node without stopping the service. This
- feature is called <acronym>"online recovery"</acronym>. Online
- recovery can be executed by
- using <xref linkend="pcp-recovery-node"> command.
- </para>
- <para>
- For online recovery, the recovery target node must be in detached
- state. This means the node must be either manually detached by
- <xref linkend="pcp-detach-node"> or automatically detached
- by <productname>Pgpool-II</productname> as a consequence of
- failover.
- </para>
- <para>
- If you wish to add a <productname>PostgreSQL</productname> server
- node dynamically, reload the
- <filename>pgpool.conf</filename> after adding the
- <xref linkend="guc-backend-hostname"> and its associated
- parameters. This will register the new server
- to <productname>Pgpool-II</productname> as a detached backend
- node, after that you execute <xref linkend="pcp-recovery-node"> command,
- the server is add.
- </para>
- <!--
- <caution>
- <para>
- Make sure that <command>autovacuum</command> is stopped on the
- main node (the first node which is up and running) before starting the
- online recovery. Autovacuum can change the contents of the database which
- can cause the inconsistency after the online recovery.
- </para>
- <para>
- This applies only if you're recovering with a simple copy mechanism,
- such as the <command>rsync</command> and doesn't apply when using
- the PostgreSQL's PITR mechanism.
- </para>
- </caution>
- -->
- <note>
- <para>
- The recovery target <productname>PostgreSQL</> server must not
- be running for performing the online recovery. If the
- target <productname>PostgreSQL</> server has already started,
- you must shut it down before starting the online recovery.
- </para>
- </note>
-
- <para>
- Online recovery is performed in two phases. The first phase is
- called "first stage" and the second phase is called "second
- stage". Only <xref linkend="guc-replication-mode"> and <xref
- linkend="guc-snapshot-isolation-mode"> require the second stage.
- For other modes including streaming replication mode the second
- stage is not performed and you don't need to provide a script for
- the stage in <xref
- linkend="guc-recovery-2nd-stage-command">. i.e. you can safely leave
- it as an empty string.
- </para>
-
- <para>
- In the first stage the standby (replica) node is created by using
- <productname>PostgreSQL</productname>'s
- <command>pg_basebackup</command>, for example, from a backup of the
- main (primary) node. Update data while executing the first stage
- will be logged into the <productname>PostgreSQL</productname>'s
- transaction log.
- </para>
-
- <para>
- In the second stage the target recovery node is started. The
- transaction log will be replayed and the replica node will be
- completely synced with the master node.
- </para>
-
- <para>
- You need to provide scripts for each stage. Complete sample scripts
- are provided at <ulink
- url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/recovery_1st_stage.sample;hb=refs/heads/master">/etc/pgpool-II/recovery_1st_stage.sample</ulink>
- and <ulink
- url="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=blob_plain;f=src/sample/scripts/recovery_2nd_stage.sample;hb=refs/heads/master">/etc/pgpool-II/recovery_2nd_stage.sample</ulink>.
- Example installation using those scripts can be found in <xref
- linkend="example-cluster-pgpool-config-online-recovery">.
- </para>
-
- <para>
- Connections from clients are not allowed only in the second stage
- while the data can be updated or retrieved during the first stage.
- </para>
- <para>
- <productname>Pgpool-II</productname> performs the follows steps in online recovery:
- </para>
- <itemizedlist>
-
- <listitem>
- <para>
- CHECKPOINT.
- </para>
- </listitem>
- <listitem>
- <para>
- Execute first stage of online recovery.
- </para>
- </listitem>
- <listitem>
- <para>
- Wait until all client connections have disconnected (only in <xref
- linkend="guc-replication-mode"> and <xref
- linkend="guc-snapshot-isolation-mode">).
- </para>
- </listitem>
- <listitem>
- <para>
- CHECKPOINT (only in <xref linkend="guc-replication-mode"> and
- <xref linkend="guc-snapshot-isolation-mode">).
- </para>
- </listitem>
- <listitem>
- <para>
- Execute second stage of online recovery (only in <xref
- linkend="guc-replication-mode"> and <xref
- linkend="guc-snapshot-isolation-mode">).
- </para>
- </listitem>
- <listitem>
- <para>
- Start up postmaster (perform <literal>pgpool_remote_start</literal>)
- </para>
- <para>
- The <literal>pgpool_remote_start</literal> is script to start up the <productname>PostgreSQL</productname> node of recovery target.
- <literal>pgpool_remote_start</literal> receives following 2 parameters:
- <itemizedlist>
- <listitem>
- <para>
- Hostname of the backend node to be recovered.
- </para>
- </listitem>
- <listitem>
- <para>
- Path to the database cluster of the main(primary) node.
- </para>
- </listitem>
- </itemizedlist>
- The script example can be found in <xref linkend="example-cluster-pgpool-config-online-recovery">.
- <note>
- <para>
- The script path and filename are hard coded, <command>$PGDATA/pgpool_remote_start</command> is executed on main(primary) node.
- </para>
- </note>
- </para>
- </listitem>
- <listitem>
- <para>
- Node attach
- </para>
- </listitem>
-
- </itemizedlist>
- <note>
- <para>
- There is a restriction in the online recovery in
- <xref linkend="guc-replication-mode">. If
- <productname>Pgpool-II</productname> itself is installed
- on multiple hosts, online recovery does not work correctly,
- because <productname>Pgpool-II</productname> has to stop all
- the clients during the 2nd stage of online recovery.
- If there are several <productname>Pgpool-II</productname> hosts,
- only one of them will have received the online recovery command and will
- block the connections from clients.
- </para>
- </note>
- <variablelist>
-
- <varlistentry id="guc-recovery-user" xreflabel="recovery_user">
- <term><varname>recovery_user</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>recovery_user</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the <productname>PostgreSQL</> user name to perform online recovery.
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-recovery-password" xreflabel="recovery_password">
- <term><varname>recovery_password</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>recovery_password</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the password for the <productname>PostgreSQL</> user name configured in
- <xref linkend="guc-recovery-user"> to perform online recovery.
- </para>
- <para>
- If <varname>recovery_password</varname> is left blank <productname>Pgpool-II</productname>
- will first try to get the password for <xref linkend="guc-recovery-user"> from
- <xref linkend="guc-pool-passwd"> file before using the empty password.
- </para>
- <para>
- You can also specify AES256-CBC encrypted password in <varname>recovery_password</varname> field.
- To specify the <literal>AES</literal> encrypted password, password string must be prefixed with
- <literal>AES</literal> after encrypting (using <literal>aes-256-cbc</literal> algorithm) and
- encoding to <literal>base64</literal>.
- </para>
- <para>
- To specify the unencrypted clear text password, prefix the password string with
- <literal>TEXT</literal>. For example if you want to set <literal>mypass</literal> as
- a password, you should specify <literal>TEXTmypass</literal> in the password field.
- In the absence of a valid prefix, <productname>Pgpool-II</productname> will considered
- the string as a plain text password.
- </para>
- <para>
- You can also use <xref linkend="PG-ENC"> utility to create the correctly formatted
- <literal>AES</literal> encrypted password strings.
- <note>
- <para>
- <productname>Pgpool-II</productname> will require a valid decryption key at the
- startup to use the encrypted passwords.
- see <xref linkend="auth-aes-decryption-key"> for more details on providing the
- decryption key to <productname>Pgpool-II</productname>
- </para>
- </note>
- </para>
-
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-recovery-1st-stage-command" xreflabel="recovery_1st_stage_command">
- <term><varname>recovery_1st_stage_command</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>recovery_1st_stage_command</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies a command to be run by main (primary) node at the
- first stage of online recovery. The command file must be placed in the
- database cluster directory for security reasons.
- For example, if <varname>recovery_1st_stage_command</varname> = <literal>
- 'sync-command'</literal>, then <productname>Pgpool-II</productname> will
- look for the command script in <literal>$PGDATA</literal> directory and will
- try to execute <command>$PGDATA/sync-command</command>.
- </para>
- <para>
- <varname>recovery_1st_stage_command</varname> receives following 6 parameters:
- </para>
-
- <itemizedlist>
- <listitem>
- <para>
- Path to the database cluster of the main (primary) node.
- </para>
- </listitem>
- <listitem>
- <para>
- Hostname of the backend node to be recovered.
- </para>
- </listitem>
- <listitem>
- <para>
- Path to the database cluster of the node to be recovered.
- </para>
- </listitem>
- <listitem>
- <para>
- Port number of the main (primary) node (<productname>Pgpool-II</productname> 3.4 or after).
- </para>
- </listitem>
- <listitem>
- <para>
- Node number to be recovered (<productname>Pgpool-II</productname> 4.0 or after)
- </para>
- </listitem>
- <listitem>
- <para>
- Port number to be recovered (<productname>Pgpool-II</productname> 4.1 or after)
- </para>
- </listitem>
- </itemizedlist>
-
- <note>
- <para>
- <productname>Pgpool-II</productname> accept connections and queries
- while <varname>recovery_1st_stage command</varname> is executed,
- so you can retrieve and update data.
- </para>
- </note>
-
- <caution>
- <para>
- <varname>recovery_1st_stage command</varname> runs as a <acronym>SQL</acronym>
- command from PostgreSQL's point of view. So <varname>recovery_1st_stage command
- </varname> can get prematurely killed by PostgreSQL if the PostgreSQL's
- <varname>statement_time_out</varname> is configured with the value that is
- smaller than the time <varname>recovery_1st_stage_command</varname> takes for
- completion.
- </para>
- <para>
- Typical error in such case is
- <programlisting>
- rsync used in the command is killed by signal 2 for example.
- </programlisting>
- </para>
- </caution>
-
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-recovery-2nd-stage-command" xreflabel="recovery_2nd_stage_command">
- <term><varname>recovery_2nd_stage_command</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>recovery_2nd_stage_command</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
-
- <para>
- Specifies a command to be run by main node at the second
- stage of online recovery. This command is required only
- <xref linkend="guc-replication-mode">, so for other modes don't need
- to provide a command file. The command file must be placed in the
- database cluster directory for security reasons.
- For example, if <varname>recovery_2nd_stage_command</varname> = <literal>
- 'sync-command'</literal>, then <productname>Pgpool-II</productname> will
- look for the command script in <literal>$PGDATA</literal> directory and will
- try to execute <command>$PGDATA/sync-command</command>.
- </para>
- <para>
- <varname>recovery_2nd_stage_command</varname> receives following 6 parameters:
- </para>
-
- <itemizedlist>
- <listitem>
- <para>
- Path to the database cluster of the main(primary) node.
- </para>
- </listitem>
- <listitem>
- <para>
- Hostname of the backend node to be recovered.
- </para>
- </listitem>
- <listitem>
- <para>
- Path to the database cluster of the node to be recovered.
- </para>
- </listitem>
- <listitem>
- <para>
- Port number of the main (primary) node (<productname>Pgpool-II</productname> 3.4 or after).
- </para>
- </listitem>
- <listitem>
- <para>
- Node number to be recovered (<productname>Pgpool-II</productname> 4.0 or after)
- </para>
- </listitem>
- <listitem>
- <para>
- Port number to be recovered (<productname>Pgpool-II</productname> 4.1 or after)
- </para>
- </listitem>
- </itemizedlist>
-
- <note>
- <para>
- <productname>Pgpool-II</productname> <emphasis>does not</emphasis>
- accept client connections and queries during the execution
- of <varname>recovery_2nd_stage_command</varname> command, and waits
- for the existing clients to close their connections before executing the
- command.
- Therefore, the <varname>recovery_2nd_stage_command</varname> may not execute
- if the client stays connected for a long time.
- </para>
- </note>
-
- <caution>
- <para>
- <varname>recovery_2nd_stage command</varname> runs as a <acronym>SQL</acronym>
- command from PostgreSQL's point of view. Therefore, <varname>recovery_2nd_stage command
- </varname> can get prematurely killed by PostgreSQL if the PostgreSQL's
- <varname>statement_time_out</varname> is configured with the value that is
- smaller than the time <varname>recovery_2nd_stage_command</varname> takes for
- completion.
- </para>
- </caution>
-
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-recovery-timeout" xreflabel="recovery_timeout">
- <term><varname>recovery_timeout</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>recovery_timeout</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the timeout in seconds to cancel the online recovery if it
- does not completes within this time.
- Since <productname>Pgpool-II</productname> does not accepts the connections
- during the second stage of online recovery, this parameter can be used to cancel
- the online recovery to manage the service down time during the online recovery.
- </para>
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="guc-client-idle-limit-in-recovery" xreflabel="client_idle_limit_in_recovery">
- <term><varname>client_idle_limit_in_recovery</varname> (<type>integer</type>)
- <indexterm>
- <primary><varname>client_idle_limit_in_recovery</varname> configuration parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Specifies the time in seconds to disconnect a client if it remains idle
- since the last query during the online recovery.
- <varname>client_idle_limit_in_recovery</varname> is similar to the
- <xref linkend="guc-client-idle-limit"> but only takes effect during the
- second stage of online recovery.
- </para>
- <para>
- This is useful for preventing the <productname>Pgpool-II</productname>
- recovery from being disturbed by the lazy clients or if the TCP/IP
- connection between the client and <productname>Pgpool-II</productname>
- is accidentally down (a cut cable for instance).
- </para>
-
- <note>
- <para>
- <varname>client_idle_limit_in_recovery</varname> must be smaller than
- <xref linkend="guc-recovery-timeout">.
- Otherwise, <xref linkend="guc-recovery-timeout"> comes
- first and you will see following error while executing online recovery:
- <programlisting>
- ERROR: node recovery failed, waiting connection closed in the other pgpools timeout
- </programlisting>
- </para>
- </note>
-
- <para>
- If set to -1, all clients get immediately disconnected when the second
- stage of online recovery starts.
- The default is 0, which turns off the feature.
- </para>
-
-
- <para>
- This parameter can be changed by reloading the <productname>Pgpool-II</> configurations.
- You can also use <xref linkend="SQL-PGPOOL-SET"> command to alter the value of
- this parameter for a current session.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
-</sect1>
+++ /dev/null
-<!-- doc/src/sgml/performance.sgml -->
-
-<chapter id="performance">
- <title>Performance Considerations</title>
-
- <indexterm>
- <primary>performance</primary>
- <secondary>of the server</secondary>
- </indexterm>
-
- <para>
- There are number of configuration parameters that affect the
- performance of
- <productname>Pgpool-II</productname>. In this chapter we present
- how to tune them.
- </para>
-
- <sect1 id="resource-requirement">
- <title>Resource Requirement</title>
-
- <para>
- <productname>Pgpool-II</productname> does not consume too much
- resource. However there are minimum requirements for
- resource. In this section we are going to explain one by one.
- </para>
-
- <sect2 id="memory-requirement">
- <title>Memory Requirement</title>
-
- <para>
- There are two types of memory usage
- in <productname>Pgpool-II</productname>: shared memory and
- process private memory. The former is allocated at the startup
- of <productname>Pgpool-II</productname> main server process
- and will not be freed until
- whole <productname>Pgpool-II</productname> servers shut down.
- The latter is allocated within
- each <productname>Pgpool-II</productname> child process and
- will be freed at the end of the process.
- </para>
-
- <sect3 id="shared-memory-requirement">
- <title>Shared Memory Requirement</title>
-
- <para>
- Here is a formula to calculate the shared memory requirement.
- <programlisting>
- Shared memory requirement (in bytes) = <xref linkend="guc-num-init-children"> * <xref linkend="guc-max-pool"> * 17408
- </programlisting>
- For example if you have <varname>num_init_children</varname> = 32 (the default) and <varname>max_pool</varname> = 4 (the
- default), then you will need 32 * 4 * 17408 = 2228224 bytes = 2.1 MB.
- </para>
-
- <para>
- If you plan to use in memory query cache
- (see <xref linkend="runtime-in-memory-query-cache"> for more
- details) in the shared memory, you will need more RAM for
- it. See
- <xref linkend="guc-memqcache-total-size"> and
- <xref linkend="guc-memqcache-max-num-cache"> for required RAM
- size.
- </para>
-
- <para>
- Note that, however, in <productname>Pgpool-II</productname> 4.1
- or after, even if the in memory query cache is not enabled, it
- consumes additional 64MB of shared memory, if <xref
- linkend="guc-enable-shared-relcache"> is enabled (it is enabled
- by default).
- </para>
- </sect3>
-
- <sect3 id="process-memory-requirement">
- <title>Process Memory Requirement</title>
- <para>
-
- Here is a formula to calculate the process memory requirement.
- <programlisting>
- Process memory requirement in total (in mega bytes) = <xref linkend="guc-num-init-children"> * 5
- </programlisting>
- For example if you have <varname>num_init_children</varname> =
- 32 (the default), you will need 160MB.
- </para>
- </sect3>
- </sect2>
-
- <sect2 id="disk-requirement">
- <title>Disk Requirement</title>
- <para>
- <productname>Pgpool-II</productname> does not consume much
- disk space. Also it does not require high speed disk because
- disk I/O traffic caused
- by <productname>Pgpool-II</productname> is small. However,
- if you plan to emit much logs, of course you need disk space
- for them.
- </para>
- </sect2>
- </sect1>
-
- <sect1 id="managing-client-connections">
- <title>Managing Client Connections</title>
- <para>
- As the number of client connections accepted is growing, the
- number of <productname>Pgpool-II</productname> child process
- which can accept new connections from client is decreasing and
- finally reaches to 0. In this situation new clients need to wait
- until a child process becomes free. Under heavy load, it could
- be possible that the queue length of waiting clients is getting
- longer and longer and finally hits the system's limit (you might
- see "535 times the listen queue of a socket overflowed"
- error"). In this case you need to increase the queue
- limit. There are several ways to deal with this problem.
- </para>
-
- <sect2 id="controlling-num-init-children">
- <title>Controlling num_init_children</title>
- <para>
- The obvious way to deal with the problem is increasing the
- number of child process. This can be done by
- tweaking <xref linkend="guc-num-init-children">. However
- increasing child process requires more CPU and memory
- resource. Also you have to be very careful about
- max_connections parameter
- of <productname>PostgreSQL</productname> because once the
- number of child process is greater than
- max_connections, <productname>PostgreSQL</productname> refuses
- to accept new connections, and failover will be triggered.
- </para>
- <para>
- Another drawback of increasing num_init_children is, so called
- "thundering herd problem". When new connection request comes
- in, the kernel wake up any sleeping child process to issue
- accept() system call. This triggers fight of process to get
- the socket and could give heavy load to the system. To
- mitigate the problem, you could set serialize_accept to on so
- that there's only one process to grab the accepting socket.
- </para>
- </sect2>
-
- <sect2 id="controlling-listen-backlog-multiplier">
- <title>Controlling listen_backlog_multiplier</title>
- <para>
- Another solution would be increasing the connection request
- queue. This could be done by
- increasing <xref linkend="guc-listen-backlog-multiplier">.
- </para>
- </sect2>
-
- <sect2 id="when-to-use-reserved-connections">
- <title>When to use reserved_connections</title>
- <para>
- However, none of above solutions guarantees that the
- connection accepting the queue would not be filled up. If a
- client connection request arrives quicker than the rate of
- processing queries, the queue will be filled in someday. For
- example, if there are some heavy queries that take long time,
- it could easily trigger the problem.
- </para>
- <para>
- The solution is
- setting <xref linkend="guc-reserved-connections"> so that
- overflowed connection requests are rejected
- as <productname>PostgreSQL</productname> already does. This
- gives visible errors to applications ("Sorry max_connections
- already") and force them retrying. So the solution should only
- be used when you cannot foresee the upper limit of system
- load.
- </para>
- </sect2>
-
- </sect1>
-
- <sect1 id="read-query-load-balancing">
- <title>Read Query Load Balancing</title>
- <para>
- If there are multiple <productname>PostgreSQL</productname>
- nodes and <productname>Pgpool-II</productname> operates in
- streaming replication mode, logical replication mode, slony mode
- or replication mode (for those running mode
- see <xref linkend="running-mode"> for more details), it is
- possible to distribute read queries among those database nodes
- to get more throughput since each database nodes processes
- smaller number of queries. To enable the feature you need to
- turn on <xref linkend="guc-load-balance-mode">.
- </para>
-
- <para>
- At this point vast majority of systems use streaming replication
- mode, so from now on we focus on the mode.
- </para>
-
- <sect2 id="session-level-load-balancing-vs-statement-level-load-balancing">
- <title>Session Level Load Balancing vs. Statement Level Load Balancing</title>
- <para>
- By default load balance mode is "session level" which means
- the node read queries are sent is determined when a client
- connects to <productname>Pgpool-II</productname>. For example,
- if we have node 0 and node 1, one of the node is selected
- randomly each time new session is created. In the long term,
- the possibility which node is chosen will be getting closer to
- the ratio specified by <xref linkend="guc-backend-weight">0
- and
- <xref linkend="guc-backend-weight">1. If those two values are
- equal, the chance each node is chosen will be even.
- </para>
-
- <para>
- On the other hand, if
- <xref linkend="guc-statement-level-load-balance"> is set to
- on, the load balance node is determined at the time each query
- starts. This is useful in case that application has its own
- connection pooling which keeps on connecting
- to <productname>Pgpool-II</productname> and the load balance
- node will not be changed once the application starts. Another
- use case is a batch application. It issues tremendous number
- of queries but there's only 1 session. With statement level
- load balancing it can utilize multiple servers.
- </para>
- </sect2>
-
- <sect2 id="creating-specific-purpose-database-node">
- <title>Creating Specific Purpose Database Node</title>
- <para>
- In OLAP environment sometimes it is desirable to have a large
- read-only database for specific purpose. By creating such a
- database is possible by creating a replica database using
- streaming replication. In this case it is possible to redirect
- read queries to the database in two ways: specifying database
- names(s) or specifying application name(s). For former,
- use <xref linkend="guc-database-redirect-preference-list">. For
- latter use <xref linkend="guc-app-name-redirect-preference-list">.
- </para>
- </sect2>
-
- </sect1>
-
- <sect1 id="in-memory-query-caching">
- <title>In Memory Query Caching</title>
- <para>
- <productname>Pgpool-II</productname> allows to cache read query
- results for later use. This will bring huge benefit for a type
- of applications which issue same read queries many times. If
- there are two queries and the query strings (parameter for
- prepared statements if any) are identical, two queries are
- regarded as "same". For the first time the query is
- sent, <productname>Pgpool-II</productname> saves the query
- result, and use it for the second query without asking anything
- to <productname>PostgreSQL</productname>. This technique is
- explained in <xref linkend="runtime-in-memory-query-cache">.
- </para>
-
- <sect2 id="when-not-to-use-in-memory-query-caching">
- <title>When not to Use in Memory Query Caching</title>
- <para>
- When a table is modified, query results against the table
- could be changed. To avoid
- inconsistency, <productname>Pgpool-II</productname> discards
- query cache data when corresponding table is modified. So
- frequently updated database will not be suitable to use in
- memory query caching. You can check if your database is
- suitable to use query caching or not, you could
- use <xref linkend="SQL-SHOW-POOL-CACHE">. If query cache hit
- ration is lower than 70%, probably you want to avoid using the
- query cache.
- </para>
- </sect2>
- </sect1>
-
- <sect1 id="relation-cache">
- <title>Relation Cache</title>
- <para>
- Except in raw mode (see <xref linkend="running-mode">)
- or <xref linkend="guc-load-balance-mode"> is set to off,
- sometimes <productname>Pgpool-II</productname> needs to
- ask <productname>PostgreSQL</productname> to get meta
- information, such as whether a table is a temporary one or
- not. To get those
- information, <productname>Pgpool-II</productname> sends queries
- primary <productname>PostgreSQL</productname> which could be up
- to as many as 10 queries (in 4.1 or after, the number of queries
- has been decreased, it is not zero, however). To reduce the
- overhead, <productname>Pgpool-II</productname> maintains
- "relation cache". Next time same table is included in a
- query, <productname>Pgpool-II</productname> extracts the
- information from the cache.
- </para>
- <para>
- There are some parameters to configure the relation
- cache. See <xref linkend="guc-relcache-expire">, <xref linkend="guc-relcache-size">, <xref linkend="guc-check-temp-table">, <xref linkend="guc-check-unlogged-table">
- for more details.
- </para>
-
- <sect2 id="shared-relation-cache">
- <title>Shared Relation Cache</title>
- <para>
- The relation cache basically lives in process private memory,
- which is bound to a process. So even if a relation cache is
- created to for a table, in different process the relation
- cache might not be created yet. After all, until a relation
- cache entry is created in all process, queries continue to
- sent to <productname>PostgreSQL</productname>.
- <productname>Pgpool-II</productname> 4.1 overcomes the issue
- by creating relation cache in shared memory. If a session
- creates a relation cache entry in the shared memory, other
- sessions will get the cache result by looking at the shared
- relation
- cache. See <xref linkend="guc-enable-shared-relcache">
- configuration parameter section for more details. This feature
- is pretty effective and we recommend this feature be enabled.
- </para>
- </sect2>
- </sect1>
-
- <sect1 id="other-performance-considerations">
- <title>Other Performance Considerations</title>
- <para>
- This section introduces some other performance considerations.
- </para>
-
- <sect2 id="thundering-herd-problem">
- <title>Thundering Herd Problem</title>
- <para>
- If <xref linkend="guc-num-init-children"> is large, it is
- possible that many <productname>Pgpool-II</productname> process
- are woke up and heavy context switching happens. This leads to
- high system load and hurt the overall system performance. This
- problem is called "the thundering herd
- problem". Enabling <xref linkend="guc-serialize-accept"> could
- solve the problem. Please note that for
- smaller <xref linkend="guc-num-init-children">, <xref linkend="guc-serialize-accept">
- might make the system performance worse. Please take a look at
- the guidance in <xref linkend="guc-serialize-accept"> section.
- </para>
- </sect2>
-
- <sect2 id="disaster-recovery-settings">
- <title>Disaster recovery settings</title>
- <para>
- To create a disaster recovery setting, it is possible to deploy a
- <productname>Pgpool-II</productname> plus
- <productname>PostgreSQL</productname> primary server, and another
- <productname>Pgpool-II</productname> plus standby
- <productname>PostgreSQL</productname> server in a geographically
- distant place. Clients close to the standby server send read only
- queries to the <productname>Pgpool-II</productname>, being close
- to the standby server. However, since standby
- <productname>Pgpool-II</productname> sends internal queries to
- system catalog of primary <productname>PostgreSQL</productname>
- server, query performance may be getting worse. To avoid the
- problem, it is possible to use <xref
- linkend="guc-relcache-query-target"> so that such queries are sent
- to the standby. See <xref linkend="guc-relcache-query-target"> for
- more details.
- </para>
- </sect2>
- </sect1>
-</chapter>
+++ /dev/null
-<!-- doc/src/sgml/pgpool-en.sgml -->
-
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.2//EN" [
-
-<!ENTITY % version SYSTEM "version.sgml">
-%version;
-<!ENTITY % filelist SYSTEM "filelist.sgml">
-%filelist;
-
-<!ENTITY reference SYSTEM "reference.sgml">
-
-]>
-
-<book id="Pgpool-II">
- <!-- needs to be replaced as "pgpool" later -->
-
- <title>pgpool-II &version; Documentation</title>
-
- <bookinfo>
- <corpauthor>The Pgpool Global Development Group</corpauthor>
- <productname>pgpool-II</productname>
- <productnumber>&version;</productnumber>
- &legal;
- </bookinfo>
-
- &intro;
-
- <part id="tutorial">
- <title>Tutorial</title>
-
- <partintro>
- <para>
- This chapter explains how to get start with <productname>Pgpool-II</productname>.
- </para>
-
- </partintro>
-
- &start;
-
- </part>
-
- <part id="admin">
- <title>Server Administration</title>
-
- <partintro>
- <para>
- This part covers topics that are of interest
- to <productname>Pgpool-II</productname> administrators.
- </para>
- </partintro>
-
- &installation;
- &runtime;
- &advanced;
- &config;
- &connection-settings;
- &connection-pooling;
- &loadbalance;
- &healthcheck;
- &failover;
- &online-recovery;
- &stream-check;
- &memcache;
- &ssl;
- &watchdog;
- &misc-config;
- &config-last;
- &client-auth;
- &performance;
- </part>
-
- &examples;
-
- &reference;
-
- <part id="appendixes">
- <title>Appendixes</title>
-
- <partintro>
- <para>
- something...
- </para>
- </partintro>
-
- &release;
-
- </part>
-
- &biblio;
-
- <![%include-index;[&bookindex;]]>
- <![%include-xslt-index;[<index id="bookindex"></index>]]>
-
-</book>
+++ /dev/null
-<!-- doc/src/sgml/problems.sgml -->
-
-<sect1 id="bug-reporting">
- <!--
- <title>Bug Reporting Guidelines</title>
- -->
- <title>错误报告指南</title>
-
- <para>
- When you find a bug in <productname>Pgpool-II</productname>, please register to our <ulink url="http://pgpool.net/mediawiki/index.php/Bug_tracking_system">bug tracking system</ulink>.
- </para>
-</sect1>
+++ /dev/null
-<!--
-doc/src/sgml/ref/allfiles.sgml
-Pgpool-II documentation
-Complete list of usable sgml source files in this directory.
--->
-
-<!ENTITY pcpCommonOptions SYSTEM "pcp_common_options.sgml">
-<!ENTITY pcpNodeCount SYSTEM "pcp_node_count.sgml">
-<!ENTITY pcpNodeInfo SYSTEM "pcp_node_info.sgml">
-<!ENTITY pcpHealthCheckStats SYSTEM "pcp_health_check_stats.sgml">
-<!ENTITY pcpWatchdogInfo SYSTEM "pcp_watchdog_info.sgml">
-<!ENTITY pcpProcCount SYSTEM "pcp_proc_count.sgml">
-<!ENTITY pcpProcInfo SYSTEM "pcp_proc_info.sgml">
-<!ENTITY pcpPoolStatus SYSTEM "pcp_pool_status.sgml">
-<!ENTITY pcpDetachNode SYSTEM "pcp_detach_node.sgml">
-<!ENTITY pcpAttachNode SYSTEM "pcp_attach_node.sgml">
-<!ENTITY pcpPromoteNode SYSTEM "pcp_promote_node.sgml">
-<!ENTITY pcpStopPgpool SYSTEM "pcp_stop_pgpool.sgml">
-<!ENTITY pcpRecoveryNode SYSTEM "pcp_recovery_node.sgml">
-<!ENTITY pcpReloadConfig SYSTEM "pcp_reload_config.sgml">
-<!ENTITY pgMd5 SYSTEM "pg_md5.sgml">
-<!ENTITY pgEnc SYSTEM "pg_enc.sgml">
-<!ENTITY wdCli SYSTEM "wd_cli.sgml">
-<!ENTITY pgproto SYSTEM "pgproto.sgml">
-<!ENTITY pgpool SYSTEM "pgpool.sgml">
-<!ENTITY pgpoolSetup SYSTEM "pgpool_setup.sgml">
-<!ENTITY watchdogSetup SYSTEM "watchdog_setup.sgml">
-<!ENTITY pgpoolShow SYSTEM "pgpool_show.sgml">
-<!ENTITY pgpoolReset SYSTEM "pgpool_reset.sgml">
-<!ENTITY pgpoolSet SYSTEM "pgpool_set.sgml">
-<!ENTITY showPoolStatus SYSTEM "show_pool_status.sgml">
-<!ENTITY showPoolNodes SYSTEM "show_pool_nodes.sgml">
-<!ENTITY showPoolProcesses SYSTEM "show_pool_processes.sgml">
-<!ENTITY showPoolPools SYSTEM "show_pool_pools.sgml">
-<!ENTITY showPoolVersion SYSTEM "show_pool_version.sgml">
-<!ENTITY showPoolCache SYSTEM "show_pool_cache.sgml">
-<!ENTITY showPoolHealthCheckStats SYSTEM "show_pool_health_check_stats.sgml">
-<!ENTITY showPoolBackendStats SYSTEM "show_pool_backend_stats.sgml">
-<!ENTITY pgpoolAdmPcpNodeInfo SYSTEM "pgpool_adm_pcp_node_info.sgml">
-<!ENTITY pgpoolAdmPcpHealthCheckStats SYSTEM "pgpool_adm_pcp_health_check_stats.sgml">
-<!ENTITY pgpoolAdmPcpPoolStatus SYSTEM "pgpool_adm_pcp_pool_status.sgml">
-<!ENTITY pgpoolAdmPcpNodeCount SYSTEM "pgpool_adm_pcp_node_count.sgml">
-<!ENTITY pgpoolAdmPcpAttachNode SYSTEM "pgpool_adm_pcp_attach_node.sgml">
-<!ENTITY pgpoolAdmPcpDetachNode SYSTEM "pgpool_adm_pcp_detach_node.sgml">
+++ /dev/null
-<!--
-doc/src/sgml/ref/pcp_attach_node.sgml
-Pgpool-II documentation
--->
-
-<refentry id="PCP-ATTACH-NODE">
- <indexterm zone="pcp-attach-node">
- <primary>pcp_attach_node</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pcp_attach_node</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>PCP Command</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pcp_attach_node</refname>
- <refpurpose>
- attaches the given node to Pgpool-II.</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>pcp_attach_node</command>
- <arg rep="repeat"><replaceable>options</replaceable></arg>
- <arg><replaceable>node_id</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="R1-PCP-ATTACH-NODE-1">
- <title>Description</title>
- <para>
- <command>pcp_attach_node</command>
- attaches the given node to Pgpool-II.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Options</title>
- <para>
- <variablelist>
-
- <varlistentry>
- <term><option>-n <replaceable class="parameter">node_id</replaceable></option></term>
- <term><option>--node_id=<replaceable class="parameter">node_id</replaceable></option></term>
- <listitem>
- <para>
- The index of backend node to attach.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>Other options </option></term>
- <listitem>
- <para>
- See <xref linkend="pcp-common-options">.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </para>
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/pcp_common_options.sgml
-Pgpool-II documentation
--->
-
-<refentry id="PCP-COMMON-OPTIONS">
- <indexterm zone="pcp-common-options">
- <primary>pcp_common_options</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pcp_common_options</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>PCP Command</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pcp_common_options</refname>
- <refpurpose>
- common options used in PCP commands</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>pcp_command</command>
- <arg rep="repeat"><replaceable>option</></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="R1-PCP-common-options-1">
- <title>
- Description
- </title>
- <para>
- There are some arguments common to all PCP commands. Most of
- these are for authentication and the rest are about verbose
- mode, debug message, and so on.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Options</title>
-
- <para>
- <variablelist>
-
- <varlistentry>
- <term><option>-h <replaceable class="parameter">hostname</replaceable></option></term>
- <term><option>--host=<replaceable class="parameter">hostname</replaceable></option></term>
- <listitem>
- <para>
- The host name of the machine on which the server is running. If the
- value begins with a slash, it is used as the directory for the Unix-domain socket.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-p <replaceable class="parameter">port</replaceable></option></term>
- <term><option>--port=<replaceable class="parameter">port</replaceable></option></term>
- <listitem>
- <para>
- The PCP port number (default:"9898").
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-U <replaceable class="parameter">username</replaceable></option></term>
- <term><option>--username=<replaceable class="parameter">username</replaceable></option></term>
- <listitem>
- <para>
- The user name for PCP authentication (default: OS user name).
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-w</option></term>
- <term><option>--no-password</option></term>
- <listitem>
- <para>
- Never prompt for password. And if a password is not available
- by a <filename>.pcppass</filename> file, the connection
- attempt will fail. This option can be useful in batch jobs
- and scripts where no user is present to enter a password.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-W</option></term>
- <term><option>--password</option></term>
- <listitem>
- <para>
- Force password prompt (should happen automatically).
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-d</option></term>
- <term><option>--debug</option></term>
- <listitem>
- <para>
- Enable debug message.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-v</option></term>
- <term><option>--verbose</option></term>
- <listitem>
- <para>
- Enable verbose output.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-V</option></term>
- <term><option>--version</option></term>
- <listitem>
- <para>
- Print the command version, then exit.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-?</option></term>
- <term><option>--help</option></term>
- <listitem>
- <para>
- Shows help for the command line arguments, then exit.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </para>
-
- </refsect1>
-
- <refsect1>
- <title>Environment</title>
-
- <variablelist>
- <varlistentry>
- <term><envar>PCPPASSFILE</envar></term>
-
- <listitem>
- <para>
- Specifies the path to pcp password file.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
-
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/pcp_detach_node.sgml
-Pgpool-II documentation
--->
-
-<refentry id="PCP-DETACH-NODE">
- <indexterm zone="pcp-detach-node">
- <primary>pcp_detach_node</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pcp_detach_node</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>PCP Command</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pcp_detach_node</refname>
- <refpurpose>
- detaches the given node from Pgpool-II. Existing connections to Pgpool-II are forced to be disconnected.</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>pcp_detach_node</command>
- <arg rep="repeat"><replaceable>options</replaceable></arg>
- <arg><replaceable>node_id</replaceable></arg>
- <arg><replaceable>gracefully</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="R1-PCP-DETACH-NODE-1">
- <title>Description</title>
- <para>
- <command>pcp_detach_node</command>
- detaches the given node from Pgpool-II. Existing connections to Pgpool-II are forced to be disconnected.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Options</title>
- <para>
- <variablelist>
-
- <varlistentry>
- <term><option>-n <replaceable class="parameter">node_id</replaceable></option></term>
- <term><option>--node_id=<replaceable class="parameter">node_id</replaceable></option></term>
- <listitem>
- <para>
- The index of backend node to detach.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-g</option></term>
- <term><option>--gracefully</option></term>
- <listitem>
- <para>
- wait until all clients are disconnected (unless client_idle_limit_in_recovery is -1 or recovery_timeout is expired).
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>Other options </option></term>
- <listitem>
- <para>
- See <xref linkend="pcp-common-options">.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </para>
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/pcp_health_check_stats.sgml
-Pgpool-II documentation
--->
-
-<refentry id="PCP-HEALTH-CHECK-STATS">
- <indexterm zone="pcp-health-check-stats">
- <primary>pcp_health_check_stats</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pcp_health_check_stats</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>PCP Command</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pcp_health_check_stats</refname>
- <refpurpose>
- displays health check statistics data on given node ID</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>pcp_health_check_stats</command>
- <arg rep="repeat"><replaceable>option</replaceable></arg>
- <arg><replaceable>node_id</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="R1-PCP-HEALTH-CHECK-STATS-1">
- <title>Description</title>
- <para>
- <command>pcp_health_check_stats</command>
- displays health check statistics data on given node ID.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Options</title>
- <para>
- <variablelist>
-
- <varlistentry>
- <term><option>-n <replaceable class="parameter">node_id</replaceable></option></term>
- <term><option>--node-id=<replaceable class="parameter">node_id</replaceable></option></term>
- <listitem>
- <para>
- The index of backend node to get information of.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>Other options </option></term>
- <listitem>
- <para>
- See <xref linkend="pcp-common-options">.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </para>
- </refsect1>
-
- <refsect1>
- <title>Example</title>
- <para>
- Here is an example output:
- <programlisting>
-$ pcp_health_check_stats -h localhost -p 11001 -w 0
-0 /tmp 11002 up primary 2020-02-24 22:02:42 3 3 0 0 0 0.000000 0 5 1 3.666667 2020-02-24 22:02:47 2020-02-24 22:02:47
-$ pcp_health_check_stats -h localhost -p 11001 -w -v 0
-Node Id : 0
-Host Name : /tmp
-Port : 11002
-Status : up
-Role : primary
-Last Status Change : 2020-02-24 22:02:42
-Total Count : 5
-Success Count : 5
-Fail Count : 0
-Skip Count : 0
-Retry Count : 0
-Average Retry Count : 0.000000
-Max Retry Count : 0
-Max Health Check Duration : 5
-Minimum Health Check Duration : 1
-Average Health Check Duration : 4.200000
-Last Health Check : 2020-02-24 22:03:07
-Last Successful Health Check : 2020-02-24 22:03:07
-Last Skip Health Check :
-Last Failed Health Check :
- </programlisting>
- </para>
-
- <para>
- See <xref linkend="health-check-stats-data-table"> for details of data.
- </para>
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/pcp_node_count.sgml
-Pgpool-II documentation
--->
-
-<refentry id="PCP-NODE-COUNT">
- <indexterm zone="pcp-node-count">
- <primary>pcp_node_count</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pcp_node_count</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>PCP Command</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pcp_node_count</refname>
- <refpurpose>
- displays the total number of database nodes</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>pcp_node_count</command>
- <arg rep="repeat"><replaceable>option</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="R1-PCP-NODE-COUNT-1">
- <title>
- Description
- </title>
- <para>
- <command>pcp_node_count</command>
- displays the total number of database nodes defined in <filename>pgpool.conf</filename>. It does
- not distinguish between nodes status, ie attached/detached. ALL nodes are counted.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Options</title>
- <para>
- See <xref linkend="pcp-common-options">.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Example</title>
- <para>
- Here is an example output:
- <programlisting>
- $ pcp_node_count -p 11001
- Password:
- 2
- </programlisting>
- </para>
- </refsect1>
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/pcp_node_info.sgml
-Pgpool-II documentation
--->
-
-<refentry id="PCP-NODE-INFO">
- <indexterm zone="pcp-node-info">
- <primary>pcp_node_info</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pcp_node_info</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>PCP Command</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pcp_node_info</refname>
- <refpurpose>
- displays the information on the given node ID</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>pcp_node_info</command>
- <arg rep="repeat"><replaceable>option</replaceable></arg>
- <arg><replaceable>node_id</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="R1-PCP-NODE-INFO-1">
- <title>Description</title>
- <para>
- <command>pcp_node_info</command>
- displays the information on the given node ID.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Options</title>
- <para>
- <variablelist>
-
- <varlistentry>
- <term><option>-n <replaceable class="parameter">node_id</replaceable></option></term>
- <term><option>--node-id=<replaceable class="parameter">node_id</replaceable></option></term>
- <listitem>
- <para>
- The index of backend node to get information of.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>Other options </option></term>
- <listitem>
- <para>
- See <xref linkend="pcp-common-options">.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </para>
- </refsect1>
-
- <refsect1>
- <title>Example</title>
- <para>
- Here is an example output:
- <programlisting>
- $ pcp_node_info -h localhost -U postgres 1
- /tmp 11003 2 0.500000 up standby 0 streaming async 2019-04-23 13:58:40
- </programlisting>
- </para>
- <para>
- The result is in the following order:
- <literallayout class="monospaced">
- 1. hostname
- 2. port number
- 3. status
- 4. load balance weight
- 5. status name
- 6. backend role
- 7. replication delay
- 8. replication state (taken from pg_stat_replication, if PostgreSQL is 9.1 or later)
- 9. sync replication state (taken from pg_stat_replication, if PostgreSQL is 9.2 or later)
- 10. last status change time
- </literallayout>
- </para>
- <para>
- Status is represented by a digit from [0 to 3]. To correctly 7,
- 8, 9 are displayed, <xref linkend="guc-sr-check-period"> must not
- be 0. 8, 9 will not be displayed
- if <xref linkend="guc-sr-check-user"> is
- not <productname>PostgreSQL</productname> super user nor it's not
- in "pg_monitor" group.
- <note>
- <para>
- To make <xref linkend="guc-sr-check-user"> in pg_monitor
- group, execute following SQL command
- by <productname>PostgreSQL</productname> super user (replace
- "sr_check_user" with the setting
- of <xref linkend="guc-sr-check-user">):
- <programlisting>
- GRANT pg_monitor TO sr_check_user;
- </programlisting>
- For <productname>PostgreSQL</productname> 9.6, there's no
- pg_monitor group and <xref linkend="guc-sr-check-user"> must
- be <productname>PostgreSQL</productname> super user.
- </para>
- </note>
-
- <itemizedlist>
- <listitem><para>0 - This state is only used during the initialization. PCP will never display it. </para></listitem>
- <listitem><para>1 - Node is up. No connections yet. </para></listitem>
- <listitem><para>2 - Node is up. Connections are pooled. </para></listitem>
- <listitem><para>3 - Node is down. </para></listitem>
- </itemizedlist>
- </para>
- <para>
- The load balance weight is displayed in normalized format.
- </para>
- <para>
- The <option>--verbose</option> option can help understand the output. For example:
- </para>
- <programlisting>
- $ pcp_node_info --verbose -h localhost -U postgres 1
- Hostname : /tmp
- Port : 11003
- Status : 2
- Weight : 0.500000
- Status Name : up
- Role : standby
- Replication Delay : 0
- Replication State : streaming
- Replication Sync State : async
- Last Status Change : 2019-04-23 13:58:40
- </programlisting>
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/pcp_pool_status.sgml
-Pgpool-II documentation
--->
-
-<refentry id="PCP-POOL-STATUS">
- <indexterm zone="pcp-pool-status">
- <primary>pcp_pool_status</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pcp_pool_status</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>PCP Command</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pcp_pool_status</refname>
- <refpurpose>
- displays the parameter values as defined in <filename>pgpool.conf</filename></refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>pcp_pool_status</command>
- <arg rep="repeat"><replaceable>options</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="R1-PCP-POOL-STATUS-1">
- <title>Description</title>
- <para>
- <command>pcp_pool_status</command>
- displays the parameter values as defined in <filename>pgpool.conf</filename>.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Options</title>
- <para>
- See <xref linkend="pcp-common-options">.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Example</title>
- <para>
- Here is an example output:
- <programlisting>
- $ pcp_pool_status -h localhost -U postgres
- name : listen_addresses
- value: localhost
- desc : host name(s) or IP address(es) to listen to
-
- name : port
- value: 9999
- desc : pgpool accepting port number
-
- name : socket_dir
- value: /tmp
- desc : pgpool socket directory
-
- name : pcp_port
- value: 9898
- desc : PCP port # to bind
- </programlisting>
- </para>
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/pcp_proc_count.sgml
-Pgpool-II documentation
--->
-
-<refentry id="PCP-PROC-COUNT">
- <indexterm zone="pcp-proc-count">
- <primary>pcp_proc_count</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pcp_proc_count</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>PCP Command</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pcp_proc_count</refname>
- <refpurpose>
- displays the list of Pgpool-II children process IDs</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>pcp_proc_count</command>
- <arg rep="repeat"><replaceable>options</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="R1-PCP-PROC-COUNT-1">
- <title>Description</title>
- <para>
- <command>pcp_proc_count</command>
- displays the list of Pgpool-II children process IDs. If there is more than one process, IDs will be delimited by a white space.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Options</title>
- <para>
- See <xref linkend="pcp-common-options">.
- </para>
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/pcp_proc_info.sgml
-Pgpool-II documentation
--->
-
-<refentry id="PCP-PROC-INFO">
- <indexterm zone="pcp-proc-info">
- <primary>pcp_proc_info</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pcp_proc_info</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>PCP Command</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pcp_proc_info</refname>
- <refpurpose>
- displays the information on the given Pgpool-II child process ID</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>pcp_proc_info</command>
- <arg rep="repeat"><replaceable>options</replaceable></arg>
- <arg><replaceable>pgpool_child_processid</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="R1-PCP-PROC-INFO-1">
- <title>Description</title>
- <para>
- <command>pcp_proc_info</command>
- displays the information on the given Pgpool-II child process ID.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Options</title>
- <para>
- <variablelist>
-
- <varlistentry>
- <term><option>-a</option></term>
- <term><option>--all</option></term>
- <listitem>
- <para>
- Display all child processes and their available connection slots.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-P <replaceable class="parameter">PID</replaceable></option></term>
- <term><option>--process-id=<replaceable class="parameter">PID</replaceable></option></term>
- <listitem>
- <para>
- PID of <productname>Pgpool-II</productname> child process.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>Other options </option></term>
- <listitem>
- <para>
- See <xref linkend="pcp-common-options">.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
-
- If -a nor -P is not specified, process information of all
- connected <productname>Pgpool-II</productname> child process will
- be printed. In this case if there's no
- connected <productname>Pgpool-II</productname> child process,
- nothing but "No process information available" message will be
- printed.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Example</title>
- <para>
- Here is an example output:
- <programlisting>
- $ pcp_proc_info -p 11001 1406
- test t-ishii 2018-07-09 16:43:53 2018-07-09 16:44:08 3 0 1 1435 1 1406 0
- test t-ishii 2018-07-09 16:43:53 2018-07-09 16:44:08 3 0 1 1436 1 1406 1
- </programlisting>
- </para>
- <para>
- The result is in the following order:
- <literallayout class="monospaced">
- 1. connected database name
- 2. connected user name
- 3. process start-up timestamp
- 4. connection created timestamp
- 5. protocol major version
- 6. protocol minor version
- 7. connection-reuse counter
- 8. PostgreSQL backend process id
- 9. 1 if frontend connected 0 if not
- 10. pgpool child process id
- 11. PostgreSQL backend id
- </literallayout>
- </para>
- <para>
- If <literal>-a</literal> or <literal>--all</literal> option is not specified and
- there is no connection to the backends, nothing will be displayed. If there are
- multiple connections, one connection's information will be displayed on each
- line multiple times. Timestamps are displayed in EPOCH format.
- </para>
- <para>
- The <option>--verbose</option> option can help understand the output. For example:
- </para>
- <programlisting>
- $ pcp_proc_info -p 11001 --verbose 1406
- Database : test
- Username : t-ishii
- Start time : 2018-07-09 16:43:53
- Creation time: 2018-07-09 16:44:08
- Major : 3
- Minor : 0
- Counter : 1
- Backend PID : 1435
- Connected : 1
- PID : 1406
- Backend ID : 0
- Database : test
- Username : t-ishii
- Start time : 2018-07-09 16:43:53
- Creation time: 2018-07-09 16:44:08
- Major : 3
- Minor : 0
- Counter : 1
- Backend PID : 1436
- Connected : 1
- PID : 1406
- Backend ID : 1
- </programlisting>
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/pcp_promote_node.sgml
-Pgpool-II documentation
--->
-
-<refentry id="PCP-PROMOTE-NODE">
- <indexterm zone="pcp-promote-node">
- <primary>pcp_promote_node</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pcp_promote_node</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>PCP Command</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pcp_promote_node</refname>
- <refpurpose>
- promotes the given node as new main to Pgpool-II</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>pcp_promote_node</command>
- <arg rep="repeat"><replaceable>options</replaceable></arg>
- <arg><replaceable>node_id</replaceable></arg>
- <arg><replaceable>gracefully</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="R1-PCP-PROMOTE-NODE-1">
- <title>Description</title>
- <para>
- <command>pcp_promote_node</command>
- promotes the given node as new primary to Pgpool-II. In streaming replication mode only. Please note that this command does not actually promote standby PostgreSQL backend: it just changes the internal status of Pgpool-II and trigger failover and users have to promote standby PostgreSQL outside Pgpool-II.
- </para>
-
- <para>
- <command>pcp_promote_node</command> executes followings. Please be
- warned that if <xref linkend="guc-follow-primary-command"> is set,
- the command will be executed. It is a standard advice that you
- disable <xref linkend="guc-follow-primary-command"> before executing
- this command.
-
- <orderedlist>
-
- <listitem>
- <para>
- Change the status of standby
- <productname>PostgreSQL</productname> from standby to
- primary. It just changes the internal status of Pgpool-II and it
- does not actually promote <productname>PostgreSQL</productname>
- standby server.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Change the status of <productname>PostgreSQL</productname> node
- which is not specified by this command's argument to down. It
- just changes the internal status of Pgpool-II and it does not
- actually make <productname>PostgreSQL</productname> standby
- server down.
- </para>
- </listitem>
-
- <listitem>
- <para>
- If <xref linkend="guc-follow-primary-command"> is set, execute
- <xref linkend="guc-follow-primary-command"> against
- <productname>PostgreSQL</productname>.
- </para>
- </listitem>
-
- </orderedlist>
- </para>
-
- </refsect1>
-
- <refsect1>
- <title>Options</title>
- <para>
- <variablelist>
-
- <varlistentry>
- <term><option>-n <replaceable class="parameter">node_id</replaceable></option></term>
- <term><option>--node-id=<replaceable class="parameter">node_id</replaceable></option></term>
- <listitem>
- <para>
- The index of backend node to promote as new main.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-g </option></term>
- <term><option>--gracefully</option></term>
- <listitem>
- <para>
- Wait until all clients are disconnected (unless client_idle_limit_in_recovery is -1 or recovery_timeout is expired).
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>Other options </option></term>
- <listitem>
- <para>
- See <xref linkend="pcp-common-options">.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </para>
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/pcp_recovery_node.sgml
-Pgpool-II documentation
--->
-
-<refentry id="PCP-RECOVERY-NODE">
- <indexterm zone="pcp-recovery-node">
- <primary>pcp_recovery_node</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pcp_recovery_node</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>PCP Command</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pcp_recovery_node</refname>
- <refpurpose>
- attaches the given backend node with recovery</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>pcp_recovery_node</command>
- <arg rep="repeat"><replaceable>options</replaceable></arg>
- <arg><replaceable>node_id</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="R1-PCP-RECOVERY-NODE-1">
- <title>Description</title>
- <para>
- <command>pcp_recovery_node</command>
- attaches the given backend node with recovery.
- See <xref linkend="runtime-online-recovery"> to set up necessary parameters of pgpool.conf.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Options</title>
- <para>
- <variablelist>
-
- <varlistentry>
- <term><option>-n <replaceable class="parameter">node_id</replaceable></option></term>
- <term><option>--node-id=<replaceable class="parameter">node_id</replaceable></option></term>
- <listitem>
- <para>
- The index of backend node.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>Other options </option></term>
- <listitem>
- <para>
- See <xref linkend="pcp-common-options">.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </para>
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/pcp_reload_config.sgml
-Pgpool-II documentation
--->
-
-<refentry id="PCP-RELOAD-CONFIG">
- <indexterm zone="pcp-reload-config">
- <primary>pcp_reload_config</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pcp_reload_config</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>PCP Command</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pcp_reload_config</refname>
- <refpurpose>
- reload pgpool-II config file</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>pcp_reload_config</command>
- <arg rep="repeat"><replaceable>options</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="R1-PCP-RELOAD-CONFIG-1">
- <title>Description</title>
- <para>
- <command>pcp_reload_config</command>
- reload Pgpool-II config file.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Options</title>
- <para>
- <variablelist>
-
- <varlistentry>
- <term><option>-s <replaceable class="parameter">scope</replaceable></option></term>
- <term><option>--scope=<replaceable class="parameter">scope</replaceable></option></term>
- <listitem>
- <para>
- Specifies the breadth of a command's impact.
- </para>
- <para>
- The supported command scopes are as follows (The default is "local"):
- <itemizedlist>
- <listitem><para>c, cluster : reload config files of all Pgpool-II nodes part of the cluster </para></listitem>
- <listitem><para>l, local : reload config file of local Pgpool-II node only </para></listitem>
- </itemizedlist>
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>Other options </option></term>
- <listitem>
- <para>
- See <xref linkend="pcp-common-options">.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </para>
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/pcp_stop_pgpool.sgml
-Pgpool-II documentation
--->
-
-<refentry id="PCP-STOP-PGPOOL">
- <indexterm zone="pcp-stop-pgpool">
- <primary>pcp_stop_pgpool</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pcp_stop_pgpool</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>PCP Command</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pcp_stop_pgpool</refname>
- <refpurpose>
- terminates the Pgpool-II process</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>pcp_stop_pgpool</command>
- <arg rep="repeat"><replaceable>options</replaceable></arg>
- <arg><replaceable>mode</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="R1-PCP-STOP-PGPOOL-1">
- <title>Description</title>
- <para>
- <command>pcp_stop_pgpool</command>
- terminates the Pgpool-II process.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Options</title>
- <para>
- <variablelist>
-
- <varlistentry>
- <term><option>-m <replaceable class="parameter">mode</replaceable></option></term>
- <term><option>--mode=<replaceable class="parameter">mode</replaceable></option></term>
- <listitem>
- <para>
- Shutdown mode for terminating the Pgpool-II process.
- </para>
- <para>
- The available modes are as follows (The default is "smart"):
- <itemizedlist>
- <listitem><para>s, smart : smart mode </para></listitem>
- <listitem><para>f, fast : fast mode </para></listitem>
- <listitem><para>i, immediate : immediate mode </para></listitem>
- </itemizedlist>
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-s <replaceable class="parameter">scope</replaceable></option></term>
- <term><option>--scope=<replaceable class="parameter">scope</replaceable></option></term>
- <listitem>
- <para>
- Specifies the breadth of a command's impact.
- </para>
- <para>
- The supported command scopes are as follows (The default is "local"):
- <itemizedlist>
- <listitem><para>c, cluster : terminates all Pgpool-II nodes part of the cluster </para></listitem>
- <listitem><para>l, local : terminates local Pgpool-II node only </para></listitem>
- </itemizedlist>
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>Other options </option></term>
- <listitem>
- <para>
- See <xref linkend="pcp-common-options">.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </para>
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/pcp_watchdog_info.sgml
-Pgpool-II documentation
--->
-
-<refentry id="PCP-WATCHDOG-INFO">
- <indexterm zone="pcp-watchdog-info">
- <primary>pcp_watchdog_info</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pcp_watchdog_info</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>PCP Command</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pcp_watchdog_info</refname>
- <refpurpose>
- displays the watchdog status of the Pgpool-II</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>pcp_watchdog_info</command>
- <arg rep="repeat"><replaceable>options</replaceable></arg>
- <arg><replaceable>watchdog_id</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="R1-PCP-WATCHDOG-INFO-1">
- <title>Description</title>
- <para>
- <command>pcp_node_info</command>
- displays the information on the given node ID.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Options</title>
- <para>
- <variablelist>
-
- <varlistentry>
- <term><option>-n <replaceable class="parameter">watchdog_id</replaceable></option></term>
- <term><option>--node-id=<replaceable class="parameter">watchdog_id</replaceable></option></term>
- <listitem>
- <para>
- The index of other Pgpool-II to get information for.
- </para>
- <para>
- Index 0 gets one's self watchdog information.
- </para>
- <para>
- If omitted then gets information of all watchdog nodes.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>Other options </option></term>
- <listitem>
- <para>
- See <xref linkend="pcp-common-options">.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </para>
- </refsect1>
-
- <refsect1>
- <title>Example</title>
- <para>
- Here is an example output:
- <programlisting>
- $ pcp_watchdog_info -h localhost -U postgres
-
- 3 NO Linux_host1.localdomain_9991 host1
-
- Linux_host1.localdomain_9991 host1 9991 9001 7 STANDBY
- Linux_host2.localdomain_9992 host2 9992 9002 4 LEADER
- Linux_host3.localdomain_9993 host3 9993 9003 7 STANDBY
- </programlisting>
- </para>
- <para>
- The result is in the following order:
- <literallayout class="monospaced">
- The first output line describes the watchdog cluster information:
-
- 1. Total watchdog nodes in the cluster
- 2. Is VIP is up on current node?
- 3. Leader node name
- 4. Leader node host
- </literallayout>
- <literallayout class="monospaced">
- Next is the list of watchdog nodes:
-
- 1. node name
- 2. hostname
- 3. pgpool port
- 4. watchdog port
- 5. current node state
- 6. current node state name
- </literallayout>
- </para>
- <para>
- The <option>--verbose</option> option can help understand the output. For example:
- </para>
- <programlisting>
- $ pcp_watchdog_info -h localhost -v -U postgres
-
- Watchdog Cluster Information
- Total Nodes : 3
- Remote Nodes : 2
- Quorum state : QUORUM EXIST
- Alive Remote Nodes : 2
- VIP up on local node : NO
- Leader Node Name : Linux_host2.localdomain_9992
- Leader Host Name : localhost
-
- Watchdog Node Information
- Node Name : Linux_host1.localdomain_9991
- Host Name : host1
- Delegate IP : 192.168.1.10
- Pgpool port : 9991
- Watchdog port : 9001
- Node priority : 1
- Status : 7
- Status Name : STANDBY
-
- Node Name : Linux_host2.localdomain_9992
- Host Name : host2
- Delegate IP : 192.168.1.10
- Pgpool port : 9992
- Watchdog port : 9002
- Node priority : 1
- Status : 4
- Status Name : LEADER
-
- Node Name : Linux_host3.localdomain_9993
- Host Name : host3
- Delegate IP : 192.168.1.10
- Pgpool port : 9993
- Watchdog port : 9003
- Node priority : 1
- Status : 7
- Status Name : STANDBY
- </programlisting>
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/pg_enc.sgml
-Pgpool-II documentation
--->
-
-<refentry id="PG-ENC">
- <indexterm zone="pg-enc">
- <primary>pg_enc</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pg_enc</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>Other Commands</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pg_enc</refname>
- <refpurpose>
- AES256 password encryption utility
- </refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>pg_enc</command>
- <arg rep="repeat"><replaceable>option</replaceable></arg>
- <arg choice="plain"><replaceable>-p</replaceable></arg>
- </cmdsynopsis>
- <cmdsynopsis>
- <command>pg_enc</command>
- <arg rep="repeat"><replaceable>option</replaceable></arg>
- <arg choice="plain"><replaceable>password</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="R1-PG-ENC-1">
- <title>Description</title>
- <para>
- <command>pg_enc</command>
- AES256 password encryption utility.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Options</title>
- <para>
- <variablelist>
-
- <varlistentry>
- <term><option>-k <replaceable class="parameter">KEY_FILE</replaceable></option></term>
- <term><option>--key-file=<replaceable class="parameter">KEY_FILE</replaceable></option></term>
- <listitem>
- <para>
- Set the path to the encryption key file. Default is the <literal>.pgpoolkey</literal> file
- located in the users home directory, which can be overridden by the environment variable <varname>PGPOOLKEYFILE</varname>.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-K <replaceable class="parameter">ENCRYPTION_KEY</replaceable></option></term>
- <term><option>--enc-key=<replaceable class="parameter">ENCRYPTION_KEY</replaceable></option></term>
- <listitem>
- <para>
- Encryption key to be used for encrypting database passwords.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-f <replaceable class="parameter">CONFIG_FILE</replaceable></option></term>
- <term><option>--config-file=<replaceable class="parameter">CONFIG_FILE</replaceable></option></term>
- <listitem>
- <para>
- Specifies the <literal>pgpool.conf</literal> file.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-i <replaceable class="parameter">INPUT_FILE</replaceable></option></term>
- <term><option>--input-file=<replaceable class="parameter">INPUT_FILE</replaceable></option></term>
- <listitem>
- <para>
- Specifies file containing username and password pairs.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-p</option></term>
- <term><option>--prompt</option></term>
- <listitem>
- <para>
- Prompt for database password using standard input.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-P</option></term>
- <term><option>--prompt-for-key</option></term>
- <listitem>
- <para>
- Prompt for encryption key using standard input.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-m</option></term>
- <term><option>--update-pass</option></term>
- <listitem>
- <para>
- Create encrypted password entry in the pool_passwd file.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-u <replaceable class="parameter">your_username</replaceable></option></term>
- <term><option>--username=<replaceable class="parameter">your_username</replaceable></option></term>
- <listitem>
- <para>
- Creates the <literal>pool_passwd</literal> entry for the database user called
- <literal>your_username</literal>.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-h</option></term>
- <term><option>--help</option></term>
- <listitem>
- <para>
- Prints the help for <literal>pg_enc</literal>.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </para>
- </refsect1>
-
- <refsect1>
- <title>Example</title>
- <para>
- Here is an example output:
- <programlisting>
- pg_enc -p
- db password: [your password]
- </programlisting>
- </para>
- <para>
- or
- </para>
- <programlisting>
- ./pg_enc foo
- trying to read key from file /home/pgpool/.pgpoolkey
-
- jglid1QRgiCl/vfhHUDyVA==
- pool_passwd string: AESjglid1QRgiCl/vfhHUDyVA==
- </programlisting>
- <para>
- <literal>pg_enc</literal> can be used for <literal>pool_passwd</literal> passwords with:
- <programlisting>
- pg_enc -m -f /path/to/pgpool.conf -u username -p
- db password: [your password]
- </programlisting>
- which will add an entry for <literal>username</literal> with the password given.
- </para>
- <para>
- To avoid password prompt or password in command parameter,
- <literal>pg_enc</literal> can read user name:password pairs from file.
- It will add all user names and encrypted password to
- <xref linkend="guc-pool-passwd"> authentication file.
- <programlisting>
- $ cat users.txt
- username1:secretpassword1
- username2:secretpassword2
-
- $ pg_enc -m -f /path/to/pgpool.conf -i users.txt
- trying to read key from file /home/pgpool/.pgpoolkey
- trying to read user:password pairs from file users.text
-
- $ cat /path/to/pool_passwd
- username1:AESrx5QdpGyW/+4CB80KWtwhg==
- username2:AESUAdohy7nCUhWliRI9WiYQA==
- </programlisting>
- </para>
-
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/pg_md5.sgml
-Pgpool-II documentation
--->
-
-<refentry id="PG-MD5">
- <indexterm zone="pg-md5">
- <primary>pg_md5</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pg_md5</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>Other Commands</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pg_md5</refname>
- <refpurpose>
- produces encrypted password in md5</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>pg_md5</command>
- <arg rep="repeat"><replaceable>option</replaceable></arg>
- <arg choice="plain"><replaceable>-p</replaceable></arg>
- </cmdsynopsis>
- <cmdsynopsis>
- <command>pg_md5</command>
- <arg rep="repeat"><replaceable>option</replaceable></arg>
- <arg choice="plain"><replaceable>password</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="R1-PG-MD5-1">
- <title>Description</title>
- <para>
- <command>pg_md5</command>
- produces encrypted password in md5.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Options</title>
- <para>
- <variablelist>
-
- <varlistentry>
- <term><option>-p</option></term>
- <term><option>--prompt</option></term>
- <listitem>
- <para>
- Prompt password using standard input.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-m</option></term>
- <term><option>--md5auth</option></term>
- <listitem>
- <para>
- Produce md5 authentication password to authentication file <filename>pool_passwd</filename>.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-u <replaceable class="parameter">your_username</replaceable></option></term>
- <term><option>--username=<replaceable class="parameter">your_username</replaceable></option></term>
- <listitem>
- <para>
- When producing a md5 authentication password, create the pool_passwd entry for <literal>your_username</literal>.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-f <replaceable class="parameter">config_file</replaceable></option></term>
- <term><option>--config-file=<replaceable class="parameter">config_file</replaceable></option></term>
- <listitem>
- <para>
- Specify the path to the <literal>pgpool.conf</literal> configuration file.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-i <replaceable class="parameter">input_file</replaceable></option></term>
- <term><option>--input-file=<replaceable class="parameter">input_file</replaceable></option></term>
- <listitem>
- <para>
- Specifies file containing user name and password pairs.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </para>
- </refsect1>
-
- <refsect1>
- <title>Example</title>
- <para>
- The following are examples to encrypt your password into md5 hash format for <filename>pcp.conf</filename>.
- <programlisting>
- $ pg_md5 -p
- password: [your password]
- </programlisting>
- </para>
- <para>
- or
- </para>
- <programlisting>
- $ pg_md5 [your password]
- acbd18db4cc2f85cedef654fccc4a4d8
- </programlisting>
-
- <para>
- <literal>pg_md5</literal> can also be used for adding an entry of user name and
- <literal>md5</literal> encrypted password to
- <xref linkend="guc-pool-passwd"> authentication file.
- <programlisting>
- $ pg_md5 -m -f /path/to/pgpool.conf -u username -p
- password: [your password]
-
- $ cat /path/to/pool_passwd
- username:md55a231fcdb710d73268c4f44283487ba2
- </programlisting>
-
- To avoid password prompt or password in command parameter,
- <literal>pg_md5</literal> can read user name:password pairs from file.
- It will add all user names and <literal>md5</literal> hashed password to
- <xref linkend="guc-pool-passwd"> authentication file.
- <programlisting>
- $ cat users.txt
- username1:secretpassword1
- username2:secretpassword1
-
- $ pg_md5 -m -f /path/to/pgpool.conf -i users.txt
- trying to read username:password pairs from file users.txt
-
- $ cat /path/to/pool_passwd
- username1:md533314126ba0b187df1e37f5ce6a489a8
- username2:md58ae92c6e1d6a48d80e2583fe715e2b36
- </programlisting>
-
- To just display the md5 hashed string, not adding an entry to <xref linkend="guc-pool-passwd">, pass a string concatenating password and user name.
- For example, if password is "password" and user name is "user", the output would be:
- <programlisting>
- $ pg_md5 passworduser
- 4d45974e13472b5a0be3533de4666414
- </programlisting>
- Please note that the actual entry to be inserted into
- <xref linkend="guc-pool-passwd"> should have "md5" on top of the
- result string. That is: "md54d45974e13472b5a0be3533de4666414".
- </para>
- </refsect1>
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/pgpool.sgml
-Pgpool-II documentation
--->
-
-<refentry id="pgpool">
- <indexterm zone="pgpool">
- <primary>pgpool</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pgpool</refentrytitle>
- <manvolnum>8</manvolnum>
- <refmiscinfo>Server Commands</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pgpool</refname>
- <refpurpose>
- <productname>Pgpool-II</productname> main server</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>pgpool</command>
- <arg rep="repeat"><replaceable>option</replaceable></arg>
- </cmdsynopsis>
- <cmdsynopsis>
- <command>pgpool</command>
- <arg rep="repeat"><replaceable>option</replaceable></arg>
- <arg choice="plain"><replaceable>stop</replaceable></arg>
- </cmdsynopsis>
-
- <cmdsynopsis>
- <command>pgpool</command>
- <arg rep="repeat"><replaceable>option</replaceable></arg>
- <arg choice="plain"><replaceable>reload</replaceable></arg>
- </cmdsynopsis>
-
- </refsynopsisdiv>
-
- <refsect1 id="R8-PGPOOL-8">
- <title>Description</title>
- <para>
- the <productname>Pgpool-II</productname> main server
- </para>
- </refsect1>
-
- <refsect1>
- <title>Usages</title>
- <para>
- <command>pgpool</command> runs in 3 modes: start, stop and reload.
- If none of stop or reload is given, it is assumed that "start" is specified.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Common options</title>
- <para>
- These are common options for 3 modes.
-
- <variablelist>
-
- <varlistentry>
- <term><option>-a <replaceable class="parameter">hba_config_file</replaceable></option></term>
- <term><option>--hba-file=<replaceable class="parameter">hba_config_file</replaceable></option></term>
- <listitem>
- <para>
- Set the path to the <filename>pool_hba.conf</filename> configuration file.
- Mandatory if the file is placed other than the standard location.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-f <replaceable class="parameter">config_file</replaceable></option></term>
- <term><option>--config-file=<replaceable class="parameter">config_file</replaceable></option></term>
- <listitem>
- <para>
- Set the path to the <filename>pgpool.conf</filename> configuration file.
- Mandatory if the file is placed other than the standard location.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-F <replaceable class="parameter">pc_config_file</replaceable></option></term>
- <term><option>--pcp-file=<replaceable class="parameter">pcp_config_file</replaceable></option></term>
- <listitem>
- <para>
- Set the path to the <filename>pcp.conf</filename> configuration file.
- Mandatory if the file is placed other than the standard location.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-k <replaceable class="parameter">key_file</replaceable></option></term>
- <term><option>--key-file=<replaceable class="parameter">key_file</replaceable></option></term>
- <listitem>
- <para>
- Set the path to the <filename>.pgpoolkey</filename> file.
- Mandatory if you use AES256 encrypted password and the file is placed other than the standard location and used.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-h</option></term>
- <term><option>--help</option></term>
- <listitem>
- <para>
- Print help.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </para>
-
- </refsect1>
-
- <refsect1>
-
- <title>Starting <productname>Pgpool-II</productname> main server</title>
- <para>
- Here are options for the start mode.
-
- <variablelist>
-
- <varlistentry>
- <term><option>-d</option></term>
- <term><option>--debug</option></term>
- <listitem>
- <para>
- Run <productname>Pgpool-II</productname> in debug mode.
- Lots of debug messages are produced.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-n</option></term>
- <term><option>--dont-detach</option></term>
- <listitem>
- <para>
- Don't run in daemon mode, does not detach control ttys.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-x</option></term>
- <term><option>--debug-assertions</option></term>
- <listitem>
- <para>
- Turns on various assertion checks, This is a debugging aid.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-C</option></term>
- <term><option>--clear-oidmaps</option></term>
- <listitem>
- <para>
- Clear query cache oidmaps when <xref linkend="guc-memqcache-method"> is
- <varname>memcached</varname>.
- </para>
- <para>
- If memqcache_method
- is <varname>shmem</varname>, <productname>Pgpool-II</productname>
- always discards oidmaps at the start-up time. So this option
- is not necessary.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-D</option></term>
- <term><option>--discard-status</option></term>
- <listitem>
- <para>
- Discard <filename>pgpool_status</filename> file and do not
- restore previous status.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </para>
- </refsect1>
-
- <refsect1>
-
- <title>Stopping <productname>Pgpool-II</productname> main server</title>
- <para>
- Here are options for the stop mode.
-
- <variablelist>
-
- <varlistentry>
- <term><option>-m <replaceable class="parameter">shutdown_mode</replaceable></option></term>
- <term><option>--mode=<replaceable class="parameter">shutdown_mode</replaceable></option></term>
- <listitem>
- <para>
- Stop <productname>Pgpool-II</productname>.
- <varname>shutdown_mode</varname> is
- either <literal>smart</literal>, <literal>fast</literal>
- or <literal>immediate</literal>. If <literal>smart</literal>
- is specified, <productname>Pgpool-II</productname> will wait
- for all clients are disconnected. If <literal>fast</literal>
- or <literal>immediate</literal> are
- specified, <productname>Pgpool-II</productname> immediately
- stops itself without waiting for all clients are
- disconnected. There's no difference
- between <literal>fast</literal>
- and <literal>immediate</literal> in the current
- implementation.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </para>
- </refsect1>
-
- <refsect1>
- <title>Reloading <productname>Pgpool-II</productname> configuration files</title>
- <para>
- Reload configuration file
- of <productname>Pgpool-II</productname>. No specific options
- exist for reload mode. Common options are applicable.
- </para>
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/pgpool_adm_pcp_attach_node.sgml
-Pgpool-II documentation
--->
-
-<refentry id="PGPOOL-ADM-PCP-ATTACH-NODE">
- <indexterm zone="pgpool-adm-pcp-attach-node">
- <primary>pgpool_adm_pcp_attach_node</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pgpool_adm_pcp_attach_node</refentrytitle>
- <manvolnum>3</manvolnum>
- <refmiscinfo>pgpool_adm extension</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pgpool_adm_pcp_attach_node</refname>
- <refpurpose>
- a function to attach given node ID</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <funcsynopsis>
- <funcprototype>
- <funcdef><function>pcp_attach_node</function> returns record</funcdef>
- <paramdef>integer <parameter>node_id</parameter></paramdef>
- <paramdef>text <parameter>host</parameter></paramdef>
- <paramdef>integer <parameter>port</parameter></paramdef>
- <paramdef>text <parameter>username</parameter></paramdef>
- <paramdef>text <parameter>password</parameter></paramdef>
- <paramdef>out <parameter>node_attached boolean</parameter></paramdef>
- </funcprototype>
-
- <funcprototype>
- <funcdef><function>pcp_attach_node</function> returns record</funcdef>
- <paramdef>integer <parameter>node_id</parameter></paramdef>
- <paramdef>text <parameter>pcp_server</parameter></paramdef>
- <paramdef>out <parameter>node_attached boolean</parameter></paramdef>
- </funcprototype>
-
- </funcsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="R3-PCP-ATTACH-NODE-3">
- <title>Description</title>
- <para>
- <function>pcp_attach_node</function> attaches a node
- to <productname>Pgpool-II</productname>.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Arguments</title>
- <para>
- <variablelist>
-
- <varlistentry>
- <term><replaceable class="parameter">node_id</replaceable></term>
- <listitem>
- <para>
- The index of backend node to attach.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><replaceable class="parameter">pcp_server</replaceable></term>
- <listitem>
- <para>
- The foreign server name for pcp server.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>Other arguments </option></term>
- <listitem>
- <para>
- See <xref linkend="pcp-common-options">.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </para>
- </refsect1>
-
- <refsect1>
- <title>Example</title>
- <para>
- Here is an example output:
- <programlisting>
- test=# SELECT * FROM pcp_attach_node(node_id => 1, host => 'localhost', port => 11001, username => 't-ishii', password => 't-ishii');
- node_attached
- ---------------
- t
- (1 row)
- </programlisting>
- </para>
-
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/pgpool_adm_pcp_detach_node.sgml
-Pgpool-II documentation
--->
-
-<refentry id="PGPOOL-ADM-PCP-DETACH-NODE">
- <indexterm zone="pgpool-adm-pcp-detach-node">
- <primary>pgpool_adm_pcp_detach_node</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pgpool_adm_pcp_detach_node</refentrytitle>
- <manvolnum>3</manvolnum>
- <refmiscinfo>pgpool_adm extension</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pgpool_adm_pcp_detach_node</refname>
- <refpurpose>
- a function to detach given node ID</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <funcsynopsis>
- <funcprototype>
- <funcdef><function>pcp_detach_node</function> returns record</funcdef>
- <paramdef>integer <parameter>node_id</parameter></paramdef>
- <paramdef>boolean <parameter>gracefully</parameter></paramdef>
- <paramdef>text <parameter>host</parameter></paramdef>
- <paramdef>integer <parameter>port</parameter></paramdef>
- <paramdef>text <parameter>username</parameter></paramdef>
- <paramdef>text <parameter>password</parameter></paramdef>
- <paramdef>out <parameter>node_detached boolean</parameter></paramdef>
- </funcprototype>
-
- <funcprototype>
- <funcdef><function>pcp_detach_node</function> returns record</funcdef>
- <paramdef>integer <parameter>node_id</parameter></paramdef>
- <paramdef>boolean <parameter>gracefully</parameter></paramdef>
- <paramdef>text <parameter>pcp_server</parameter></paramdef>
- <paramdef>out <parameter>node_detached boolean</parameter></paramdef>
- </funcprototype>
-
- </funcsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="R3-PCP-DETACH-NODE-3">
- <title>Description</title>
- <para>
- <function>pcp_detach_node</function> detaches a node
- from <productname>Pgpool-II</productname>.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Arguments</title>
- <para>
- <variablelist>
-
- <varlistentry>
- <term><replaceable class="parameter">node_id</replaceable></term>
- <listitem>
- <para>
- The index of backend node to detach.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><replaceable class="parameter">gracefully</replaceable></term>
- <listitem>
- <para>
- If true, wait for all session
- of <productname>pgpool-II</productname> terminates.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><replaceable class="parameter">pcp_server</replaceable></term>
- <listitem>
- <para>
- The foreign server name for pcp server.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>Other arguments </option></term>
- <listitem>
- <para>
- See <xref linkend="pcp-common-options">.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </para>
- </refsect1>
-
- <refsect1>
- <title>Example</title>
- <para>
- Here is an example output:
- <programlisting>
- test=# SELECT * FROM pcp_detach_node(node_id => 1, gracefully => 'false', host => 'localhost', port => 11001, username => 't-ishii', password => 't-ishii');
- node_detached
- ---------------
- t
- (1 row)
- </programlisting>
- </para>
-
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/pgpool_adm_pcp_health_check_stats.sgml
-Pgpool-II documentation
--->
-
-<refentry id="PGPOOL-ADM-PCP-HEAlTH-CHECK-STATS">
- <indexterm zone="pgpool-adm-pcp-health-check-stats">
- <primary>pgpool_adm_pcp_health_check_stats</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pgpool_adm_pcp_health_check_stats</refentrytitle>
- <manvolnum>3</manvolnum>
- <refmiscinfo>pgpool_adm extension</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pgpool_adm_pcp_health_check_stats</refname>
- <refpurpose>
- a function to display health check statistics data on given node ID</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <funcsynopsis>
- <funcprototype>
- <funcdef><function>pcp_health_check_stats</function> returns record</funcdef>
- <paramdef>integer <parameter>node_id</parameter></paramdef>
- <paramdef>text <parameter>host</parameter></paramdef>
- <paramdef>integer <parameter>port</parameter></paramdef>
- <paramdef>text <parameter>username</parameter></paramdef>
- <paramdef>text <parameter>password</parameter></paramdef>
- <paramdef>out <parameter>node_id integer</parameter></paramdef>
- <paramdef>out <parameter>host text</parameter></paramdef>
- <paramdef>out <parameter>port integer</parameter></paramdef>
- <paramdef>out <parameter>status text</parameter></paramdef>
- <paramdef>out <parameter>role text</parameter></paramdef>
- <paramdef>out <parameter>last_status_change timestamp</parameter></paramdef>
- <paramdef>out <parameter>total_count bigint</parameter></paramdef>
- <paramdef>out <parameter>success_count bigint</parameter></paramdef>
- <paramdef>out <parameter>fail_count bigint</parameter></paramdef>
- <paramdef>out <parameter>skip_count bigint</parameter></paramdef>
- <paramdef>out <parameter>retry_count bigint</parameter></paramdef>
- <paramdef>out <parameter>average_retry_count bigint</parameter></paramdef>
- <paramdef>out <parameter>max_retry_count bigint</parameter></paramdef>
- <paramdef>out <parameter>max_health_check_duration bigint</parameter></paramdef>
- <paramdef>out <parameter>min_health_check_duration bigint</parameter></paramdef>
- <paramdef>out <parameter>average_health_check_duration float4</parameter></paramdef>
- <paramdef>out <parameter>last_health_check timestamp</parameter></paramdef>
- <paramdef>out <parameter>last_successful_health_check timestamp</parameter></paramdef>
- <paramdef>out <parameter>last_skip_health_check timestamp</parameter></paramdef>
- <paramdef>out <parameter>last_failed_health_check timestamp</parameter></paramdef>
- </funcprototype>
-
- <funcprototype>
- <funcdef><function>pcp_health_check_stats</function> returns record</funcdef>
- <paramdef>integer <parameter>node_id</parameter></paramdef>
- <paramdef>text <parameter>pcp_server</parameter></paramdef>
- <paramdef>out <parameter>node_id integer</parameter></paramdef>
- <paramdef>out <parameter>host text</parameter></paramdef>
- <paramdef>out <parameter>port integer</parameter></paramdef>
- <paramdef>out <parameter>status text</parameter></paramdef>
- <paramdef>out <parameter>role text</parameter></paramdef>
- <paramdef>out <parameter>last_status_change timestamp</parameter></paramdef>
- <paramdef>out <parameter>total_count bigint</parameter></paramdef>
- <paramdef>out <parameter>success_count bigint</parameter></paramdef>
- <paramdef>out <parameter>fail_count bigint</parameter></paramdef>
- <paramdef>out <parameter>skip_count bigint</parameter></paramdef>
- <paramdef>out <parameter>retry_count bigint</parameter></paramdef>
- <paramdef>out <parameter>average_retry_count bigint</parameter></paramdef>
- <paramdef>out <parameter>max_retry_count bigint</parameter></paramdef>
- <paramdef>out <parameter>max_health_check_duration bigint</parameter></paramdef>
- <paramdef>out <parameter>min_health_check_duration bigint</parameter></paramdef>
- <paramdef>out <parameter>average_health_check_duration float4</parameter></paramdef>
- <paramdef>out <parameter>last_health_check timestamp</parameter></paramdef>
- <paramdef>out <parameter>last_successful_health_check timestamp</parameter></paramdef>
- <paramdef>out <parameter>last_skip_health_check timestamp</parameter></paramdef>
- <paramdef>out <parameter>last_failed_health_check timestamp</parameter></paramdef>
- </funcprototype>
-
- </funcsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="R3-PCP-HEALTH-CHECK-STATS-3">
- <title>Description</title>
- <para>
- <function>pcp_health_check_stats</function>
- displays health check statistics data on given node ID.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Arguments</title>
- <para>
- <variablelist>
-
- <varlistentry>
- <term><replaceable class="parameter">node_id</replaceable></term>
- <listitem>
- <para>
- The index of backend node to get information of.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><replaceable class="parameter">pcp_server</replaceable></term>
- <listitem>
- <para>
- The foreign server name for pcp server.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>Other arguments </option></term>
- <listitem>
- <para>
- See <xref linkend="pcp-common-options">.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </para>
- </refsect1>
-
- <refsect1>
- <title>Example</title>
- <para>
- Here is an example output:
- <programlisting>
-test=# select * from pcp_health_check_stats(node_id => 0, host => '', port => 11001, username => 't-ishii', password => 't-ishii');
--[ RECORD 1 ]-----------------+--------------------
-node_id | 0
-host | /tmp
-port | 11002
-status | up
-role | primary
-last_status_change | 2020-02-25 16:05:29
-total_count | 3
-success_count | 3
-fail_count | 0
-skip_count | 0
-retry_count | 0
-average_retry_count | 0
-max_retry_count | 0
-max_health_check_duration | 5
-min_health_check_duration | 3
-average_health_check_duration | 4.333333
-last_health_check | 2020-02-25 16:05:47
-last_successful_health_check | 2020-02-25 16:05:47
-last_skip_health_check |
-last_failed_health_check |
- </programlisting>
- </para>
-
- <para>
- See <xref linkend="health-check-stats-data-table"> for details of data.
- </para>
-
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/pgpool_adm_pcp_node_count.sgml
-Pgpool-II documentation
--->
-
-<refentry id="PGPOOL-ADM-PCP-NODE-COUNT">
- <indexterm zone="pgpool-adm-pcp-node-count">
- <primary>pgpool_adm_pcp_node_count</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pgpool_adm_pcp_node_count</refentrytitle>
- <manvolnum>3</manvolnum>
- <refmiscinfo>pgpool_adm extension</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pgpool_adm_pcp_node_count</refname>
- <refpurpose>
- a function to retrieves number of backend nodes.
- </refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <funcsynopsis>
- <funcprototype>
- <funcdef><function>pcp_node_count</function> returns integer</funcdef>
- <paramdef>text <parameter>host</parameter></paramdef>
- <paramdef>integer <parameter>port</parameter></paramdef>
- <paramdef>text <parameter>username</parameter></paramdef>
- <paramdef>text <parameter>password</parameter></paramdef>
- </funcprototype>
-
- <funcprototype>
- <funcdef><function>pcp_node_count</function> returns integer</funcdef>
- <paramdef>text <parameter>pcp_server</parameter></paramdef>
- </funcprototype>
-
- </funcsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="R3-PCP-NODE-COUNT-3">
- <title>Description</title>
- <para>
- <function>pcp_node_count</function> retrieves number of DB nodes.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Arguments</title>
- <para>
- <variablelist>
-
- <varlistentry>
- <term><replaceable class="parameter">pcp_server</replaceable></term>
- <listitem>
- <para>
- The foreign server name for pcp server.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>Other arguments </option></term>
- <listitem>
- <para>
- See <xref linkend="pcp-common-options">.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </para>
- </refsect1>
-
- <refsect1>
- <title>Example</title>
- <para>
- Here is an example output:
- <programlisting>
- test=# SELECT * FROM pcp_node_count(host => 'localhost', port => 11001, username => 't-ishii', password => 't-ishii');
- node_count
- ------------
- 2
- (1 row)
- </programlisting>
- </para>
-
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/pgpool_adm_pcp_node_info.sgml
-Pgpool-II documentation
--->
-
-<refentry id="PGPOOL-ADM-PCP-NODE-INFO">
- <indexterm zone="pgpool-adm-pcp-node-info">
- <primary>pgpool_adm_pcp_node_info</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pgpool_adm_pcp_node_info</refentrytitle>
- <manvolnum>3</manvolnum>
- <refmiscinfo>pgpool_adm extension</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pgpool_adm_pcp_node_info</refname>
- <refpurpose>
- a function to display the information on the given node
- ID</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <funcsynopsis>
- <funcprototype>
- <funcdef><function>pcp_node_info</function> returns record</funcdef>
- <paramdef>integer <parameter>node_id</parameter></paramdef>
- <paramdef>text <parameter>host</parameter></paramdef>
- <paramdef>integer <parameter>port</parameter></paramdef>
- <paramdef>text <parameter>username</parameter></paramdef>
- <paramdef>text <parameter>password</parameter></paramdef>
- <paramdef>out <parameter>status text</parameter></paramdef>
- <paramdef>out <parameter>weight float4</parameter></paramdef>
- <paramdef>out <parameter>role text</parameter></paramdef>
- <paramdef>out <parameter>replication_delay bigint</parameter></paramdef>
- <paramdef>out <parameter>replication_state text</parameter></paramdef>
- <paramdef>out <parameter>replication_sync_state text</parameter></paramdef>
- <paramdef>out <parameter>last_status_change timestamp</parameter></paramdef>
- </funcprototype>
-
- <funcprototype>
- <funcdef><function>pcp_node_info</function> returns record</funcdef>
- <paramdef>integer <parameter>node_id</parameter></paramdef>
- <paramdef>text <parameter>pcp_server</parameter></paramdef>
- <paramdef>out <parameter>status text</parameter></paramdef>
- <paramdef>out <parameter>weight float4</parameter></paramdef>
- <paramdef>out <parameter>role text</parameter></paramdef>
- <paramdef>out <parameter>replication_delay bigint</parameter></paramdef>
- <paramdef>out <parameter>replication_state text</parameter></paramdef>
- <paramdef>out <parameter>replication_sync_state text</parameter></paramdef>
- <paramdef>out <parameter>last_status_change timestamp</parameter></paramdef>
- </funcprototype>
-
- </funcsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="R3-PCP-NODE-INFO-3">
- <title>Description</title>
- <para>
- <function>pcp_node_info</function>
- displays the information on the given node ID.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Arguments</title>
- <para>
- <variablelist>
-
- <varlistentry>
- <term><replaceable class="parameter">node_id</replaceable></term>
- <listitem>
- <para>
- The index of backend node to get information of.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><replaceable class="parameter">pcp_server</replaceable></term>
- <listitem>
- <para>
- The foreign server name for pcp server.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>Other arguments </option></term>
- <listitem>
- <para>
- See <xref linkend="pcp-common-options">.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </para>
- </refsect1>
-
- <refsect1>
- <title>Example</title>
- <para>
- Here is an example output:
- <programlisting>
- test=# SELECT * FROM pcp_node_info(node_id => 1, host => '', port => 11001, username => 't-ishii', password => 't-ishii');
- host | port | status | weight | role | replication_delay | replication_state | replication_sync_state | last_status_change
- ------+-------+-------------------+--------+---------+-------------------+-------------------+------------------------+---------------------
- /tmp | 11003 | Connection in use | 0 | Standby | 0 | streaming | async | 2019-04-23 15:02:46
- (1 row)
- </programlisting>
- </para>
-
- <note>
- <para>
- <parameter>role</parameter>, <parameter>replication_delay</parameter>, <parameter>last_status_change</parameter>
- out parameters are new
- from <productname>Pgpool-II</productname> 4.0. If you have
- already installed pre-4.0 pgpool_adm extension, you can upgrade
- to the new one by using ALTER EXTENSION SQL command.
- <programlisting>
- ALTER EXTENSION pgpool_adm UPDATE;
- </programlisting>
- </para>
- </note>
-
- <note>
- <para>
- <parameter>replication_state</parameter> and <parameter>replication_sync_state</parameter> out parameters are new from <productname>Pgpool-II</productname> 4.1. If you have
- already installed pre-4.1 pgpool_adm extension, you can upgrade
- to the new one by using ALTER EXTENSION SQL command.
- <programlisting>
- ALTER EXTENSION pgpool_adm UPDATE;
- </programlisting>
- </para>
- </note>
-
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/pgpool_adm_pcp_pool_status.sgml
-Pgpool-II documentation
--->
-
-<refentry id="PGPOOL-ADM-PCP-POOL-STATUS">
- <indexterm zone="pgpool-adm-pcp-pool-status">
- <primary>pgpool_adm_pcp_pool_status</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pgpool_adm_pcp_pool_status</refentrytitle>
- <manvolnum>3</manvolnum>
- <refmiscinfo>pgpool_adm extension</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pgpool_adm_pcp_pool_status</refname>
- <refpurpose>
- a function to retrieves parameters in pgpool.conf.</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <funcsynopsis>
- <funcprototype>
- <funcdef><function>pcp_pool_status</function> returns record</funcdef>
- <paramdef>text <parameter>host</parameter></paramdef>
- <paramdef>integer <parameter>port</parameter></paramdef>
- <paramdef>text <parameter>username</parameter></paramdef>
- <paramdef>text <parameter>password</parameter></paramdef>
- <paramdef>out <parameter>item text</parameter></paramdef>
- <paramdef>out <parameter>value text</parameter></paramdef>
- <paramdef>out <parameter>description text</parameter></paramdef>
- </funcprototype>
-
- <funcprototype>
- <funcdef><function>pcp_pool_status</function> returns record</funcdef>
- <paramdef>text <parameter>pcp_server</parameter></paramdef>
- <paramdef>out <parameter>item text</parameter></paramdef>
- <paramdef>out <parameter>value text</parameter></paramdef>
- <paramdef>out <parameter>description text</parameter></paramdef>
- </funcprototype>
-
- </funcsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="R3-PCP-POOL-STATUS-3">
- <title>Description</title>
- <para>
- <function>pcp_pool_status</function> retrieves parameters in
- pgpool.conf.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Arguments</title>
- <para>
- <variablelist>
-
- <varlistentry>
- <term><replaceable class="parameter">pcp_server</replaceable></term>
- <listitem>
- <para>
- The foreign server name for pcp server.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>Other arguments </option></term>
- <listitem>
- <para>
- See <xref linkend="pcp-common-options">.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </para>
- </refsect1>
-
- <refsect1>
- <title>Example</title>
- <para>
- Here is an example output:
- <programlisting>
- test=# SELECT * FROM pcp_pool_status(host => 'localhost', port => 11001, username => 't-ishii', password => 't-ishii') WHERE item ~ 'backend.*0';
- item | value | description
- -------------------------+------------------------------------------------+-------------------------------
- backend_hostname0 | /tmp | backend #0 hostname
- backend_port0 | 11002 | backend #0 port number
- backend_weight0 | 0.500000 | weight of backend #0
- backend_data_directory0 | /home/t-ishii/work/pgpool-II/current/aaa/data0 | data directory for backend #0
- backend_status0 | 2 | status of backend #0
- backend_flag0 | ALLOW_TO_FAILOVER | backend #0 flag
- (6 rows)
- </programlisting>
- </para>
-
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/reset.sgml
-PostgreSQL documentation
--->
-
-<refentry id="SQL-PGPOOL-RESET">
- <indexterm zone="sql-pgpool-reset">
- <primary>RESET</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>PGPOOL RESET</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>SQL - Language Statements</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>PGPOOL RESET</refname>
- <refpurpose>restore the value of a configuration parameter to the default value</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <synopsis>
- PGPOOL RESET <replaceable class="PARAMETER">configuration_parameter</replaceable>
- PGPOOL RESET ALL
- </synopsis>
- </refsynopsisdiv>
-
- <refsect1>
- <title>Description</title>
-
- <para>
- <command>PGPOOL RESET</command> command restores the value of
- <productname>Pgpool-II</productname> configuration parameters to
- the default value.
- The default value is defined as the value that the parameter would have had,
- if no <command>PGPOOL SET</command> had ever been issued for it in the
- current session.
-
- This command is similar to the
- <ulink url="https://www.postgresql.org/docs/current/static/sql-reset.html">
- <command>RESET</command></ulink> command in PostgreSQL with an addition
- of <acronym>PGPOOL</acronym> keyword to distinguish it from the
- PostgreSQL RESET command.
-
- </para>
-
- </refsect1>
-
- <refsect1>
- <title>Parameters</title>
-
- <variablelist>
- <varlistentry>
- <term><replaceable class="PARAMETER">configuration_parameter</replaceable></term>
- <listitem>
- <para>
- Name of a settable <productname>Pgpool-II</productname> configuration parameter.
- Available parameters are
- documented in <xref linkend="runtime-config">.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><literal>ALL</literal></term>
- <listitem>
- <para>
- Resets all settable <productname>Pgpool-II</productname> configuration parameters to default values.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
-
- <refsect1>
- <title>Examples</title>
-
- <para>
- Reset the value of <xref linkend="guc-client-idle-limit"> parameter:
- <screen>
- PGPOOL RESET client_idle_limit;
- </screen></para>
-
- <para>
- Reset the value of all parameter to default:
- <screen>
- PGPOOL RESET ALL;
- </screen></para>
- </refsect1>
-
-
- <refsect1>
- <title>See Also</title>
-
- <simplelist type="inline">
- <member><xref linkend="SQL-PGPOOL-SET"></member>
- <member><xref linkend="SQL-PGPOOL-SHOW"></member>
- </simplelist>
- </refsect1>
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/set.sgml
-PostgreSQL documentation
--->
-
-<refentry id="SQL-PGPOOL-SET">
- <indexterm zone="sql-pgpool-set">
- <primary>SET</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>PGPOOL SET</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>SQL - Language Statements</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>PGPOOL SET</refname>
- <refpurpose>change a configuration parameter</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <synopsis>
- PGPOOL SET <replaceable class="PARAMETER">configuration_parameter</replaceable> { TO | = } { <replaceable class="PARAMETER">value</replaceable> | '<replaceable class="PARAMETER">value</replaceable>' | DEFAULT }
- </synopsis>
- </refsynopsisdiv>
-
- <refsect1>
- <title>Description</title>
-
- <para>
-
- The <command>PGPOOL SET</command> command changes the value of
- <productname>Pgpool-II</productname> configuration parameters for the current session.
-
- This command is similar to the
- <ulink url="https://www.postgresql.org/docs/current/static/sql-set.html">
- <command>SET</command></ulink> command in PostgreSQL with an addition
- of <acronym>PGPOOL</acronym> keyword to distinguish it from the
- PostgreSQL SET command.
- Many of the configuration parameters listed in
- <xref linkend="runtime-config"> can be changed on-the-fly with
- <command>PGPOOL SET</command> and it only affects the value used by the current
- session.
- </para>
-
- </refsect1>
-
- <refsect1>
- <title>Examples</title>
-
- <para>
- Change the value of <xref linkend="guc-client-idle-limit"> parameter:
- <programlisting>
- PGPOOL SET client_idle_limit = 350;
- </programlisting>
- </para>
-
- <para>
- Reset the value of <xref linkend="guc-client-idle-limit"> parameter to default:
- <programlisting>
- PGPOOL SET client_idle_limit TO DEFAULT;
- </programlisting>
- </para>
-
- <para>
- Change the value of <xref linkend="guc-log-min-messages"> parameter:
- <programlisting>
- PGPOOL SET log_min_messages TO INFO;
- </programlisting>
- </para>
-
- </refsect1>
-
- <refsect1>
- <title>See Also</title>
-
- <simplelist type="inline">
- <member><xref linkend="SQL-PGPOOL-RESET"></member>
- <member><xref linkend="SQL-PGPOOL-SHOW"></member>
- </simplelist>
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/pgpool_setup.sgml
-Pgpool-II documentation
--->
-
-<refentry id="PGPOOL-SETUP">
- <indexterm zone="pgpool-setup">
- <primary>pgpool_setup</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pgpool_setup</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>Other Commands</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pgpool_setup</refname>
- <refpurpose>
- Create a temporary installation of Pgpool-II cluster</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>pgpool_setup</command>
- <arg rep="repeat"><replaceable>option</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="R1-PGPOOL-SETUP-1">
- <title>
- Description
- </title>
- <para>
- <application>pgpool_setup</application> creates a temporary
- installation of <productname>Pgpool-II</productname> cluster, which
- includes a <productname>Pgpool-II</productname> installation and
- specified number of <productname>PostgreSQL</productname>
- installations under current directory.
- Current directory must be empty before running <application>pgpool_setup</application>.
- </para>
- <para>
- <application>pgpool_setup</application> is for testing purpose
- only and should not be used to create production installations.
- </para>
-
- <para>
- <application>pgpool_setup</application> executes
- <application>ssh</application> against localhost. You need to
- configure <application>ssh</application> so that it can login to
- localhost without password.
- </para>
-
- <para>
- Currently <application>pgpool_setup</application> supports
- streaming replication mode, native replication mode, raw mode,
- logical replication mode and snapshot isolation mode. To support watchdog,
- see <xref linkend="WATCHDOG-SETUP"> for details.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Options</title>
- <para>
- <application>pgpool_setup</application> accepts the following command-line arguments:
-
- <variablelist>
-
- <varlistentry>
- <term><option>-m <replaceable class="parameter">mode</replaceable></option></term>
- <listitem>
- <para>
- Specifies the running mode. <replaceable>mode</replaceable>
- can be <literal>r</literal> (native replication mode), <literal>s</literal> (streaming replication mode),
- <literal>n</literal> (raw mode), <literal>l</literal>
- (logical replication mode), <literal>y</literal> (slony mode) or <literal>i</literal> (snapshot isolation mode). If this is
- omitted, <literal>s</literal> is assumed.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-n <replaceable class="parameter">num_clusters</replaceable></option></term>
- <listitem>
- <para>
- Specifies the number of PostgreSQL installations.
- If this is omitted, <literal>2</literal> is used.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-p <replaceable class="parameter">base_port</replaceable></option></term>
- <listitem>
- <para>
- Specify the base port number used by Pgpool-II and PostgreSQL.
- Pgpool-II port is base_port. pcp port is base_port + 1. The
- first PostgreSQL node's port is base_port + 2, second
- PostgreSQL node's port is base_port + 3 and so on.
- </para>
- <para>
- If -pg option is specified, the first PostgreSQL node's port is
- assigned to pg_base_port, the second PostgreSQL node's port is
- pg_base_port + 1 and so on.
- </para>
- <para>
- If this is omitted, <literal>11000</literal> is used.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-pg <replaceable class="parameter">pg_base_port</replaceable></option></term>
- <listitem>
- <para>
- Specify the base port number used by PostgreSQL.
- The first PostgreSQL node's port is base_port + 2, second
- PostgreSQL node's port is base_port + 3 and so on.
- </para>
- <para>
- If this is omitted, <literal>base_port</literal>+2 is used.
- </para>
-
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>--no-stop</option></term>
- <listitem>
- <para>
- Do not stop pgpool and PostgreSQL after the work.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-d</option></term>
- <listitem>
- <para>
- Start pgpool with debug mode.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-s</option></term>
- <listitem>
- <para>
- In streaming replication mode, use replication slot instead
- of archive. Since the archive directory is shared by all
- <productname>PostgreSQL</productname> clusters, if a standby
- is promoted, the time line in the archive directory will be
- changed and other standby servers will be stopped. Using a
- replication slot does not have this problem and is always
- preferable if you can
- use <productname>PostgreSQL</productname> 9.4 or later, which
- supports replication slot. The replication slot name used
- by <application>pgpool_setup</application>
- is <literal>pgpool_setup_slot</literal>.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-r</option></term>
- <listitem>
- <para>
- Use <command>pg_rewind</command> command in recovery script
- (basebackup.sh). If the command fails, switch to use ordinal
- rsync command. In certain cases recovery
- using <command>pg_rewind</command> is much faster than rsync
- since it does not copy whole database cluster.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </para>
- </refsect1>
-
- <refsect1>
- <title>Environment variables</title>
- <para>
- <application>pgpool_setup</application> recognizes following environment variables:
-
- <variablelist>
-
- <varlistentry>
- <term><option>PGPOOL_INSTALL_DIR</option></term>
- <listitem>
- <para>
- Specifies the Pgpool-II installation directory. Pgpool-II
- binaries is expected to be placed under PGPOOL_INSTALL_DIR/bin
- and pgpool.conf and pool_hba.conf etc. are expected to be placed under
- PGPOOL_INSTALL_DIR/etc. The default is /usr/local.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>PGPOOLDIR</option></term>
- <listitem>
- <para>
- Specifies the path to Pgpool-II configuration files.
- The default is PGPOOL_INSTALL_DIR/etc.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>PGBIN</option></term>
- <listitem>
- <para>
- Specifies the path to PostgreSQL commands such as initdb, pg_ctl and psql.
- The default is /usr/local/pgsql/bin.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>PGLIB</option></term>
- <listitem>
- <para>
- Specifies the path to PostgreSQL shared libraries.
- The default is /usr/local/pgsql/lib.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>PGSOCKET_DIR</option></term>
- <listitem>
- <para>
- Specifies the path to Unix socket directory.
- The default is /tmp.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>INITDBARG</option></term>
- <listitem>
- <para>
- Specifies the arguments for initdb command.
- The default is "--no-locale -E UTF_8".
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>USE_REPLICATION_SLOT</option></term>
- <listitem>
- <para>
- If "true", in streaming replication mode, use replication slot instead
- of archive. This brings the same effect as "-s" option is specified.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>USE_PG_REWIND</option></term>
- <listitem>
- <para>
- If "true", in streaming replication mode, use <command>pg_rewind</command> in basebackup.sh script.
- This brings the same effect as "-r" option is specified.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
-
- </para>
- </refsect1>
-
- <refsect1>
- <title>Example</title>
- <para>
- <screen>
-$ pgpool_setup
-PostgreSQL major version: 124
-Starting set up in streaming replication mode
-creating startall and shutdownall
-creating failover script
-creating database cluster /tmp/test/data0...done.
-update postgresql.conf
-creating pgpool_remote_start
-creating basebackup.sh
-creating recovery.conf
-creating database cluster /tmp/test/data1...done.
-update postgresql.conf
-creating pgpool_remote_start
-creating basebackup.sh
-creating recovery.conf
-temporarily start data0 cluster to create extensions
-temporarily start pgpool-II to create standby nodes
- node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay | replication_state | replication_sync_state | last_status_change
----------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------+-------------------+------------------------+---------------------
- 0 | /tmp | 11002 | up | 0.500000 | primary | 0 | true | 0 | | | 2020-08-18 13:50:19
- 1 | /tmp | 11003 | down | 0.500000 | standby | 0 | false | 0 | | | 2020-08-18 13:50:18
-(2 rows)
-
-recovery node 1...pcp_recovery_node -- Command Successful
-done.
-creating follow primary script
- node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay | replication_state | replication_sync_state | last_status_change
----------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------+-------------------+------------------------+---------------------
- 0 | /tmp | 11002 | up | 0.500000 | primary | 0 | true | 0 | | | 2020-08-18 13:50:19
- 1 | /tmp | 11003 | up | 0.500000 | standby | 0 | false | 0 | | | 2020-08-18 13:50:23
-(2 rows)
-
-shutdown all
-
-pgpool-II setting for streaming replication mode is done.
-To start the whole system, use /tmp/test/startall.
-To shutdown the whole system, use /tmp/test/shutdownall.
-pcp command user name is "t-ishii", password is "t-ishii".
-Each PostgreSQL, pgpool-II and pcp port is as follows:
-#1 port is 11002
-#2 port is 11003
-pgpool port is 11000
-pcp port is 11001
-The info above is in README.port.
-t-ishii$ ./startall
-waiting for server to start....5744 2020-08-18 13:50:27 JST LOG: starting PostgreSQL 12.4 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit
-5744 2020-08-18 13:50:27 JST LOG: listening on IPv4 address "0.0.0.0", port 11002
-5744 2020-08-18 13:50:27 JST LOG: listening on IPv6 address "::", port 11002
-5744 2020-08-18 13:50:27 JST LOG: listening on Unix socket "/tmp/.s.PGSQL.11002"
-5744 2020-08-18 13:50:27 JST LOG: redirecting log output to logging collector process
-5744 2020-08-18 13:50:27 JST HINT: Future log output will appear in directory "log".
- done
-server started
-waiting for server to start....5757 2020-08-18 13:50:27 JST LOG: starting PostgreSQL 12.4 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit
-5757 2020-08-18 13:50:27 JST LOG: listening on IPv4 address "0.0.0.0", port 11003
-5757 2020-08-18 13:50:27 JST LOG: listening on IPv6 address "::", port 11003
-5757 2020-08-18 13:50:27 JST LOG: listening on Unix socket "/tmp/.s.PGSQL.11003"
-5757 2020-08-18 13:50:27 JST LOG: redirecting log output to logging collector process
-5757 2020-08-18 13:50:27 JST HINT: Future log output will appear in directory "log".
- done
-server started
-t-ishii$ psql -p 11000 test
-psql (12.4)
-Type "help" for help.
-
-test=# show pool_nodes;
- node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay | replication_state | replication_sync_state | last_status_change
----------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------+-------------------+------------------------+---------------------
- 0 | /tmp | 11002 | up | 0.500000 | primary | 0 | true | 0 | | | 2020-08-18 13:50:32
- 1 | /tmp | 11003 | up | 0.500000 | standby | 0 | false | 0 | streaming | async | 2020-08-18 13:50:32
-(2 rows)
-
- </screen>
- </para>
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/show.sgml
-PostgreSQL documentation
--->
-
-<refentry id="SQL-PGPOOL-SHOW">
- <indexterm zone="sql-pgpool-show">
- <primary>SHOW</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>PGPOOL SHOW</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>SQL - Language Statements</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>PGPOOL SHOW</refname>
- <refpurpose>show the value of a configuration parameter</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <synopsis>
- PGPOOL SHOW <replaceable class="PARAMETER">configuration_parameter</replaceable>
- PGPOOL SHOW <replaceable class="PARAMETER">configuration_parameter_group</replaceable>
- PGPOOL SHOW ALL
- </synopsis>
- </refsynopsisdiv>
-
- <refsect1>
- <title>Description</title>
-
- <para>
- <command>PGPOOL SHOW</command> will display the current value of
- <productname>Pgpool-II</productname> configuration parameters.
-
- This command is similar to the
- <ulink url="https://www.postgresql.org/docs/current/static/sql-show.html">
- <command>SHOW</command></ulink> command in PostgreSQL with an addition
- of <acronym>PGPOOL</acronym> keyword to distinguish it from the
- PostgreSQL SHOW command.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Parameters</title>
-
- <variablelist>
-
- <varlistentry>
- <term><replaceable class="PARAMETER">configuration_parameter</replaceable></term>
- <listitem>
- <para>
- The name of a <productname>Pgpool-II</productname> configuration parameter.
- Available parameters are documented in <xref linkend="runtime-config">
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><replaceable class="PARAMETER">configuration_parameter_group</replaceable></term>
- <listitem>
- <para>
- The name of the <productname>Pgpool-II</productname> configuration parameter group.
- Currently there are three parameter groups.
- </para>
- <variablelist>
- <varlistentry>
- <term><literal>backend</literal></term>
- <listitem>
- <para>
- Configuration group of all backend config parameters.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><literal>other_pgpool</literal></term>
- <listitem>
- <para>
- Configuration group of all watchdog node config parameters.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><literal>heartbeat</literal></term>
- <listitem>
- <para>
- configuration group of all watchdog heartbeat node config parameters.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><literal>health_check</literal></term>
- <listitem>
- <para>
- configuration group of all health check parameters.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><literal>ALL</literal></term>
- <listitem>
- <para>
- Show the values of all configuration parameters, with descriptions.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
-
- <refsect1>
- <title>Examples</title>
-
- <para>
- Show the current setting of the parameter <xref linkend="guc-port">:
-
- <programlisting>
- PGPOOL SHOW port;
- port
- ------
- 9999
- (1 row)
- </programlisting>
- </para>
-
- <para>
- Show the current setting of the parameter <xref linkend="guc-write-function-list">:
- <programlisting>
- PGPOOL SHOW write_function_list;
- write_function_list
- ---------------------
- nextval,setval
- (1 row)
- </programlisting>
- </para>
-
- <para>
- Show the current settings of all the configuration parameters belonging to backend group:
- <programlisting>
- PGPOOL SHOW backend;
- item | value | description
- -------------------------+-------------------------+-----------------------------------------------------------
- backend_hostname0 | 127.0.0.1 | hostname or IP address of PostgreSQL backend.
- backend_port0 | 5434 | port number of PostgreSQL backend.
- backend_weight0 | 0 | load balance weight of backend.
- backend_data_directory0 | /var/lib/pgsql/data | data directory of the backend.
- backend_flag0 | ALLOW_TO_FAILOVER | Controls various backend behavior.
- backend_hostname1 | 127.0.0.1 | hostname or IP address of PostgreSQL backend.
- backend_port1 | 5432 | port number of PostgreSQL backend.
- backend_weight1 | 1 | load balance weight of backend.
- backend_data_directory1 | /home/work/installed/pg | data directory of the backend.
- backend_flag1 | ALLOW_TO_FAILOVER | Controls various backend behavior.
- (10 rows)
- </programlisting></para>
-
- <para>
- Show all settings:
- <programlisting>
- PGPOOL SHOW ALL;
- item | value | description
- -------------------------+-------------------------+-----------------------------------------------------------
- backend_hostname0 | 127.0.0.1 | hostname or IP address of PostgreSQL backend.
- backend_port0 | 5434 | port number of PostgreSQL backend.
- backend_weight0 | 0 | load balance weight of backend.
- backend_data_directory0 | /var/lib/pgsql/data | data directory of the backend.
- backend_flag0 | ALLOW_TO_FAILOVER | Controls various backend behavior.
- backend_hostname1 | 127.0.0.1 | hostname or IP address of PostgreSQL backend.
- backend_port1 | 5432 | port number of PostgreSQL backend.
- backend_weight1 | 1 | load balance weight of backend.
- backend_data_directory1 | /home/work/installed/pg | data directory of the backend.
- backend_flag1 | ALLOW_TO_FAILOVER | Controls various backend behavior.
- other_pgpool_hostname0 | localhost | Hostname of other pgpool node for watchdog connection.
- .
- .
- .
- ssl | off | Enables SSL support for frontend and backend connections
- (138 rows)
-
- </programlisting></para>
- </refsect1>
-
- <refsect1>
- <title>See Also</title>
-
- <simplelist type="inline">
- <member><xref linkend="SQL-PGPOOL-SET"></member>
- </simplelist>
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
-doc/src/sgml/ref/pgproto.sgml
-Pgpool-II documentation
--->
-
-<refentry id="PGPROTO">
- <indexterm zone="pgproto">
- <primary>pgproto</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>pgproto</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>Other Commands</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>pgproto</refname>
- <refpurpose>
- tests <productname>PostgreSQL</productname> or any other servers that understand the frontend/backend protocol.</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>pgproto</command>
- <arg rep="repeat"><replaceable>option</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
-
- <refsect1 id="R1-PGPROTO-1">
- <title>Description</title>
- <para>
- <command>pgproto</command>
- tests <productname>PostgreSQL</productname> or any other servers that understand the frontend/backend protocol.
- </para>
- </refsect1>
-
- <refsect1>
- <title>Options</title>
- <para>
- <variablelist>
- <varlistentry>
- <term><option>-h <replaceable class="parameter">hostname</replaceable></option></term>
- <term><option>--hostname=<replaceable class="parameter">hostname</replaceable></option></term>
- <listitem>
- <para>
- The host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix-domain socket (default: Unix-domain socket).
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-p <replaceable class="parameter">port</replaceable></option></term>
- <term><option>--port=<replaceable class="parameter">port</replaceable></option></term>
- <listitem>
- <para>
- The port number (default:5432).
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-u <replaceable class="parameter">username</replaceable></option></term>
- <term><option>--user=<replaceable class="parameter">username</replaceable></option></term>
- <listitem>
- <para>
- The user name (default: OS user name).
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-d <replaceable class="parameter">databasename</replaceable></option></term>
- <term><option>--database=<replaceable class="parameter">databasename</replaceable></option></term>
- <listitem>
- <para>
- The database name (default: same as user).
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-f <replaceable class="parameter">filename</replaceable></option></term>
- <term><option>--proto-data-file=<replaceable class="parameter">filename</replaceable></option></term>
- <listitem>
- <para>
- Text file describing message data to be sent to <productname>PostgreSQL</productname> (default: pgproto.data).
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-r <replaceable class="parameter">naptime</replaceable></option></term>
- <term><option>--read-nap=<replaceable class="parameter">naptime</replaceable></option></term>
- <listitem>
- <para>
- The nap time in micro seconds (default:0).
- Greater than 0 will let pgproto sleep between each data reading from socket.
- This is useful to simulate slow clients.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-D</option></term>
- <term><option>--debug</option></term>
- <listitem>
- <para>
- Enable debug message.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-v</option></term>
- <term><option>--version</option></term>
- <listitem>
- <para>
- Print the command version, then exit.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-?</option></term>
- <term><option>--help</option></term>
- <listitem>
- <para>
- Shows help for the command line arguments, then exit.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </para>
- </refsect1>
-
- <refsect1>
- <title>Example</title>
- <para>
- In the example below, the first character in the file (i.e. 'Q')
- indicates the message kind specified in the PostgreSQL frontend/backend protocol.
- </para>
- <para>
- Exceptions are 'Y' and 'y'. 'Y' reads messages from backend
- until 'Ready for query' is received.
- 'y' reads messages from backend while messages are coming from backend then stops
- if messages are not available for 1 second.
- 'Y' is used for waiting for reply of 'Q' (simple query) or after 'S' (sync) in extended queries.
- 'y' can be used for receiving messages after 'H' (flush).
- </para>
- <para>
- If you want to include a " (double quotation) in a string data type,
- for example "SELECT * FROM "aaa"", you can qualify it by using \ (back slash) like ""SELECT * FROM "aaa""
-
- A command line spread over multiple lines can be created using \ as well.
- <programlisting>
- 'Q' "SELECT * FROM aaa \
- WHERE a = 1"
- </programlisting>
- </para>
- <para>
- Here is an example input file:
- <programlisting>
- #
- # Test data example
- #
- 'Q' "SELECT * FROM aaa"
- 'Y'
- 'P' "S1" "BEGIN" 0
- 'B' "" "S1" 0 0 0
- 'E' "" 0
- 'C' 'S' "S1"
- 'P' "foo" "SELECT 1" 0
- 'B' "myportal" "foo" 0 0 0
- 'E' "myportal" 0
- 'P' "S2" "COMMIT" 0
- 'B' "" "S2" 0 0 0
- 'E' "" 0
- 'C' 'S' "S2"
- 'S'
- 'Y'
- 'X'
- </programlisting>
- </para>
- <para>
- Here is an example output:
- <programlisting>
- $ pgproto -p 11000 -d test -f sample.data
- FE=> Query (query="SELECT * FROM aaa")
- <= BE RowDescription
- <= BE CommandComplete(SELECT 0)
- <= BE ReadyForQuery(I)
- FE=> Parse(stmt="S1", query="BEGIN")
- FE=> Bind(stmt="S1", portal="")
- FE=> Execute(portal="")
- FE=> Close(stmt="S1")
- FE=> Parse(stmt="foo", query="SELECT 1")
- FE=> Bind(stmt="foo", portal="myportal")
- FE=> Execute(portal="myportal")
- FE=> Parse(stmt="S2", query="COMMIT")
- FE=> Bind(stmt="S2", portal="")
- FE=> Execute(portal="")
- FE=> Close(stmt="S2")
- FE=> Sync
- <= BE ParseComplete
- <= BE BindComplete
- <= BE CommandComplete(BEGIN)
- <= BE CloseComplete
- <= BE ParseComplete
- <= BE BindComplete
- <= BE DataRow
- <= BE CommandComplete(SELECT 1)
- <= BE ParseComplete
- <= BE BindComplete
- <= BE CommandComplete(COMMIT)
- <= BE CloseComplete
- <= BE ReadyForQuery(I)
- FE=> Terminate
- </programlisting>
- </para>
- <para>
- Other example data files:
- </para>
- <para>
- Copy
- <programlisting>
- #
- # Test data example
- #
-
- # CopyIn
- #
- 'Q' "COPY t1 FROM STDIN"
- # CopyData
- 'd' "abc"
- # CopyDone
- 'c'
- 'Y'
-
- # CopyOut
- #
- 'Q' "COPY t1 TO STDOUT"
- 'Y'
-
- #
- # Copy fail case
- #
- 'Q' "COPY t1 FROM STDIN"
- # CopyData
- 'd' "abc"
- # CopyFail
- 'f' "pgproto copy fail test"
- 'Y'
- 'X'
- </programlisting>
- </para>
- <para>
- Function Call
- <programlisting>
- #
- # Test data example
- #
-
- # Function call (lo_creat)
- # from PostgreSQL's src/include/catalog/pg_proc.data
- # { oid => '957', descr => 'large object create',
- # proname => 'lo_creat', provolatile => 'v', proparallel => 'u',
- # prorettype => 'oid', proargtypes => 'int4', prosrc => 'be_lo_creat' },
-
- 'F' 957 1 0 1 1 "0" 0
- 'Y'
- 'X'
- </programlisting>
- </para>
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
- doc/src/sgml/ref/show_pool_backend_stats.sgml
- Pgpool-II documentation
- -->
-
-<refentry id="SQL-SHOW-POOL-BACKEND-STATS">
- <indexterm zone="sql-show-pool-backend-stats">
- <primary>SHOW POOL_BACKEND_STATS</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>SHOW POOL_BACKEND_STATS</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>SQL - Language Statements</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>SHOW POOL_BACKEND_STATS</refname>
- <refpurpose>
- show backend SQL command statistics
- </refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <synopsis>
- SHOW POOL_BACKEND_STATS
- </synopsis>
- </refsynopsisdiv>
-
- <refsect1>
- <title>Description</title>
-
- <para>
- <command>SHOW POOL_BACKEND_STATS</command> displays the node id,
- the hostname, the port, the status, the role, the
- SELECT/INSERT/UPDATE/DELETE/DDL/other query counts issued to each
- backend. Also error messages returned from backend are counted and
- shown, classified by the severity. The node id, the hostname, the
- port, the status, the role are same as <xref
- linkend="sql-show-pool-nodes">.
- </para>
- <para>
- select_cnt, insert_cnt, update_cnt, delete_cnt, ddl_cnt, other_cnt
- are the numbers of SQL command: SELECT, INSERT, UPDATE, DELETE, DDL
- and others issued since <productname>Pgpool-II</productname>
- started. Failed commands (for example SELECT from non-existing
- table) are counted. Commands rolled back are also
- counted. Currently, other than
- SELECT/WITH/INSERT/UPDATE/DELETE/CHECKPOINT/DEALLOCATE/DISCARD/EXECUTE/
- EXPLAIN/LISTEN/LOAD/LOCK/NOTIFY/PREPARE/SET/SHOW/Transaction
- commands/UNLISTEN are considered as DDL.
- </para>
- <para>
- Here is an example session:
- <programlisting>
-test=# show pool_backend_stats;
- node_id | hostname | port | status | role | select_cnt | insert_cnt | update_cnt | delete_cnt | ddl_cnt | other_cnt | panic_cnt | fatal_cnt | error_cnt
----------+----------+-------+--------+---------+------------+------------+------------+------------+---------+-----------+-----------+-----------+-----------
- 0 | /tmp | 11002 | up | primary | 12 | 10 | 30 | 0 | 2 | 30 | 0 | 0 | 1
- 1 | /tmp | 11003 | up | standby | 12 | 0 | 0 | 0 | 0 | 23 | 0 | 0 | 1
-(2 rows)
- </programlisting>
- </para>
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
- doc/src/sgml/ref/show_pool_cache.sgml
- Pgpool-II documentation
- -->
-
-<refentry id="SQL-SHOW-POOL-CACHE">
- <indexterm zone="sql-show-pool-cache">
- <primary>SHOW</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>SHOW POOL_CACHE</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>SQL - Language Statements</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>SHOW POOL_CACHE</refname>
- <refpurpose>
- displays cache storage statistics
- </refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <synopsis>
- SHOW POOL_CACHE
- </synopsis>
- </refsynopsisdiv>
-
- <refsect1>
- <title>Description</title>
-
- <para>
- <command>SHOW POOL_CACHE</command>
- displays <link linkend="runtime-in-memory-query-cache">in memory
- query cache </link> statistics if in memory query cache is
- enabled. Here is an example session:
- <programlisting>
- test=# \x
- \x
- Expanded display is on.
- test=# show pool_cache;
- show pool_cache;
- -[ RECORD 1 ]---------------+---------
- num_cache_hits | 891703
- num_selects | 99995
- cache_hit_ratio | 0.90
- num_hash_entries | 131072
- used_hash_entries | 99992
- num_cache_entries | 99992
- used_cache_entries_size | 12482600
- free_cache_entries_size | 54626264
- fragment_cache_entries_size | 0
- </programlisting>
-
- </para>
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
- doc/src/sgml/ref/show_pool_health_check_stats.sgml
- Pgpool-II documentation
- -->
-
-<refentry id="SQL-SHOW-POOL-HEALTH-CHECK-STATS">
- <indexterm zone="sql-show-pool-health-check-stats">
- <primary>SHOW POOL_HEALTH_CHECK_STATS</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>SHOW POOL_HEALTH_CHECK_STATS</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>SQL - Language Statements</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>SHOW POOL_HEALTH_CHECK_STATS</refname>
- <refpurpose>
- show health check statistics data
- </refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <synopsis>
- SHOW POOL_HEALTH_CHECK_STATS
- </synopsis>
- </refsynopsisdiv>
-
- <refsect1>
- <title>Description</title>
-
- <para>
- <command>SHOW POOL_HEALTH_CHECK_STATS</command> displays health
- check (see <xref linkend="runtime-config-health-check">) statistic
- data mostly collected by health check process. This command helps
- <productname>Pgpool-II</productname> admin to study events related
- to health check. For example, admin can easily locate the failover
- event in the log file by looking at "last_failed_health_check"
- column. Another example is finding unstable connection to backend
- by evaluating "average_retry_count" column. If particular node
- shows higher retry count than other node, there may be problem to
- the connection to the backend.
- </para>
-
- <para>
- <xref linkend="health-check-stats-data-table"> shows each column name and its description.
- </para>
-
- <table id="health-check-stats-data-table">
- <title>Statistics data shown by pool_health_check_stats command</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Column Name</entry>
- <entry>Description</entry>
- </row>
- </thead>
-
- <tbody>
-
- <row>
- <entry>node_id</entry>
- <entry>
- Backend node id.
- </entry>
- </row>
-
- <row>
- <entry>hostname</entry>
- <entry>
- Backend hostname or UNIX domain socket path.
- </entry>
- </row>
-
- <row>
- <entry>port</entry>
- <entry>
- Backend port number.
- </entry>
- </row>
-
- <row>
- <entry>status</entry>
- <entry>
- Backend status. One of up, down, waiting, unused or quarantine.
- </entry>
- </row>
-
- <row>
- <entry>role</entry>
- <entry>
- Role of the node. Either primary or standby in streaming
- replication mode. Either main or replica in other mode.
- </entry>
- </row>
-
- <row>
- <entry>last_status_change</entry>
- <entry>
- Timestamp of last backend status changed.
- </entry>
- </row>
-
- <row>
- <entry>total_count</entry>
- <entry>
- Number of health check count in total.
- </entry>
- </row>
-
- <row>
- <entry>success_count</entry>
- <entry>
- Number of successful health check count in total.
- </entry>
- </row>
-
- <row>
- <entry>fail_count</entry>
- <entry>
- Number of failed health check count in total.
- </entry>
- </row>
-
- <row>
- <entry>skip_count</entry>
- <entry>
- Number of skipped health check count in total. If the node is
- already down, health check skips the node.
- </entry>
- </row>
-
- <row>
- <entry>retry_count</entry>
- <entry>
- Number of retried health check count in total.
- </entry>
- </row>
-
- <row>
- <entry>average_retry_count</entry>
- <entry>
- Number of average retried health check count in a health check
- session.
- </entry>
- </row>
-
- <row>
- <entry>max_retry_count</entry>
- <entry>
- Number of maximum retried health check count in a health check
- session.
- </entry>
- </row>
-
- <row>
- <entry>max_duration</entry>
- <entry>
- Maximum health check duration in Millie seconds. If a health
- check session retries, the health check duration is sum of each
- retried health check.
- </entry>
- </row>
-
- <row>
- <entry>min_duration</entry>
- <entry>
- Minimum health check duration in Millie seconds. If a health
- check session retries, the health check duration is sum of each
- retried health check.
- </entry>
- </row>
-
- <row>
- <entry>average_duration</entry>
- <entry>
- Average health check duration in Millie seconds. If a health
- check session retries, the health check duration is sum of each
- retried health check.
- </entry>
- </row>
-
- <row>
- <entry>last_health_check</entry>
- <entry>
- Timestamp of last health check. If heath check does not
- performed yet, empty string.
- </entry>
- </row>
-
- <row>
- <entry>last_successful_health_check</entry>
- <entry>
- Timestamp of last successful health check. If heath check does
- not succeeds yet, empty string.
- </entry>
- </row>
-
- <row>
- <entry>last_skip_health_check</entry>
- <entry>
- Timestamp of last skipped health check. If heath check is not
- skipped yet, empty string. Note that it is possible that this
- field is an empty string even if the status is down. In this
- case failover was triggered by other than health check process.
- </entry>
- </row>
-
- <row>
- <entry>last_failed_health_check</entry>
- <entry>
- Timestamp of last failed health check. If heath check does not
- fail yet, empty string. Note that it is possible that this
- field is an empty string even if the status is down. In this
- case failover was triggered by other than health check process.
- </entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
-
- <para>
- Here is an example session:
- <programlisting>
-test=# show pool_health_check_stats;
--[ RECORD 1 ]----------------+--------------------
-node_id | 0
-hostname | /tmp
-port | 11002
-status | up
-role | primary
-last_status_change | 2020-01-26 19:08:45
-total_count | 27
-success_count | 27
-fail_count | 0
-skip_count | 0
-retry_count | 0
-average_retry_count | 0.000000
-max_retry_count | 0
-max_duration | 9
-min_duration | 2
-average_duration | 6.296296
-last_health_check | 2020-01-26 19:12:45
-last_successful_health_check | 2020-01-26 19:12:45
-last_skip_health_check |
-last_failed_health_check |
--[ RECORD 2 ]----------------+--------------------
-node_id | 1
-hostname | /tmp
-port | 11003
-status | down
-role | standby
-last_status_change | 2020-01-26 19:11:48
-total_count | 19
-success_count | 12
-fail_count | 1
-skip_count | 6
-retry_count | 3
-average_retry_count | 0.230769
-max_retry_count | 3
-max_duration | 83003
-min_duration | 0
-average_duration | 6390.307692
-last_health_check | 2020-01-26 19:12:48
-last_successful_health_check | 2020-01-26 19:10:15
-last_skip_health_check | 2020-01-26 19:12:48
-last_failed_health_check | 2020-01-26 19:11:48
- </programlisting>
- </para>
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
- doc/src/sgml/ref/show_pool_nodes.sgml
- Pgpool-II documentation
- -->
-
-<refentry id="SQL-SHOW-POOL-NODES">
- <indexterm zone="sql-show-pool-nodes">
- <primary>SHOW POOL_NODES</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>SHOW POOL NODES</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>SQL - Language Statements</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>SHOW POOL_NODES</refname>
- <refpurpose>
- sends back a list of all configured nodes
- </refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <synopsis>
- SHOW POOL_NODES
- </synopsis>
- </refsynopsisdiv>
-
- <refsect1>
- <title>Description</title>
-
- <para>
- <command>SHOW POOL_NODES</command> displays the node id, the
- hostname, the port, the status, the weight (only meaningful if
- you use the load balancing mode), the role, the SELECT query
- counts issued to each backend, whether each node is the load
- balance node or not, the replication delay (only if in streaming
- replication mode) and last status change time. In addition to
- this replication state and sync state are shown for standby nodes
- in <productname>Pgpool-II</productname> 4.1 or after. The
- possible values in the status column are explained in
- the <xref linkend="pcp-node-info"> reference. If the hostname is
- something like "/tmp", that means
- <productname>Pgpool-II</productname> is connecting to backend by
- using UNIX domain sockets. The SELECT count does not include
- internal queries used
- by <productname>Pgpool-II</productname>. Also the counters are
- reset to zero upon starting up
- of <productname>Pgpool-II</productname>. The last status change
- time is initially set to the
- time <productname>Pgpool-II</productname> starts. After that
- whenever "status" or "role" is changed, it is updated.
- </para>
- <para>
- Here is an example session:
- <programlisting>
- test=# show pool_nodes;
- node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay | replication_state | replication_sync_state | last_status_change
- ---------+----------+-------+--------+-----------+---------+------------+-------------------+-------------------+-------------------+------------------------+---------------------
- 0 | /tmp | 11002 | up | 0.500000 | primary | 0 | false | 0 | | | 2019-04-22 16:13:46
- 1 | /tmp | 11003 | up | 0.500000 | standby | 0 | true | 0 | streaming | async | 2019-04-22 16:13:46
- (2 rows)
- </programlisting>
- </para>
- </refsect1>
-
-</refentry>
+++ /dev/null
-<!--
- doc/src/sgml/ref/show_pool_pools.sgml
- Pgpool-II documentation
- -->
-
-<refentry id="SQL-SHOW-POOL-POOLS">
- <indexterm zone="sql-show-pool-pools">
- <primary>SHOW POOL_POOLS</primary>
- </indexterm>
-
- <refmeta>
- <refentrytitle>SHOW POOL_POOLS</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo>SQL - Language Statements</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>SHOW POOL_POOLS</refname>
- <refpurpose>
- sends back a list of pools handled
- by <productname>Pgpool-II</productname>.
- </refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <synopsis>
- SHOW POOL_POOLS
- </synopsis>
- </refsynopsisdiv>
-
- <refsect1>
- <title>Description</title>
-
- <para>
- <command>SHOW POOL_POOLS</command> sends back a list of pools
- handled by
- <productname>Pgpool-II</productname>
- </para>
- <para>
- It has 11 columns:
- <itemizedlist>
- <listitem>
- <para>
- <literal>pool_pid</literal> is the PID of the
- displayed <productname>Pgpool-II</productname> process.
- </para>
- </listitem>
-
- <listitem>
- <para>
- <literal>start_time</literal> is the timestamp of when
- this process was launched.
- </para>
- </listitem>
-
- <listitem>
- <para>
- <literal>pool_id</literal> is the pool identifier (should
- be between 0 and <xref linkend="guc-max-pool"> - 1)
- </para>
- </listitem>
-
- <listitem>
- <para>
- <literal>backend_id</literal> is the backend identifier (should
- be between 0 and the number of configured backends minus one)
- </para>
- </listitem>
-
- <listitem>
- <para>
- <literal>database</literal> is the database name for this
- process's pool id connection.
- </para>
- </listitem>
-
- <listitem>
- <para>
- <literal>username</literal> is the user name for this
- process's pool id connection.
- </para>
- </listitem>
-
- <listitem>
- <para>
- <literal>create_time</literal> is the creation time and
- date of the connection.
- </para>
- </listitem>
-
- <listitem>
- <para>
- <literal>majorversion</literal>
- and <literal>minorversion</literal> are the protocol
- version numbers used in this connection.
- </para>
- </listitem>
-
- <listitem>
- <para>
- <literal>pool_counter</literal> counts the number of times
- this pool of connections (process) has been used by
- clients.
- </para>
- </listitem>
-
- <listitem>
- <para>
- <literal>pool_backendpid</literal> is the PID of the
- PostgreSQL process.
- </para>
- </listitem>
-
- <listitem>
- <para>
- <literal>pool_connected</literal> is true (1) if a
- frontend is currently using this backend.
- </para>
- </listitem>
-
- </itemizedlist>
- </para>
- <para>
- It'll always return <xref linkend="guc-num-init-children"> * <xref linkend="guc-max-pool"> *
- number_of_backends lines. Here is an example session:
- <programlisting>
- test=# show pool_pools;
- pool_pid | start_time | pool_id | backend_id | database | username | create_time | majorversion | minorversion | pool_counter | pool_backendpid | pool_connected
- ----------+---------------------+---------+------------+----------+----------+---------------------+--------------+--------------+--------------+-----------------+----------------
- 19696 | 2016-10-17 13:24:17 | 0 | 0 | postgres | t-ishii | 2016-10-17 13:35:12 | 3 | 0 | 1 | 20079 | 1
- 19696 | 2016-10-17 13:24:17 | 0 | 1 | postgres | t-ishii | 2016-10-17 13:35:12 | 3 | 0 | 1 | 20080 | 1
- 19696 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19696 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19696 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19696 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19696 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19696 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19697 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19697 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19697 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19697 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19697 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19697 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19697 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19697 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19698 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19698 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19698 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19698 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19698 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19698 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19698 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19698 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19699 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19699 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19699 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19699 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19699 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19699 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19699 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19699 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19700 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19700 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19700 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19700 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19700 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19700 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19700 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19700 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19701 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19701 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19701 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19701 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19701 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19701 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19701 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19701 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19702 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19702 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19702 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19702 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19702 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19702 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19702 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19702 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19703 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19703 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19703 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19703 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19703 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19703 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19703 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19703 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19704 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19704 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19704 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19704 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19704 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19704 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19704 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19704 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19705 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19705 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19705 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19705 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19705 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19705 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19705 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19705 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19706 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19706 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19706 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19706 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19706 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19706 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19706 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19706 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19707 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19707 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19707 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19707 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19707 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19707 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19707 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19707 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19708 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19708 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19708 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19708 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19708 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19708 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19708 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19708 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19709 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19709 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19709 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19709 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19709 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19709 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19709 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19709 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19710 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19710 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19710 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19710 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19710 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19710 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19710 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19710 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19711 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19711 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19711 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19711 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19711 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19711 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19711 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19711 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19712 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19712 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19712 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19712 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19712 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19712 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19712 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19712 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19713 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19713 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19713 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19713 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19713 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19713 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19713 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19713 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19714 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19714 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19714 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19714 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19714 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19714 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19714 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19714 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19715 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19715 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19715 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19715 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19715 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19715 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19715 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19715 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19716 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19716 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19716 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19716 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19716 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19716 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19716 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19716 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19717 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19717 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19717 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19717 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19717 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19717 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19717 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19717 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19718 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19718 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19718 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19718 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19718 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19718 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19718 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19718 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19719 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19719 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19719 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19719 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19719 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19719 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19719 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19719 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19720 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19720 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19720 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19720 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19720 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19720 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19720 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19720 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 20024 | 2016-10-17 13:33:46 | 0 | 0 | test | t-ishii | 2016-10-17 14:30:53 | 3 | 0 | 1 | 22055 | 1
- 20024 | 2016-10-17 13:33:46 | 0 | 1 | test | t-ishii | 2016-10-17 14:30:53 | 3 | 0 | 1 | 22056 | 1
- 20024 | 2016-10-17 13:33:46 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 20024 | 2016-10-17 13:33:46 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 20024 | 2016-10-17 13:33:46 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 20024 | 2016-10-17 13:33:46 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 20024 | 2016-10-17 13:33:46 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 20024 | 2016-10-17 13:33:46 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 20600 | 2016-10-17 13:46:58 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 20600 | 2016-10-17 13:46:58 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 20600 | 2016-10-17 13:46:58 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 20600 | 2016-10-17 13:46:58 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 20600 | 2016-10-17 13:46:58 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 20600 | 2016-10-17 13:46:58 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 20600 | 2016-10-17 13:46:58 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 20600 | 2016-10-17 13:46:58 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19723 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19723 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19723 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19723 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19723 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19723 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19723 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19723 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19724 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19724 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19724 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19724 | 2016-10-17 13:24:17 | 1 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19724 | 2016-10-17 13:24:17 | 2 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19724 | 2016-10-17 13:24:17 | 2 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19724 | 2016-10-17 13:24:17 | 3 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19724 | 2016-10-17 13:24:17 | 3 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19725 | 2016-10-17 13:24:17 | 0 | 0 | | | | 0 | 0 | 0 | 0 | 0
- 19725 | 2016-10-17 13:24:17 | 0 | 1 | | | | 0 | 0 | 0 | 0 | 0
- 19725 | 2016-10-17 13:24:17 | 1 | 0 | | | | 0 | 0 | 0 &nb