{"id":10057,"date":"2021-01-12T13:12:51","date_gmt":"2021-01-12T12:12:51","guid":{"rendered":"http:\/\/arumel.com\/?p=10057"},"modified":"2021-01-12T13:23:49","modified_gmt":"2021-01-12T12:23:49","slug":"manual-switchover-repmgr-y-postgresql-13","status":"publish","type":"post","link":"https:\/\/arumel.com\/es\/manual-switchover-repmgr-y-postgresql-13\/","title":{"rendered":"Manual switchover &#8211; Repmgr y Postgresql 13"},"content":{"rendered":"<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"9999\" data-permalink=\"https:\/\/arumel.com\/es\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\/repmgr-manual\/\" data-orig-file=\"https:\/\/i0.wp.com\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-manual.png?fit=657%2C401&amp;ssl=1\" data-orig-size=\"657,401\" data-comments-opened=\"1\" data-image-title=\"repmgr-manual\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-manual.png?fit=657%2C401&amp;ssl=1\" class=\"alignnone wp-image-9999\" src=\"https:\/\/i0.wp.com\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-manual.png?resize=472%2C288\" alt=\"\" width=\"472\" height=\"288\" \/><\/p>\n<p>Ver configuraci\u00f3n <a href=\"http:\/\/arumel.com\/es\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\/\">parte 1<\/a><\/p>\n<p>Ver configuraci\u00f3n <a href=\"http:\/\/arumel.com\/es\/preparacion-entorno-repmgr-y-postgresql-13-parte-2\/\">parte 2<\/a><\/p>\n<p>Comprobaci\u00f3n previa estado cluster:<\/p>\n<p style=\"padding-left: 40px\"><code>[postgres@postgres1 ~]$ <strong>repmgr cluster show<\/strong><\/code><br \/>\n<code>ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string <\/code><br \/>\n<code>----+-----------+---------+-----------+-----------+----------+----------+----------+----------------------------------------------<\/code><br \/>\n<code>1 | postgres1 | primary | * running | | default | 100 | 1 | host=192.168.0.101 user=repmgr dbname=repmgr<\/code><br \/>\n<code>2 | postgres2 | standby | running | postgres1 | default | 100 | 1 | host=192.168.0.102 user=repmgr dbname=repmgr<\/code><br \/>\n<code>3 | postgres3 | standby | running | postgres1 | default | 100 | 1 | host=192.168.0.103 user=repmgr dbname=repmgr<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>Desde el nodo que promocionar\u00e1 ejecutamos de prueba:<\/p>\n<p style=\"padding-left: 40px\"><code>[postgres@<strong>postgres2<\/strong> ~]$ <strong>repmgr standby switchover --siblings-follow --force-rewind --dry-run<\/strong><\/code><br \/>\n<code>NOTICE: checking switchover on node \"postgres2\" (ID: 2) in --dry-run mode<\/code><br \/>\n<code>INFO: prerequisites for using pg_rewind are met<\/code><br \/>\n<code>INFO: SSH connection to host \"192.168.0.101\" succeeded<\/code><br \/>\n<code>INFO 2&gt;\/dev\/null<\/code><br \/>\n<code>INFO: able to execute \"repmgr\" on remote host \"192.168.0.101\"<\/code><br \/>\n<code>INFO: all sibling nodes are reachable via SSH<\/code><br \/>\n<code>INFO: 2 walsenders required, 10 available<\/code><br \/>\n<code>INFO: demotion candidate is able to make replication connection to promotion candidate<\/code><br \/>\n<code>INFO: 0 pending archive files<\/code><br \/>\n<code>INFO: replication lag on this standby is 0 seconds<\/code><br \/>\n<code>INFO: 2 replication slots required, 10 available<\/code><br \/>\n<code>NOTICE: local node \"postgres2\" (ID: 2) would be promoted to primary; current primary \"postgres1\" (ID: 1) would be demoted to standby<\/code><br \/>\n<code>INFO: following shutdown command would be run on node \"postgres1\":<\/code><br \/>\n<code>\"sudo \/bin\/systemctl stop postgresql-13\"<\/code><br \/>\n<code>INFO: parameter \"shutdown_check_timeout\" is set to 60 seconds<\/code><br \/>\n<code>INFO: prerequisites for executing STANDBY SWITCHOVER are met<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>Lo ejecutamos en real:<\/p>\n<p style=\"padding-left: 40px\"><code>[postgres@<strong>postgres2<\/strong> ~]$ <strong>repmgr standby switchover --siblings-follow --force-rewind<\/strong><\/code><br \/>\n<code>NOTICE: executing switchover on node \"postgres2\" (ID: 2)<\/code><br \/>\n<code>NOTICE: local node \"postgres2\" (ID: 2) will be promoted to primary; current primary \"postgres1\" (ID: 1) will be demoted to standby<\/code><br \/>\n<code>NOTICE: stopping current primary node \"postgres1\" (ID: 1)<\/code><br \/>\n<code>NOTICE: issuing CHECKPOINT on node \"postgres1\" (ID: 1) <\/code><br \/>\n<code>DETAIL: executing server command \"sudo \/bin\/systemctl stop postgresql-13\"<\/code><br \/>\n<code>INFO: checking for primary shutdown; 1 of 60 attempts (\"shutdown_check_timeout\")<\/code><br \/>\n<code>NOTICE: current primary has been cleanly shut down at location 0\/D000028<\/code><br \/>\n<code>NOTICE: promoting standby to primary<\/code><br \/>\n<code>DETAIL: promoting server \"postgres2\" (ID: 2) using \"\/usr\/pgsql-13\/bin\/pg_ctl -D \/var\/lib\/pgsql\/13\/data promote\"<\/code><br \/>\n<code>waiting for server to promote.... done<\/code><br \/>\n<code>server promoted<\/code><br \/>\n<code>NOTICE: waiting up to 60 seconds (parameter \"promote_check_timeout\") for promotion to complete<\/code><br \/>\n<code>NOTICE: STANDBY PROMOTE successful<\/code><br \/>\n<code>DETAIL: server \"postgres2\" (ID: 2) was successfully promoted to primary<\/code><br \/>\n<code>NOTICE: issuing CHECKPOINT on node \"postgres2\" (ID: 2) <\/code><br \/>\n<code>ERROR: unable to execute CHECKPOINT<\/code><br \/>\n<code>INFO: local node 1 can attach to rejoin target node 2<\/code><br \/>\n<code>DETAIL: local node's recovery point: 0\/D000028; rejoin target node's fork point: 0\/D0000A0<\/code><br \/>\n<code>INFO: creating replication slot as user \"repmgr\"<\/code><br \/>\n<code>NOTICE: setting node 1's upstream to node 2<\/code><br \/>\n<code>WARNING: unable to ping \"host=192.168.0.101 user=repmgr dbname=repmgr\"<\/code><br \/>\n<code>DETAIL: PQping() returned \"PQPING_NO_RESPONSE\"<\/code><br \/>\n<code>NOTICE: starting server using \"sudo \/bin\/systemctl start postgresql-13\"<\/code><br \/>\n<code>WARNING: node \"postgres1\" not found in \"pg_stat_replication\"<\/code><br \/>\n<code>NOTICE: replication slot \"repmgr_slot_2\" deleted on node 1<\/code><br \/>\n<code>WARNING: 1 inactive replication slots detected<\/code><br \/>\n<code>DETAIL: inactive replication slots:<\/code><br \/>\n<code>- repmgr_slot_3 (physical)<\/code><br \/>\n<code>HINT: these replication slots may need to be removed manually<\/code><br \/>\n<code>NOTICE: NODE REJOIN successful<\/code><br \/>\n<code>DETAIL: node 1 is now attached to node 2<\/code><br \/>\n<code>WARNING: node \"postgres1\" not found in \"pg_stat_replication\"<\/code><br \/>\n<code>INFO: waiting for node \"postgres1\" (ID: 1) to connect to new primary; 1 of max 60 attempts (parameter \"node_rejoin_timeout\")<\/code><br \/>\n<code>DETAIL: checking for record in node \"postgres2\"'s \"pg_stat_replication\" table where \"application_name\" is \"postgres1\"<\/code><br \/>\n<code>NOTICE: node \"postgres2\" (ID: 2) promoted to primary, node \"postgres1\" (ID: 1) demoted to standby<\/code><br \/>\n<code>NOTICE: executing STANDBY FOLLOW on 1 of 1 siblings<\/code><br \/>\n<code>INFO: STANDBY FOLLOW successfully executed on all reachable sibling nodes<\/code><br \/>\n<code>NOTICE: switchover was successful<\/code><br \/>\n<code>DETAIL: node \"postgres2\" is now primary and node \"postgres1\" is attached as standby<\/code><br \/>\n<code>NOTICE: STANDBY SWITCHOVER has completed successfully<\/code><\/p>\n<p>Comprobaci\u00f3n del cluster posterior (atenci\u00f3n porque el nodo postgres3 cambia a apuntar a la nueva primary &#8211; siblings_follow -):<\/p>\n<p style=\"padding-left: 40px\"><code>[postgres@postgres1 ~]$ <strong>repmgr cluster show<\/strong><\/code><br \/>\n<code>ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string <\/code><br \/>\n<code>----+-----------+---------+-----------+-----------+----------+----------+----------+----------------------------------------------<\/code><br \/>\n<code>1 | postgres1 | standby | running | postgres2 | default | 100 | 1 | host=192.168.0.101 user=repmgr dbname=repmgr<\/code><br \/>\n<code>2 | postgres2 | primary | * running | | default | 100 | 2 | host=192.168.0.102 user=repmgr dbname=repmgr<\/code><br \/>\n<code>3 | postgres3 | standby | running | postgres2 | default | 100 | 2 | host=192.168.0.103 user=repmgr dbname=repmgr<\/code><\/p>\n<p style=\"padding-left: 40px\"><code>[postgres@postgres1 ~]$ <strong>repmgr cluster event <\/strong><\/code><br \/>\n<code>Node ID | Name | Event | OK | Timestamp | Details <\/code><br \/>\n<code>---------+-----------+--------------------+----+---------------------+--------------------------------------------------------------------------------------------<\/code><br \/>\n<code>3 | postgres3 | standby_follow | t | 2021-01-07 17:33:20 | standby attached to upstream node \"postgres2\" (ID: 2) <\/code><br \/>\n<code>2 | postgres2 | standby_switchover | t | 2021-01-07 17:33:19 | node \"postgres2\" (ID: 2) promoted to primary, node \"postgres1\" (ID: 1) demoted to standby<\/code><br \/>\n<code>2 | postgres2 | standby_promote | t | 2021-01-07 17:33:16 | server \"postgres2\" (ID: 2) was successfully promoted to primary <\/code><br \/>\n<code>3 | postgres3 | standby_register | t | 2021-01-07 17:09:56 | standby registration succeeded; upstream node ID is 1 <\/code><br \/>\n<code>3 | postgres3 | standby_clone | t | 2021-01-07 17:08:55 | cloned from host \"192.168.0.101\", port 5432; backup method: pg_basebackup; --force: N <\/code><br \/>\n<code>2 | postgres2 | standby_register | t | 2021-01-07 17:05:09 | standby registration succeeded; upstream node ID is 1 <\/code><br \/>\n<code>2 | postgres2 | standby_clone | t | 2021-01-07 17:01:55 | cloned from host \"192.168.0.101\", port 5432; backup method: pg_basebackup; --force: N <\/code><br \/>\n<code>2 | postgres2 | standby_clone | t | 2021-01-07 16:59:49 | cloned from host \"192.168.0.101\", port 5432; backup method: pg_basebackup; --force: N <\/code><br \/>\n<code>1 | postgres1 | primary_register | t | 2021-01-07 16:39:53 | <\/code><br \/>\n<code>1 | postgres1 | cluster_created | t | 2021-01-07 16:39:53 |<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>Ver <a href=\"http:\/\/arumel.com\/es\/manual-failover-repmgr-y-postgresql-13\">failover<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ver configuraci\u00f3n parte 1 Ver configuraci\u00f3n parte 2 Comprobaci\u00f3n previa estado cluster: [postgres@postgres1 ~]$ repmgr cluster show ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string &#8212;-+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- 1 | postgres1 | primary | * running | | default | 100 | 1 | host=192.168.0.101 user=repmgr dbname=repmgr [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[27,65],"tags":[434,433,435],"class_list":["post-10057","post","type-post","status-publish","format-standard","hentry","category-portada-es","category-postgresql-es","tag-postgresql","tag-repmgr","tag-switchover"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Manual switchover - Repmgr y Postgresql 13 - Arumel<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/arumel.com\/es\/manual-switchover-repmgr-y-postgresql-13\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Manual switchover - Repmgr y Postgresql 13 - Arumel\" \/>\n<meta property=\"og:description\" content=\"Ver configuraci\u00f3n parte 1 Ver configuraci\u00f3n parte 2 Comprobaci\u00f3n previa estado cluster: [postgres@postgres1 ~]$ repmgr cluster show ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string ----+-----------+---------+-----------+-----------+----------+----------+----------+---------------------------------------------- 1 | postgres1 | primary | * running | | default | 100 | 1 | host=192.168.0.101 user=repmgr dbname=repmgr [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/arumel.com\/es\/manual-switchover-repmgr-y-postgresql-13\/\" \/>\n<meta property=\"og:site_name\" content=\"Arumel\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-12T12:12:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-01-12T12:23:49+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-manual-300x183.png\" \/>\n<meta name=\"author\" content=\"sm\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"sm\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/manual-switchover-repmgr-y-postgresql-13\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/manual-switchover-repmgr-y-postgresql-13\\\/\"},\"author\":{\"name\":\"sm\",\"@id\":\"http:\\\/\\\/arumel.com\\\/#\\\/schema\\\/person\\\/e270e777d900dcd47f8eb3895c076b64\"},\"headline\":\"Manual switchover &#8211; Repmgr y Postgresql 13\",\"datePublished\":\"2021-01-12T12:12:51+00:00\",\"dateModified\":\"2021-01-12T12:23:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/manual-switchover-repmgr-y-postgresql-13\\\/\"},\"wordCount\":62,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/manual-switchover-repmgr-y-postgresql-13\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/arumel.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/repmgr-manual-300x183.png\",\"keywords\":[\"postgresql\",\"repmgr\",\"switchover\"],\"articleSection\":[\"portada\",\"PostgreSQL\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/arumel.com\\\/es\\\/manual-switchover-repmgr-y-postgresql-13\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/manual-switchover-repmgr-y-postgresql-13\\\/\",\"url\":\"https:\\\/\\\/arumel.com\\\/es\\\/manual-switchover-repmgr-y-postgresql-13\\\/\",\"name\":\"Manual switchover - Repmgr y Postgresql 13 - Arumel\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/arumel.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/manual-switchover-repmgr-y-postgresql-13\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/manual-switchover-repmgr-y-postgresql-13\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/arumel.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/repmgr-manual-300x183.png\",\"datePublished\":\"2021-01-12T12:12:51+00:00\",\"dateModified\":\"2021-01-12T12:23:49+00:00\",\"author\":{\"@id\":\"http:\\\/\\\/arumel.com\\\/#\\\/schema\\\/person\\\/e270e777d900dcd47f8eb3895c076b64\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/manual-switchover-repmgr-y-postgresql-13\\\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/arumel.com\\\/es\\\/manual-switchover-repmgr-y-postgresql-13\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/manual-switchover-repmgr-y-postgresql-13\\\/#primaryimage\",\"url\":\"http:\\\/\\\/arumel.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/repmgr-manual-300x183.png\",\"contentUrl\":\"http:\\\/\\\/arumel.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/repmgr-manual-300x183.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/manual-switchover-repmgr-y-postgresql-13\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Portada\",\"item\":\"https:\\\/\\\/arumel.com\\\/es\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Manual switchover &#8211; Repmgr y Postgresql 13\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\\\/\\\/arumel.com\\\/#website\",\"url\":\"http:\\\/\\\/arumel.com\\\/\",\"name\":\"Arumel\",\"description\":\"Outro sitio WordPress m\u00e1is\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\\\/\\\/arumel.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"es\"},{\"@type\":\"Person\",\"@id\":\"http:\\\/\\\/arumel.com\\\/#\\\/schema\\\/person\\\/e270e777d900dcd47f8eb3895c076b64\",\"name\":\"sm\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6207cd8b9baaee6c4cff92251bb20e4b48ce165f93e926218da90832d9f334f9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6207cd8b9baaee6c4cff92251bb20e4b48ce165f93e926218da90832d9f334f9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6207cd8b9baaee6c4cff92251bb20e4b48ce165f93e926218da90832d9f334f9?s=96&d=mm&r=g\",\"caption\":\"sm\"},\"url\":\"https:\\\/\\\/arumel.com\\\/es\\\/author\\\/sergio\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Manual switchover - Repmgr y Postgresql 13 - Arumel","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/arumel.com\/es\/manual-switchover-repmgr-y-postgresql-13\/","og_locale":"es_ES","og_type":"article","og_title":"Manual switchover - Repmgr y Postgresql 13 - Arumel","og_description":"Ver configuraci\u00f3n parte 1 Ver configuraci\u00f3n parte 2 Comprobaci\u00f3n previa estado cluster: [postgres@postgres1 ~]$ repmgr cluster show ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string ----+-----------+---------+-----------+-----------+----------+----------+----------+---------------------------------------------- 1 | postgres1 | primary | * running | | default | 100 | 1 | host=192.168.0.101 user=repmgr dbname=repmgr [&hellip;]","og_url":"https:\/\/arumel.com\/es\/manual-switchover-repmgr-y-postgresql-13\/","og_site_name":"Arumel","article_published_time":"2021-01-12T12:12:51+00:00","article_modified_time":"2021-01-12T12:23:49+00:00","og_image":[{"url":"http:\/\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-manual-300x183.png","type":"","width":"","height":""}],"author":"sm","twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"sm","Tiempo de lectura":"4 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/arumel.com\/es\/manual-switchover-repmgr-y-postgresql-13\/#article","isPartOf":{"@id":"https:\/\/arumel.com\/es\/manual-switchover-repmgr-y-postgresql-13\/"},"author":{"name":"sm","@id":"http:\/\/arumel.com\/#\/schema\/person\/e270e777d900dcd47f8eb3895c076b64"},"headline":"Manual switchover &#8211; Repmgr y Postgresql 13","datePublished":"2021-01-12T12:12:51+00:00","dateModified":"2021-01-12T12:23:49+00:00","mainEntityOfPage":{"@id":"https:\/\/arumel.com\/es\/manual-switchover-repmgr-y-postgresql-13\/"},"wordCount":62,"commentCount":0,"image":{"@id":"https:\/\/arumel.com\/es\/manual-switchover-repmgr-y-postgresql-13\/#primaryimage"},"thumbnailUrl":"http:\/\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-manual-300x183.png","keywords":["postgresql","repmgr","switchover"],"articleSection":["portada","PostgreSQL"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/arumel.com\/es\/manual-switchover-repmgr-y-postgresql-13\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/arumel.com\/es\/manual-switchover-repmgr-y-postgresql-13\/","url":"https:\/\/arumel.com\/es\/manual-switchover-repmgr-y-postgresql-13\/","name":"Manual switchover - Repmgr y Postgresql 13 - Arumel","isPartOf":{"@id":"http:\/\/arumel.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/arumel.com\/es\/manual-switchover-repmgr-y-postgresql-13\/#primaryimage"},"image":{"@id":"https:\/\/arumel.com\/es\/manual-switchover-repmgr-y-postgresql-13\/#primaryimage"},"thumbnailUrl":"http:\/\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-manual-300x183.png","datePublished":"2021-01-12T12:12:51+00:00","dateModified":"2021-01-12T12:23:49+00:00","author":{"@id":"http:\/\/arumel.com\/#\/schema\/person\/e270e777d900dcd47f8eb3895c076b64"},"breadcrumb":{"@id":"https:\/\/arumel.com\/es\/manual-switchover-repmgr-y-postgresql-13\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/arumel.com\/es\/manual-switchover-repmgr-y-postgresql-13\/"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/arumel.com\/es\/manual-switchover-repmgr-y-postgresql-13\/#primaryimage","url":"http:\/\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-manual-300x183.png","contentUrl":"http:\/\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-manual-300x183.png"},{"@type":"BreadcrumbList","@id":"https:\/\/arumel.com\/es\/manual-switchover-repmgr-y-postgresql-13\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Portada","item":"https:\/\/arumel.com\/es\/"},{"@type":"ListItem","position":2,"name":"Manual switchover &#8211; Repmgr y Postgresql 13"}]},{"@type":"WebSite","@id":"http:\/\/arumel.com\/#website","url":"http:\/\/arumel.com\/","name":"Arumel","description":"Outro sitio WordPress m\u00e1is","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/arumel.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"es"},{"@type":"Person","@id":"http:\/\/arumel.com\/#\/schema\/person\/e270e777d900dcd47f8eb3895c076b64","name":"sm","image":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/secure.gravatar.com\/avatar\/6207cd8b9baaee6c4cff92251bb20e4b48ce165f93e926218da90832d9f334f9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/6207cd8b9baaee6c4cff92251bb20e4b48ce165f93e926218da90832d9f334f9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6207cd8b9baaee6c4cff92251bb20e4b48ce165f93e926218da90832d9f334f9?s=96&d=mm&r=g","caption":"sm"},"url":"https:\/\/arumel.com\/es\/author\/sergio\/"}]}},"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9uvW6-2Cd","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":10040,"url":"https:\/\/arumel.com\/es\/preparacion-entorno-repmgr-y-postgresql-13-parte-2\/","url_meta":{"origin":10057,"position":0},"title":"Preparaci\u00f3n entorno &#8211; Repmgr y Postgresql 13 (parte 2)","author":"sm","date":"12 de enero de 2021","format":false,"excerpt":"Ver configuraci\u00f3n parte1 Registramos el primer nodo en el cluster: [postgres@postgres1 ~]$ repmgr primary register INFO: connecting to primary database... NOTICE: attempting to install extension \"repmgr\" NOTICE: \"repmgr\" extension successfully installed NOTICE: primary node record (ID: 1) registered \u00a0 Mostramos el estado del cluster: [postgres@postgres1 ~]$ repmgr cluster show ID\u2026","rel":"","context":"En &quot;PostgreSQL&quot;","block_context":{"text":"PostgreSQL","link":"https:\/\/arumel.com\/es\/postgresql-es\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10063,"url":"https:\/\/arumel.com\/es\/manual-failover-repmgr-y-postgresql-13\/","url_meta":{"origin":10057,"position":1},"title":"Manual failover &#8211; Repmgr y Postgresql 13","author":"sm","date":"12 de enero de 2021","format":false,"excerpt":"Ver configuraci\u00f3n parte 1. Ver configuraci\u00f3n parte 2. Ver switchover manual. Estado previo del cluster: [postgres@postgres1 ~]$ repmgr cluster show ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string ----+-----------+---------+-----------+-----------+----------+----------+----------+---------------------------------------------- 1 | postgres1 | standby | running | postgres2 | default\u2026","rel":"","context":"En &quot;portada&quot;","block_context":{"text":"portada","link":"https:\/\/arumel.com\/es\/portada-es\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-manual-300x183.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":10087,"url":"https:\/\/arumel.com\/es\/auto-failover-repmgr-y-postgresql-13-parte-2\/","url_meta":{"origin":10057,"position":2},"title":"Auto failover &#8211; Repmgr y Postgresql 13 (parte 2)","author":"sm","date":"12 de enero de 2021","format":false,"excerpt":"Ver configuraci\u00f3n de la parte 1. El estado previo del cluster es el siguiente: [postgres@postgres1 ~]$ repmgr cluster show ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string ----+-------------------+---------+-----------+-----------+----------+----------+----------+---------------------------------------------- 1 | postgres1 | primary | * running | | default |\u2026","rel":"","context":"En &quot;portada&quot;","block_context":{"text":"portada","link":"https:\/\/arumel.com\/es\/portada-es\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-auto-284x300.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":10119,"url":"https:\/\/arumel.com\/es\/failover-auto-pgbouncer-repmgr-postgresql-13-parte-4\/","url_meta":{"origin":10057,"position":3},"title":"Failover auto &#8211; Pgbouncer + Repmgr + Postgresql 13 (parte 4)","author":"sm","date":"12 de enero de 2021","format":false,"excerpt":"Ver parte 1 Ver parte 2 Ver parte 3 Vamos a hacer una prueba de balanceo autom\u00e1tico tras la p\u00e9rdida del nodo primario (postgres2) y como balancea el failover a un nodo secundario (postgres1), tras la parada de la conexiones en el pgbouncer, posterior reconfiguraci\u00f3n, y conexi\u00f3n posterior al nuevo\u2026","rel":"","context":"En &quot;portada&quot;","block_context":{"text":"portada","link":"https:\/\/arumel.com\/es\/portada-es\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/arumel.com\/wp-content\/uploads\/2021\/01\/pgbouncer-repmgr-auto-285x300.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/arumel.com\/wp-content\/uploads\/2021\/01\/pgbouncer-repmgr-auto-285x300.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/arumel.com\/wp-content\/uploads\/2021\/01\/pgbouncer-repmgr-auto-285x300.png?resize=525%2C300 1.5x"},"classes":[]},{"id":10067,"url":"https:\/\/arumel.com\/es\/auto-failover-repmgr-y-postgresql-13-parte-1\/","url_meta":{"origin":10057,"position":4},"title":"Auto failover &#8211; Repmgr y Postgresql 13 (parte 1)","author":"sm","date":"12 de enero de 2021","format":false,"excerpt":"Si repasamos las entradas anteriores Parte1 y Parte2, vemos que tenemos configurado el repmgr pero no hemos activado el demonio para que haga el chequeo continuo. Para ello necesitamos activar el servicio a nivel de SO y cargar su librer\u00eda en postgresql. En el fichero de postgresql.conf a\u00f1adimos la siguiente\u2026","rel":"","context":"En &quot;portada&quot;","block_context":{"text":"portada","link":"https:\/\/arumel.com\/es\/portada-es\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-auto-284x300.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":9995,"url":"https:\/\/arumel.com\/es\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\/","url_meta":{"origin":10057,"position":5},"title":"Preparaci\u00f3n entorno &#8211; Repmgr y Postgresql 13 (parte 1)","author":"sm","date":"12 de enero de 2021","format":false,"excerpt":"\u00a0 Nos disponemos a preparar un entorno sobre el que realizar pruebas con repmgr 13 (versi\u00f3n 5.2) y postgresql versi\u00f3n 13. En nuestro caso se tratar\u00e1 de un OEL 8.3 (con kernel de redhat). Una vez creada la primera m\u00e1quina virtual procedemos a la instalaci\u00f3n de los repositorios y desactivar\u2026","rel":"","context":"En &quot;PostgreSQL&quot;","block_context":{"text":"PostgreSQL","link":"https:\/\/arumel.com\/es\/postgresql-es\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-manual.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-manual.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-manual.png?resize=525%2C300 1.5x"},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/arumel.com\/es\/wp-json\/wp\/v2\/posts\/10057","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arumel.com\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arumel.com\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arumel.com\/es\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/arumel.com\/es\/wp-json\/wp\/v2\/comments?post=10057"}],"version-history":[{"count":14,"href":"https:\/\/arumel.com\/es\/wp-json\/wp\/v2\/posts\/10057\/revisions"}],"predecessor-version":[{"id":10188,"href":"https:\/\/arumel.com\/es\/wp-json\/wp\/v2\/posts\/10057\/revisions\/10188"}],"wp:attachment":[{"href":"https:\/\/arumel.com\/es\/wp-json\/wp\/v2\/media?parent=10057"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arumel.com\/es\/wp-json\/wp\/v2\/categories?post=10057"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arumel.com\/es\/wp-json\/wp\/v2\/tags?post=10057"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}