{"id":223825,"date":"2014-05-23T11:57:02","date_gmt":"2014-05-23T07:57:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=223825"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=223825","title":{"rendered":"<span class=\"post_title\">OpenSCG\u2019s HA failover solution \u201cPGHA\u201d. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 Master-Slave \u0434\u043b\u044f PostgreSQL 9.3<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041d\u0438\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d \u043e\u043f\u044b\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b Master-Slave \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 PostgresSQL \u2014 Asynchronous Replication + pgBouncer + PGHA \u2014 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0432\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0441 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 <a href=\"http:\/\/www.rummandba.com\/2013\/12\/pgha-postgresqlpgbouncer-high.html\">\u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430<\/a> \u0438 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043f\u043e <a href=\"https:\/\/bitbucket.org\/openscg\/pgha\/src\/95ab4749b33dafb36e9632bb509ee6c4deb43b14\/doc\/?at=master\">\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435<\/a>.<\/p>\n<h5>pgHA<\/h5>\n<p>  <a href=\"http:\/\/www.openscg.com\/postgresql-ha-automatic-failover\/\">pgHA<\/a> \u2014 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u043d\u0430 Perl, \u043a\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0432 \u0444\u0430\u0439\u043b\u0435 failoverd.pl, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432 \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 pgbouncer \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044e PostgresSQL; \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442 \u0432\u0435\u0434\u0443\u0449\u0443\u044e \u0431\u0434 \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0431\u0434 \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c, \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044e. \u041f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 9.3 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 PostgresSQL, \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/bitbucket.org\/openscg\/pgha\/downloads\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u0444\u0430\u0439\u043b\u0435 <a href=\"https:\/\/bitbucket.org\/openscg\/pgha\/src\/95ab4749b33dafb36e9632bb509ee6c4deb43b14\/doc\/?at=master\">README<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043b\u0435\u0436\u0438\u0442 \u0432 .\/9.3\/pgha\/doc\/. <\/p>\n<p>  <a name=\"habracut\"><\/a>\u041d\u0430 habrahabr, \u0441\u0443\u0434\u044f \u043f\u043e \u0432\u0441\u0435\u043c\u0443, \u0441\u0430\u043c\u044b\u043c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0434\u043b\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f pgpool. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u044b\u0439 \u043e\u043f\u044b\u0442 \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u044d\u0442\u0438 \u0434\u0432\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430.<\/p>\n<h5>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430<\/h5>\n<p>  \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0442\u0440\u0435\u0445 \u043c\u0430\u0448\u0438\u043d: \u0432\u0435\u0434\u0443\u0449\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 (master), \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e (slave) \u0438 \u0443\u0437\u043b\u0430 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0431\u0435\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e.<\/p>\n<h6>1. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u0438<\/h6>\n<p>   \u041f\u0440\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0443\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445, \u043f\u043e\u0434 \u044d\u0442\u0438\u043c \u043f\u0440\u0435\u0434\u043b\u043e\u0433\u043e\u043c \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0448\u043b\u044e\u0441\u044c \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435:  <\/p>\n<ul>\n<li><a href=\"http:\/\/www.rummandba.com\/2013\/08\/postgresql-92-streaming-replication.html\">www.rummandba.com\/2013\/08\/postgresql-92-streaming-replication.html<\/a><\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/106872\/\">habrahabr.ru\/post\/106872\/<\/a><\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/188096\/\">habrahabr.ru\/post\/188096\/<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<h6>2. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 pgBouncer<\/h6>\n<p>  <a href=\"http:\/\/wiki.postgresql.org\/wiki\/PgBouncer\">pgBouncer<\/a> \u2014 \u043b\u0435\u0433\u043a\u0438\u0439 \u043f\u0443\u043b\u0435\u0440, \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0434\u043b\u044f PostgreSQL. \u0417\u0434\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0432\u0445\u043e\u0434\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0431\u0434 \u0438\u043b\u0438 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0444\u0430\u0439\u043b\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 PostgresSQL 9.3.<\/p>\n<ol>\n<li> \u041d\u0430\u0447\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043d\u0443\u0436\u043d\u043e \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f bouncer \u0438 \u043f\u0430\u0440\u043e\u043b\u044f \u043a \u043d\u0435\u043c\u0443 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u2014 \u0443\u0437\u043b\u0435 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438\u043b\u0438 \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0432\u0435\u0434\u0443\u0449\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430.\n<\/li>\n<li> \u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c 2 \u0444\u0430\u0439\u043b\u0430 pgbouncer.ini.orig \u0438 pgbouncer.ini.failover. \u042d\u0442\u043e \u0444\u0430\u0439\u043b\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 pgbouncer \u0438 \u043f\u043e \u0441\u0443\u0442\u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043b\u0438\u0448\u044c IP \u0445\u043e\u0441\u0442\u0430\u043c\u0438 \u0431\u0434: \u0432 \u0444\u0430\u0439\u043b\u0435 .orig \u0443\u043a\u0430\u0437\u0430\u043d IP \u0438 \u043f\u043e\u0440\u0442 \u0432\u0435\u0434\u0443\u0449\u0435\u0439 \u0431\u0434, \u0432 .failover \u2014 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439. \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/bitbucket.org\/openscg\/pgha\/src\/95ab4749b33d\/support\/pgBouncer\/cfg\/?at=master\">\u0437\u0434\u0435\u0441\u044c<\/a>. <br \/>   \u2014 \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0443\u0441\u0442\u043e\u0439 log \u0444\u0430\u0439\u043b \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0443\u0442\u044c \u043a \u043d\u0435\u043c\u0443<br \/>   \u2014 \u0435\u0449\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b userlist.txt \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0431\u0443\u0434\u0443\u0442 \u0434\u0435\u043b\u0430\u0442\u044c\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0447\u0435\u0440\u0435\u0437 pgbouncer \u0438 \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0443\u0442\u044c \u043a \u043d\u0435\u043c\u0443 (\u043f\u043e\u043b\u0435 auth_file), \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 .\/9.3\/share\/doc\/pgbouncer \u0438\u043b\u0438 <a href=\"https:\/\/bitbucket.org\/openscg\/pgha\/src\/95ab4749b33d\/support\/pgBouncer\/cfg\/?at=master\">\u0437\u0434\u0435\u0441\u044c<\/a><br \/>   \u2014 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438\u0437 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u0430\u0434\u043c\u0438\u043d\u0430 \u0432 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0438 \u043a pgbouncer \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u0445 \u0432 \u043f\u043e\u043b\u0435 admin_users<br \/>   \u2014 \u0442\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u0440\u0442 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f pgbouncer (listen_port) \u0438 \u0434\u0430\u043b\u0435\u0435, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0432\u0448\u0438\u0441\u044c \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438 \u0438 \u0432\u043d\u0435\u0441\u044f \u0433\u0434\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a pgbouncer \u043a\u0430\u043a \u043a \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0431\u0434\u2026 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430.\n<\/li>\n<li>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b pgbouncer.ini \u0438 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043d\u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 pgbouncer.ini.orig. \u042d\u0442\u043e \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0444\u0430\u0439\u043b \u0438 \u0432 \u043d\u0435\u0433\u043e \u0434\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0443\u0442 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0444\u0430\u0439\u043b\u044b pgbouncer.ini.orig \u0438\u043b\u0438 pgbouncer.ini.failover \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438. \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0443\u0441\u0442\u043e\u0439 \u0444\u0430\u0439\u043b pgbouncer.ini_old, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f pgha.\n<\/li>\n<li>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c pgbouncer \u043e\u0442 \u043b\u0438\u0446\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f bouncer:<br \/>  <code>pgbouncer -d \/\u043f\u0443\u0442\u044c\/pgbouncer.ini<\/code>  <\/li>\n<\/ol>\n<p>  <\/p>\n<h6>3. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 pgHA<\/h6>\n<p>  <\/p>\n<ol>\n<li> pgHA \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 Perl \u043c\u043e\u0434\u0443\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c. \u041f\u0435\u0440\u0435\u0434 \u044d\u0442\u0438\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c CPAN:<br \/> \n<pre><code class=\"bash\">yum install perl-CPAN  perl -MCPAN -e 'install Module::Build::Compat' perl -MCPAN -e 'install Config::IniFiles' perl -MCPAN -e 'install DBI' perl -MCPAN -e 'install DBD::Pg' perl -MCPAN -e 'install Log::Log4perl' perl -MCPAN -e 'install Proc::Daemon' perl -MCPAN -e 'install Net::Ping' perl -MCPAN -e 'install Nagios::Plugin'<\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0442\u044c \u0431\u0435\u0437\u0432\u0440\u0435\u0434\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430: yaml&#8217; not installed will not store persistent state. \u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u0434\u0440\u0430\u0436\u0430\u0435\u0442, \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c:  <\/p>\n<pre><code class=\"bash\">cpan install Bundle::CPAN reload cpan exit <\/code><\/pre>\n<p>  <\/li>\n<li>\u0414\u0430\u043b\u0435\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0434\u043b\u044f pgHA, \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u043f\u0430\u043f\u043a\u0435 .\/9.3\/pgHA\/cfg\/ \u0438\u043b\u0438 <a href=\"https:\/\/bitbucket.org\/openscg\/pgha\/src\/95ab4749b33dafb36e9632bb509ee6c4deb43b14\/cfg\/?at=master\">\u0437\u0434\u0435\u0441\u044c<\/a>: \u0444\u0430\u0439\u043b\u044b example.conf \u0438 scottmVm.conf, \u043b\u0443\u0447\u0448\u0435 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439: <br \/>   \u2014 pidFile \u043c\u043e\u0436\u0435\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u0432 \u043b\u044e\u0431\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u043d\u0443\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0438.<br \/>   \u2014 logConfig \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 .\/9.3\/pgHA\/cfg\/log4perl.conf \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<br \/>   \u2014 \u0434\u043b\u044f triggerFile \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432 recovery.conf<br \/>   \u2014 \u0440\u0430\u0437\u0434\u0435\u043b [failover] \u043f\u043e\u043a\u0430 \u043b\u0443\u0447\u0448\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c, \u0447\u0443\u0442\u044c \u043d\u0438\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e \u0438 \u043e \u043d\u0435\u043c<br \/>   \u2014 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 [app01] \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 pgbouncer, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0444\u0430\u0439\u043b\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u043a\u0430\u0437\u0430 \u0432\u0435\u0434\u0443\u0449\u0435\u0439 \u0431\u0430\u0437\u044b \u0443\u0434\u0430\u043b\u044f\u044e\u0442 \u0432\u0441\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043a \u043d\u0435\u0439 \u0438 \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442 pgbouncer \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u043e\u0432\u043e\u0439 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0431\u0434:<br \/> \n<pre><code># Which databases should be part of failover fence_lock_dbs=postgres # pgBouncer command to pause \/ fence the db's fence_lock_command=kill # pgBouncer command to reload the config file fence_move_command=reload # pgBouncer command to unlock the db's fence_unlock_command=resume dbcheck=&quot;select 1&quot;<\/code><\/pre>\n<p>   \u2014 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 [app01] \u0432 \u043f\u043e\u043b\u0435 pgbouncer_db_user \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0442\u043e\u044f\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u0437 admin_users \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0432 pgbouncer.ini<br \/>   \u2014 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0438 \u0441 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438<\/p>\n<\/li>\n<li>\u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0443\u0441\u0442\u043e\u0439 log \u0444\u0430\u0439\u043b pgHA.log \u0432 \u043f\u0430\u043f\u043a\u0435 \/opt\/pgHA\/log\/. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e\u0442 \u043f\u0443\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e pgHA.\n<\/li>\n<li>\u041d\u0430 \u0432\u0435\u0434\u0443\u0449\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0432 \u0444\u0430\u0439\u043b\u0435 .\/9.3\/pgha\/cfg\/status_table.sql, \u0438\u043b\u0438 <a href=\"https:\/\/bitbucket.org\/openscg\/pgha\/src\/95ab4749b33dafb36e9632bb509ee6c4deb43b14\/cfg\/status_table.sql?at=master\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0432 \u0431\u0434 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0432 \u043f\u043e\u043b\u0435 dbname \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 [master].\n<\/li>\n<li>\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c ssh \u043a\u043b\u044e\u0447 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f pgHA \u0438 \u043f\u0435\u0440\u0435\u0441\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e bouncer: <br \/>   \u2014 <code>ssh-keygen -t rsa<\/code> (\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0443\u0441\u0442\u043e\u0439 \u043f\u0430\u0440\u043e\u043b\u044c)<br \/>   \u2014 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 ~\/.ssh\/id_rsa.pub <br \/>   \u2014 \u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u0435 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c bouncer \u043e\u0442 \u0435\u0433\u043e \u043b\u0438\u0446\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b: <br \/>   <code>mkdir ~\/.ssh<\/code> <br \/>   <code>chmod 0700 .ssh<\/code> <br \/>   <code>vi authorized_keys<\/code> (\u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0440\u0430\u043d\u0435\u0435 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 id_rsa.pub, \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0441 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c) <br \/>   <code>chmod 0600 .ssh\/authorized_keys<\/code>\n<\/li>\n<li>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c pgHA.<br \/>   <code>.\/failoverd.pl -c \/\u043f\u0443\u0442\u044c\/\u0444\u0430\u0439\u043b\u041d\u0430\u0441\u0442\u0440\u043e\u0435\u043aPgHA.conf --auto<\/code><br \/>  \u0424\u0430\u0439\u043b failoverd.pl \u043b\u0435\u0436\u0438\u0442 \u0432 \u043f\u0430\u043f\u043a\u0435 .\/9.3\/pgHA\/bin.\n<\/li>\n<li> \u0415\u0441\u043b\u0438 \u043f\u0443\u043d\u043a\u0442 6 \u043f\u0440\u043e\u0448\u0435\u043b \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a, \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c pgHA<br \/>  <code>.\/failoverd.pl -c \/\u043f\u0443\u0442\u044c\/\u0444\u0430\u0439\u043b\u041d\u0430\u0441\u0442\u0440\u043e\u0435\u043aPgHA.conf --stop<\/code><br \/>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 pgHA \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e failover \u043d\u0435 \u0441\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u041d\u0443\u0436\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0444\u0430\u0439\u043b failoverd.pl, \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u0447\u043a\u0443 443 \u0438 \u043e\u0442\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c 442 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043a\u043e\u0434\u0443 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u043c\u0443 <a href=\"https:\/\/bitbucket.org\/openscg\/pgha\/src\/95ab4749b33dafb36e9632bb509ee6c4deb43b14\/bin\/failoverd.pl?at=master#cl-375\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0414\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f:<br \/> \n<pre><code class=\"perl\"># Start the failoverd monitoring process elsif ( $startWorker ) {     print &quot;\\n\\tInitializing... \\n&quot;;      .   .   .       # Once we have verified that the system is online, we need     # to set the failover 'spring'.       $logger-&gt;info(&quot;==Startup==: Arming Failover mechanism&quot;);     print &quot;\\t === Arming Failover mechanism === \\n&quot;;     if ( SetSpring(%Config,$logger) != 1 ) #    if ( 0 )     {         $logger-&gt;info(&quot;Cannot set failover configuration, exiting...&quot;);         print &quot;Cannot set failover configuration, exiting...\\n&quot;;         exit(1);     }      .   .   . <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u043e\u0442\u043a\u0430\u0437\u0435 \u0432\u0435\u0434\u0443\u0449\u0435\u0439 \u0431\u0430\u0437\u044b pgHA \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044e, \u043e\u0442\u043a\u0440\u043e\u0435\u0442 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0431\u0430\u0437\u0443 \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c, \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 pgbouncer \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0434\u043b\u044f \u0440\u043e\u0431\u043e\u0442\u044b \u0441 \u043d\u043e\u0432\u043e\u0439 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0431\u0434 \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442 \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432 \u0440\u0443\u0447\u043d\u0443\u044e.<\/p>\n<\/li>\n<li>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c pgHA. \u0422\u0435\u0441\u0442\u0438\u0442\u044c. <\/li>\n<\/ol>\n<p>  <\/p>\n<h5>P.S.<\/h5>\n<p>  \u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 [failover] \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f failover. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435 \u043c\u0435\u043d\u044f\u0442\u044c \u043a\u043e\u0434 \u0432 failoverd.pl, \u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u2014 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u0435\u043d\u044f\u0435\u0442 \u0444\u0430\u0439\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a pgbouncer \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0435\u0433\u043e \u2014 \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u043d\u0435\u0433\u043e.<\/p>\n<p>  \u0414\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438 \u043f\u0440\u0438 \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 pgbouncer \u043c\u043e\u0436\u0435\u0442 \u0435\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c. \u041f\u043b\u044e\u0441\u043e\u043c \u0442\u0430\u043a\u0436\u0435 \u0441\u0447\u0438\u0442\u0430\u044e \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430 pgHA \u2014 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0443\u0447\u0438\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043f\u044b\u0442\u043a\u0430\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432\u0435\u0434\u0443\u0449\u0443\u044e \u0431\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u0434 failover, \u0432\u043e\u0437\u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044e, \u043c\u0435\u043d\u044f\u0442\u044c \u0448\u0440\u0438\u0444\u0442 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0438 \u0442.\u0434. <\/p>\n<p>  \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f postgres 8.4 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0432 \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e\u043c <a href=\"http:\/\/www.rummandba.com\/2013\/12\/pgha-postgresqlpgbouncer-high.html\">\u0431\u043b\u043e\u0433\u0435<\/a>. \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/223825\/\"> http:\/\/habrahabr.ru\/post\/223825\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041d\u0438\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d \u043e\u043f\u044b\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b Master-Slave \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 PostgresSQL \u2014 Asynchronous Replication + pgBouncer + PGHA \u2014 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0432\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0441 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 <a href=\"http:\/\/www.rummandba.com\/2013\/12\/pgha-postgresqlpgbouncer-high.html\">\u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430<\/a> \u0438 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043f\u043e <a href=\"https:\/\/bitbucket.org\/openscg\/pgha\/src\/95ab4749b33dafb36e9632bb509ee6c4deb43b14\/doc\/?at=master\">\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435<\/a>.<\/p>\n<h5>pgHA<\/h5>\n<p>  <a href=\"http:\/\/www.openscg.com\/postgresql-ha-automatic-failover\/\">pgHA<\/a> \u2014 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u043d\u0430 Perl, \u043a\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0432 \u0444\u0430\u0439\u043b\u0435 failoverd.pl, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432 \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 pgbouncer \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044e PostgresSQL; \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442 \u0432\u0435\u0434\u0443\u0449\u0443\u044e \u0431\u0434 \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0431\u0434 \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c, \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044e. \u041f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 9.3 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 PostgresSQL, \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/bitbucket.org\/openscg\/pgha\/downloads\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u0444\u0430\u0439\u043b\u0435 <a href=\"https:\/\/bitbucket.org\/openscg\/pgha\/src\/95ab4749b33dafb36e9632bb509ee6c4deb43b14\/doc\/?at=master\">README<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043b\u0435\u0436\u0438\u0442 \u0432 .\/9.3\/pgha\/doc\/. <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-223825","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/223825","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=223825"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/223825\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=223825"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=223825"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=223825"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}