> > > 2. Re: Failover - Pgpool II + Hot Standby + Stream Replication > (Flavio Henrique Araque Gurgel) > > Flavio so vi a mensagem hoje pq estava resolvendo outro problema de > backup, a minha dúvida é se após o failover precisa alterar alguma coisa no > pgpool.conf ou isso é automático/transparente, mesmo não tendo outro > servidor para o stream ! > > > Configurações Servidores: > > Red Hat Enterprise Linux Server release 6.1 > PostgreSQL 9.0 > pgpool-II version 3.1 > > > o estado do pgpool.conf: > > # - pgpool Connection Settings - > > listen_addresses = '*' > # Host name or IP address to listen on: > # '*' for all, '' for no TCP/IP > connections > # (change requires restart) > port = 9999 > # Port number > # (change requires restart) > socket_dir = '/tmp' > # Unix domain socket path > # The Debian package defaults to > # /var/run/postgresql > # (change requires restart) > > > # - pgpool Communication Manager Connection Settings - > > pcp_port = 9898 > # Port number for pcp > # (change requires restart) > pcp_socket_dir = '/tmp' > # Unix domain socket path for pcp > # The Debian package defaults to > # /var/run/postgresql > # (change requires restart) > > # - Backend Connection Settings - > > backend_hostname0 = 'serv01' > # 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 = '/u01/postgresql/9.0/data' > # Data directory for backend 0 > backend_flag0 = 'ALLOW_TO_FAILOVER' > # Controls various backend behavior > # ALLOW_TO_FAILOVER or > DISALLOW_TO_FAILOVER > backend_hostname1 = 'serv02' > backend_port1 = 5432 > backend_weight1 = 1 > backend_data_directory1 = '/u01/postgresql/9.0/data' > backend_flag1 = 'ALLOW_TO_FAILOVER' > > > #------------------------------------------------------------------------------ > # LOAD BALANCING MODE > > #------------------------------------------------------------------------------ > > load_balance_mode = on > # Activate load balancing mode > # (change requires restart) > ignore_leading_white_space = on > # Ignore leading white spaces of each > query > white_function_list = '' > # Comma separated list of function names > # that don't write to database > # Regexp are accepted > black_function_list = 'currval,lastval,nextval,setval' > # Comma separated list of function names > # that write to database > # Regexp are accepted > > #------------------------------------------------------------------------------ > # MASTER/SLAVE MODE > > #------------------------------------------------------------------------------ > > master_slave_mode = on > # Activate master/slave mode > # (change requires restart) > master_slave_sub_mode = 'stream' > # Master/slave sub mode > # Valid values are combinations slony or > # stream. Default is slony. > # (change requires restart) > > # - Streaming - > > sr_check_period = 10 > # Streaming replication check period > # Disabled (0) by default > sr_check_user = 'replicacao' > # Streaming replication check user > # This is neccessary even if you > disable streaming > # replication delay check by > sr_check_period = 0 > sr_check_password = '' > # Password for streaming replication > check user > delay_threshold = 10000000 > # Threshold before not dispatching > query to standby node > # Unit is in bytes > # Disabled (0) by default > > # - Special commands - > > follow_master_command = '' > # Executes this command after master > failover > # Special values: > # %d = node id > # %h = host name > # %p = port number > # %D = database cluster path > # %m = new master node id > # %H = hostname of the new master node > # %M = old master node id > # %P = old primary node id > # %% = '%' character > > > #------------------------------------------------------------------------------ > # PARALLEL MODE AND QUERY CACHE > > #------------------------------------------------------------------------------ > > parallel_mode = on > # Activates parallel query mode > # (change requires restart) > enable_query_cache = off > # Activates query cache > # (change requires restart) > > pgpool2_hostname = '' > # Set pgpool2 hostname > # (change requires restart) > > # - System DB info - > > system_db_hostname ='serv2' > # (change requires restart) > system_db_port = 5432 > # (change requires restart) > system_db_dbname = 'pgpool' > # (change requires restart) > system_db_schema = 'pgpool_catalog' > # (change requires restart) > system_db_user = 'usrpgpool' > # (change requires restart) > system_db_password = '' > # (change requires restart) > > #------------------------------------------------------------------------------ > # HEALTH CHECK > > #------------------------------------------------------------------------------ > > health_check_period = 10 > # Health check period > # Disabled (0) by default > health_check_timeout = 20 > # Health check timeout > # 0 means no timeout > health_check_user = 'usrpgpool' > # Health check user > health_check_password = '*******' > # Password for health check user > > > > #------------------------------------------------------------------------------ > # FAILOVER AND FAILBACK > > #------------------------------------------------------------------------------ > > failover_command = '/usr/pgpool-9.0/bin/failover_stream.sh 0 serv02 > /tmp/arquivo_gatilho.pgsql' > > # Executes this command at failover > # Special values: > # %d = node id > # %h = host name > # %p = port number > # %D = database cluster path > # %m = new master node id > # %H = hostname of the new master node > # %M = old master node id > # %P = old primary node id > # %% = '%' character > failback_command = '' > # Executes this command at failback. > # Special values: > # %d = node id > # %h = host name > # %p = port number > # %D = database cluster path > # %m = new master node id > # %H = hostname of the new master node > # %M = old master node id > # %P = old primary node id > # %% = '%' character > > fail_over_on_backend_error = on > > # Initiates failover when writing to the > # backend communication socket fails > # This is the same behaviour of > pgpool-II > # 2.2.x and previous releases > # If set to off, pgpool will report an > # error and disconnect the session. > > > > #------------------------------------------------------------------------------ > # ONLINE RECOVERY > > #------------------------------------------------------------------------------ > > recovery_user = 'nobody' > # Online recovery user > recovery_password = '' > # Online recovery password > recovery_1st_stage_command = '' > # Executes a command in first stage > recovery_2nd_stage_command = '' > # Executes a command in second stage > recovery_timeout = 90 > # Timeout in seconds to wait for the > # recovering node's postmaster to start > up > # 0 means no wait > client_idle_limit_in_recovery = 0 > # Client is disconnected after being > idle > # for that many seconds in the second > stage > # of online recovery > # 0 means no disconnection > # -1 means immediate disconnection > > > > > Message: 2 > Date: Wed, 4 Apr 2012 22:41:03 -0300 > From: Flavio Henrique Araque Gurgel <[email protected]> > Subject: Re: [pgbr-geral] Failover - Pgpool II + Hot Standby + Stream > Replication > To: Comunidade PostgreSQL Brasileira > <[email protected]> > Message-ID: > <caghtaeof82fkukbchem5msvk4vhsvbsk_wqjcnwdavurs1f...@mail.gmail.com > > > Content-Type: text/plain; charset=ISO-8859-1 > > > Implementei o ambiente com pgpool-ii+e até a realização do teste de > failover > > deu tudo certo, onde o segundo nó assumiu como primeiro server, mas o seu > > status ficou como: server2 XXXX UP. Disconect. Running as primary server. > > A mensagem parece... correta. > > > Outro detalhe é que quando tento a conexão com o pgpool-ii não consigo. > Ele > > não feveria estar como Conected o status e aceitar as conexões > normalmente > > após o failover ? Existe algum truque extra para que isso funcione ? > > pgpool.conf por favor. > Versão do pgpool, PostgreSQL e sistemas operacionais envolvidos. > > []s > Flavio Gurgel > > Antonio Abner Junior - AJ >
_______________________________________________ pgbr-geral mailing list [email protected] https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
