{"id":10063,"date":"2021-01-12T13:22:15","date_gmt":"2021-01-12T12:22:15","guid":{"rendered":"http:\/\/arumel.com\/?p=10063"},"modified":"2021-01-12T13:24:23","modified_gmt":"2021-01-12T12:24:23","slug":"manual-failover-repmgr-y-postgresql-13","status":"publish","type":"post","link":"https:\/\/arumel.com\/es\/manual-failover-repmgr-y-postgresql-13\/","title":{"rendered":"Manual failover &#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=470%2C286\" alt=\"\" width=\"470\" height=\"286\" \/><\/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>Ver <a href=\"http:\/\/arumel.com\/es\/manual-switchover-repmgr-y-postgresql-13\">switchover manual<\/a>.<\/p>\n<p>Estado previo del cluster:<\/p>\n<p style=\"padding-left: 40px\"><code>[postgres@postgres1 ~]$ <strong>repmgr cluster show<\/strong><\/code><br \/>\n<code><\/code><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 | 2 | 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>&nbsp;<\/p>\n<p>Para simular el fallo del nodo primary (postgres2), paramos su instancia:<\/p>\n<p style=\"padding-left: 40px\"><code>[postgres@postgres2 ~]$ <strong>pg_ctl -D \/var\/lib\/pgsql\/13\/data stop<\/strong><\/code><br \/>\n<code>waiting for server to shut down.... done<\/code><br \/>\n<code>server stopped<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>Estado del cluster ahora:<\/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 | 2 | host=192.168.0.101 user=repmgr dbname=repmgr<\/code><br \/>\n<code><strong>2 | postgres2 | primary | ? unreachable | ? | default | 100 | | host=192.168.0.102 user=repmgr dbname=repmgr<\/strong><\/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>WARNING: following issues were detected<\/code><br \/>\n<code>- unable to connect to node \"postgres1\" (ID: 1)'s upstream node \"postgres2\" (ID: 2)<\/code><br \/>\n<code>- unable to determine if node \"postgres1\" (ID: 1) is attached to its upstream node \"postgres2\" (ID: 2)<\/code><br \/>\n<code>- unable to connect to node \"postgres2\" (ID: 2)<\/code><br \/>\n<code>- node \"postgres2\" (ID: 2) is registered as an active primary but is unreachable<\/code><br \/>\n<code>- unable to connect to node \"postgres3\" (ID: 3)'s upstream node \"postgres2\" (ID: 2)<\/code><br \/>\n<code>- unable to determine if node \"postgres3\" (ID: 3) is attached to its upstream node \"postgres2\" (ID: 2)<\/code><\/p>\n<p style=\"padding-left: 40px\"><code>HINT: execute with --verbose option to see connection error messages<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>Desde el nodo que va a ser primary, ejecutamos (arrastrando al nodo postgres3 para apuntar a la nueva primary &#8211; siblings-follow):<\/p>\n<p style=\"padding-left: 40px\"><code>[postgres@<strong>postgres1<\/strong> ~]$ <strong>repmgr standby promote --siblings-follow --verbose<\/strong><\/code><br \/>\n<code>INFO: checking for package configuration file \"\/etc\/repmgr\/13\/repmgr.conf\"<\/code><br \/>\n<code>INFO: configuration file found at: \"\/etc\/repmgr\/13\/repmgr.conf\"<\/code><br \/>\n<code>INFO: connected to standby, checking its state<\/code><br \/>\n<code>INFO: searching for primary node<\/code><br \/>\n<code>INFO: checking if node 2 is primary<\/code><br \/>\n<code>ERROR: connection to database failed<\/code><br \/>\n<code>DETAIL: <\/code><br \/>\n<code>could not connect to server: Connection refused<\/code><br \/>\n<code>Is the server running on host \"192.168.0.102\" and accepting<\/code><br \/>\n<code>TCP\/IP connections on port 5432?<\/code><\/p>\n<p style=\"padding-left: 40px\"><code>DETAIL: attempted to connect using:<\/code><br \/>\n<code>user=repmgr dbname=repmgr host=192.168.0.102 connect_timeout=2 fallback_application_name=repmgr options=-csearch_path=<\/code><br \/>\n<code>INFO: checking if node 1 is primary<\/code><br \/>\n<code>INFO: checking if node 3 is primary<\/code><br \/>\n<code>INFO: 1 active sibling nodes found<\/code><br \/>\n<code>INFO: all sibling nodes are reachable via SSH<\/code><br \/>\n<code>NOTICE: promoting standby to primary<\/code><br \/>\n<code>DETAIL: promoting server \"postgres1\" (ID: 1) 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>INFO: standby promoted to primary after 0 second(s)<\/code><br \/>\n<code>NOTICE: STANDBY PROMOTE successful<\/code><br \/>\n<code>DETAIL: server \"postgres1\" (ID: 1) was successfully promoted to primary<\/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><\/p>\n<p>&nbsp;<\/p>\n<p>Estado del cluster actual:<\/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 | 3 | host=192.168.0.101 user=repmgr dbname=repmgr<\/code><br \/>\n<code>2 | postgres2 | primary | - failed | ? | default | 100 | | host=192.168.0.102 user=repmgr dbname=repmgr<\/code><br \/>\n<code>3 | postgres3 | standby | running | postgres1 | default | 100 | 2 | host=192.168.0.103 user=repmgr dbname=repmgr<\/code><\/p>\n<p style=\"padding-left: 40px\"><code>WARNING: following issues were detected<\/code><br \/>\n<code>- unable to connect to node \"postgres2\" (ID: 2)<\/code><\/p>\n<p style=\"padding-left: 40px\"><code>HINT: execute with --verbose option to see connection error messages<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>Unimos la vieja primary (postgres2) a la nueva primary (postgres1):<\/p>\n<p style=\"padding-left: 40px\"><code>[postgres@postgres2 ~]$ <strong>repmgr -d 'host=192.168.0.101 user=repmgr dbname=repmgr' node rejoin<\/strong><\/code><br \/>\n<code>INFO: local node 2 can attach to rejoin target node 1<\/code><br \/>\n<code>DETAIL: local node's recovery point: 0\/F000028; rejoin target node's fork point: 0\/F0000A0<\/code><br \/>\n<code>INFO: creating replication slot as user \"repmgr\"<\/code><br \/>\n<code>NOTICE: setting node 2's upstream to node 1<\/code><br \/>\n<code>WARNING: unable to ping \"host=192.168.0.102 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 \"postgres2\" not found in \"pg_stat_replication\"<\/code><br \/>\n<code>INFO: waiting for node \"postgres2\" (ID: 2) to connect to new primary; 1 of max 60 attempts (parameter \"node_rejoin_timeout\")<\/code><br \/>\n<code>DETAIL: checking for record in node \"postgres1\"'s \"pg_stat_replication\" table where \"application_name\" is \"postgres2\"<\/code><br \/>\n<code>NOTICE: replication slot \"repmgr_slot_1\" deleted on node 2<\/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 2 is now attached to node 1<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>Estado del 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 | 3 | host=192.168.0.101 user=repmgr dbname=repmgr<\/code><br \/>\n<code>2 | postgres2 | standby | running | postgres1 | default | 100 | 2 | host=192.168.0.102 user=repmgr dbname=repmgr<\/code><br \/>\n<code>3 | postgres3 | standby | running | postgres1 | default | 100 | 3 | host=192.168.0.103 user=repmgr dbname=repmgr<\/code><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#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 | standby | running | postgres2 | default | 100 | 2 | [&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":[436,434,433],"class_list":["post-10063","post","type-post","status-publish","format-standard","hentry","category-portada-es","category-postgresql-es","tag-failover","tag-postgresql","tag-repmgr"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Manual failover - 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-failover-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 failover - Repmgr y Postgresql 13 - Arumel\" \/>\n<meta property=\"og:description\" content=\"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 | 100 | 2 | [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/arumel.com\/es\/manual-failover-repmgr-y-postgresql-13\/\" \/>\n<meta property=\"og:site_name\" content=\"Arumel\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-12T12:22:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-01-12T12:24:23+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-failover-repmgr-y-postgresql-13\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/manual-failover-repmgr-y-postgresql-13\\\/\"},\"author\":{\"name\":\"sm\",\"@id\":\"http:\\\/\\\/arumel.com\\\/#\\\/schema\\\/person\\\/e270e777d900dcd47f8eb3895c076b64\"},\"headline\":\"Manual failover &#8211; Repmgr y Postgresql 13\",\"datePublished\":\"2021-01-12T12:22:15+00:00\",\"dateModified\":\"2021-01-12T12:24:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/manual-failover-repmgr-y-postgresql-13\\\/\"},\"wordCount\":81,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/manual-failover-repmgr-y-postgresql-13\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/arumel.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/repmgr-manual-300x183.png\",\"keywords\":[\"failover\",\"postgresql\",\"repmgr\"],\"articleSection\":[\"portada\",\"PostgreSQL\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/arumel.com\\\/es\\\/manual-failover-repmgr-y-postgresql-13\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/manual-failover-repmgr-y-postgresql-13\\\/\",\"url\":\"https:\\\/\\\/arumel.com\\\/es\\\/manual-failover-repmgr-y-postgresql-13\\\/\",\"name\":\"Manual failover - Repmgr y Postgresql 13 - Arumel\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/arumel.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/manual-failover-repmgr-y-postgresql-13\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/manual-failover-repmgr-y-postgresql-13\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/arumel.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/repmgr-manual-300x183.png\",\"datePublished\":\"2021-01-12T12:22:15+00:00\",\"dateModified\":\"2021-01-12T12:24:23+00:00\",\"author\":{\"@id\":\"http:\\\/\\\/arumel.com\\\/#\\\/schema\\\/person\\\/e270e777d900dcd47f8eb3895c076b64\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/manual-failover-repmgr-y-postgresql-13\\\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/arumel.com\\\/es\\\/manual-failover-repmgr-y-postgresql-13\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/manual-failover-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-failover-repmgr-y-postgresql-13\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Portada\",\"item\":\"https:\\\/\\\/arumel.com\\\/es\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Manual failover &#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 failover - 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-failover-repmgr-y-postgresql-13\/","og_locale":"es_ES","og_type":"article","og_title":"Manual failover - Repmgr y Postgresql 13 - Arumel","og_description":"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 | 100 | 2 | [&hellip;]","og_url":"https:\/\/arumel.com\/es\/manual-failover-repmgr-y-postgresql-13\/","og_site_name":"Arumel","article_published_time":"2021-01-12T12:22:15+00:00","article_modified_time":"2021-01-12T12:24:23+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-failover-repmgr-y-postgresql-13\/#article","isPartOf":{"@id":"https:\/\/arumel.com\/es\/manual-failover-repmgr-y-postgresql-13\/"},"author":{"name":"sm","@id":"http:\/\/arumel.com\/#\/schema\/person\/e270e777d900dcd47f8eb3895c076b64"},"headline":"Manual failover &#8211; Repmgr y Postgresql 13","datePublished":"2021-01-12T12:22:15+00:00","dateModified":"2021-01-12T12:24:23+00:00","mainEntityOfPage":{"@id":"https:\/\/arumel.com\/es\/manual-failover-repmgr-y-postgresql-13\/"},"wordCount":81,"commentCount":0,"image":{"@id":"https:\/\/arumel.com\/es\/manual-failover-repmgr-y-postgresql-13\/#primaryimage"},"thumbnailUrl":"http:\/\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-manual-300x183.png","keywords":["failover","postgresql","repmgr"],"articleSection":["portada","PostgreSQL"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/arumel.com\/es\/manual-failover-repmgr-y-postgresql-13\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/arumel.com\/es\/manual-failover-repmgr-y-postgresql-13\/","url":"https:\/\/arumel.com\/es\/manual-failover-repmgr-y-postgresql-13\/","name":"Manual failover - Repmgr y Postgresql 13 - Arumel","isPartOf":{"@id":"http:\/\/arumel.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/arumel.com\/es\/manual-failover-repmgr-y-postgresql-13\/#primaryimage"},"image":{"@id":"https:\/\/arumel.com\/es\/manual-failover-repmgr-y-postgresql-13\/#primaryimage"},"thumbnailUrl":"http:\/\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-manual-300x183.png","datePublished":"2021-01-12T12:22:15+00:00","dateModified":"2021-01-12T12:24:23+00:00","author":{"@id":"http:\/\/arumel.com\/#\/schema\/person\/e270e777d900dcd47f8eb3895c076b64"},"breadcrumb":{"@id":"https:\/\/arumel.com\/es\/manual-failover-repmgr-y-postgresql-13\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/arumel.com\/es\/manual-failover-repmgr-y-postgresql-13\/"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/arumel.com\/es\/manual-failover-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-failover-repmgr-y-postgresql-13\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Portada","item":"https:\/\/arumel.com\/es\/"},{"@type":"ListItem","position":2,"name":"Manual failover &#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-2Cj","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":10087,"url":"https:\/\/arumel.com\/es\/auto-failover-repmgr-y-postgresql-13-parte-2\/","url_meta":{"origin":10063,"position":0},"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":10063,"position":1},"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":10040,"url":"https:\/\/arumel.com\/es\/preparacion-entorno-repmgr-y-postgresql-13-parte-2\/","url_meta":{"origin":10063,"position":2},"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":10057,"url":"https:\/\/arumel.com\/es\/manual-switchover-repmgr-y-postgresql-13\/","url_meta":{"origin":10063,"position":3},"title":"Manual switchover &#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 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 |\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":10067,"url":"https:\/\/arumel.com\/es\/auto-failover-repmgr-y-postgresql-13-parte-1\/","url_meta":{"origin":10063,"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":10097,"url":"https:\/\/arumel.com\/es\/failover-auto-pgbouncer-repmgr-postgresql-13-parte-1\/","url_meta":{"origin":10063,"position":5},"title":"Failover auto &#8211; Pgbouncer + Repmgr + Postgresql 13 (parte 1)","author":"sm","date":"12 de enero de 2021","format":false,"excerpt":"Ver configuraci\u00f3n parte 1 Ver configuraci\u00f3n parte 2 Ver configuraci\u00f3n parte 1 daemon repmgr Instalamos el pgbouncer en el nodo \"testigo\" (postgres4): [root@postgres4 ~]# dnf install pgbouncer \u00a0 Para hacer las pruebas de conexi\u00f3n de clientes, vamos a crear una nueva base de datos en el cluster (appdb) a la\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},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/arumel.com\/es\/wp-json\/wp\/v2\/posts\/10063","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=10063"}],"version-history":[{"count":11,"href":"https:\/\/arumel.com\/es\/wp-json\/wp\/v2\/posts\/10063\/revisions"}],"predecessor-version":[{"id":10186,"href":"https:\/\/arumel.com\/es\/wp-json\/wp\/v2\/posts\/10063\/revisions\/10186"}],"wp:attachment":[{"href":"https:\/\/arumel.com\/es\/wp-json\/wp\/v2\/media?parent=10063"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arumel.com\/es\/wp-json\/wp\/v2\/categories?post=10063"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arumel.com\/es\/wp-json\/wp\/v2\/tags?post=10063"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}