{"id":9995,"date":"2021-01-12T12:53:42","date_gmt":"2021-01-12T11:53:42","guid":{"rendered":"http:\/\/arumel.com\/?p=9995"},"modified":"2021-01-12T12:53:42","modified_gmt":"2021-01-12T11:53:42","slug":"preparacion-entorno-repmgr-y-postgresql-13-parte-1","status":"publish","type":"post","link":"https:\/\/arumel.com\/es\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\/","title":{"rendered":"Preparaci\u00f3n entorno &#8211; Repmgr y Postgresql 13 (parte 1)"},"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=\"wp-image-9999 size-full aligncenter\" src=\"https:\/\/i0.wp.com\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-manual.png?resize=657%2C401\" alt=\"\" width=\"657\" height=\"401\" srcset=\"http:\/\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-manual.png 657w, http:\/\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-manual-480x293.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 657px, 100vw\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Nos disponemos a preparar un entorno sobre el que realizar pruebas con repmgr 13 (versi\u00f3n 5.2) y postgresql versi\u00f3n 13.<\/p>\n<p>En nuestro caso se tratar\u00e1 de un OEL 8.3 (con kernel de redhat).<\/p>\n<p>Una vez creada la primera m\u00e1quina virtual procedemos a la instalaci\u00f3n de los repositorios y desactivar el m\u00f3dulo por defecto:<\/p>\n<p style=\"padding-left: 40px\"><code>[root@postgres1 ~]# curl https:\/\/dl.2ndquadrant.com\/default\/release\/get\/13\/rpm | sudo bash<\/code><\/p>\n<p style=\"padding-left: 40px\"><code>[root@postgres1 ~]# dnf -y install https:\/\/download.postgresql.org\/pub\/repos\/yum\/reporpms\/EL-8-x86_64\/pgdg-redhat-repo-latest.noarch.rpm<\/code><\/p>\n<p style=\"padding-left: 40px\"><code>[root@postgres1 ~]# dnf -qy module disable postgresql<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>Instalamos los productos:<\/p>\n<p style=\"padding-left: 40px\"><code>[root@postgres1 ~]# <strong>dnf install postgresql13-server -y<\/strong><\/code><\/p>\n<p style=\"padding-left: 40px\"><code>[root@postgres1 ~]# <strong>dnf install repmgr13 -y<\/strong><\/code><\/p>\n<p>&nbsp;<\/p>\n<p>Modificamos el fichero <strong>\/etc\/sudoers<\/strong> para que nos deje utilizar los servicios de ambos productos desde el usuario postgres:<\/p>\n<p style=\"padding-left: 40px\"><code>## Allow root to run any commands anywhere<\/code><br \/>\n<code>root ALL=(ALL) ALL<\/code><br \/>\n<code>postgres ALL= NOPASSWD: \/bin\/systemctl stop postgresql-13, \\<\/code><br \/>\n<code>\/bin\/systemctl start postgresql-13, \\<\/code><br \/>\n<code>\/bin\/systemctl status postgresql-13, \\<\/code><br \/>\n<code>\/bin\/systemctl restart postgresql-13, \\<\/code><br \/>\n<code>\/bin\/systemctl reload postgresql-13, \\<\/code><br \/>\n<code>\/bin\/systemctl start repmgr13, \\<\/code><br \/>\n<code>\/bin\/systemctl status repmgr13, \\<\/code><br \/>\n<code>\/bin\/systemctl restart repmgr13, \\<\/code><br \/>\n<code>\/bin\/systemctl reload repmgr13, \\<\/code><br \/>\n<code>\/bin\/systemctl stop repmgr13<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>Inicializamos postgresql:<\/p>\n<p style=\"padding-left: 40px\"><code>[root@postgres1 ~]# <strong>\/usr\/pgsql-13\/bin\/postgresql-13-setup initdb<\/strong><\/code><br \/>\n<code>Initializing database ... OK<\/code><br \/>\n<code>[root@postgres1 ~]# systemctl enable postgresql-13<\/code><br \/>\n<code>Created symlink \/etc\/systemd\/system\/multi-user.target.wants\/postgresql-13.service \u2192 \/usr\/lib\/systemd\/system\/postgresql-13.service.<\/code><br \/>\n<code>[root@postgres1 ~]# systemctl start postgresql-13<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>Creamos la base de datos para repmgr:<\/p>\n<p style=\"padding-left: 40px\"><code>[postgres@postgres1 ~]$ <strong>psql -c 'CREATE USER repmgr WITH REPLICATION SUPERUSER LOGIN';<\/strong><\/code><br \/>\n<code>CREATE ROLE<\/code><br \/>\n<code>[postgres@postgres1 ~]$ <strong>psql -c 'CREATE DATABASE repmgr OWNER repmgr';<\/strong><\/code><br \/>\n<code>CREATE DATABASE<\/code><br \/>\n<code>[postgres@postgres1 ~]$ <strong>psql -c 'ALTER USER repmgr SET search_path TO repmgr, \"$user\", public';<\/strong><\/code><br \/>\n<code>ALTER ROLE<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>A\u00f1adimos al fichero <strong>pg_hba.conf<\/strong> las siguientes entradas (notar que la ip 104 es para otro entorno que servir\u00e1 para otras pruebas m\u00e1s adelante -pgbouncer y witness-):<\/p>\n<p style=\"padding-left: 40px\"><code>host repmgr repmgr 192.168.0.101\/32 trust<\/code><br \/>\n<code>host repmgr repmgr 192.168.0.102\/32 trust<\/code><br \/>\n<code>host repmgr repmgr 192.168.0.103\/32 trust<\/code><br \/>\n<code>host repmgr repmgr 192.168.0.104\/32 trust<\/code><br \/>\n<code>host replication repmgr 192.168.0.101\/32 trust<\/code><br \/>\n<code>host replication repmgr 192.168.0.102\/32 trust<\/code><br \/>\n<code>host replication repmgr 192.168.0.103\/32 trust<\/code><br \/>\n<code>host replication repmgr 192.168.0.104\/32 trust<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>A\u00f1adimos al fichero <strong>postgresql.conf<\/strong> las siguientes entradas (notar que el par\u00e1metro wal_log_hints es para poder hacer pg_rewind):<\/p>\n<p style=\"padding-left: 40px\"><code>listen_addresses = '*'<\/code><br \/>\n<code>port=5432<\/code><\/p>\n<p style=\"padding-left: 40px\"><code>hot_standby = on<\/code><br \/>\n<code>wal_level = replica<\/code><br \/>\n<code>archive_mode = on<\/code><br \/>\n<code>archive_command = '\/bin\/true'<\/code><br \/>\n<code>max_wal_senders = 10<\/code><br \/>\n<code>max_replication_slots = 10<\/code><br \/>\n<code>wal_log_hints = on <\/code><code><\/code><\/p>\n<p>&nbsp;<\/p>\n<p>A\u00f1adimos al fichero <strong>\/etc\/repmgr\/13\/repmgr.conf<\/strong> las siguientes entradas:<\/p>\n<p style=\"padding-left: 40px\"><code>node_id=1<\/code><br \/>\n<code>node_name=postgres1<\/code><br \/>\n<code>conninfo='host=192.168.0.101 user=repmgr dbname=repmgr'<\/code><br \/>\n<code>data_directory='\/var\/lib\/pgsql\/13\/data'<\/code><br \/>\n<code>pg_bindir='\/usr\/pgsql-13\/bin'<\/code><br \/>\n<code>log_file='\/var\/lib\/pgsql\/13\/repmgr.log'<\/code><br \/>\n<code>use_replication_slots=true<\/code><br \/>\n<code>service_start_command='sudo \/bin\/systemctl start postgresql-13'<\/code><br \/>\n<code>service_stop_command='sudo \/bin\/systemctl stop postgresql-13'<\/code><br \/>\n<code>service_restart_command='sudo \/bin\/systemctl restart postgresql-13'<\/code><br \/>\n<code>service_reload_command='\/usr\/pgsql-13\/bin\/pg_ctl -D \/var\/lib\/pgsql\/13\/data reload'<\/code><br \/>\n<code>service_promote_command='\/usr\/pgsql-13\/bin\/pg_ctl -D \/var\/lib\/pgsql\/13\/data promote'<\/code><br \/>\n<code>promote_command='\/usr\/pgsql-13\/bin\/repmgr standby promote -f \/etc\/repmgr\/13\/repmgr.conf --log-to-file'<\/code><br \/>\n<code>follow_command='\/usr\/pgsql-13\/bin\/repmgr standby follow -f \/etc\/repmgr\/13\/repmgr.conf --log-to-file --upstream-node-id=%n'<\/code><br \/>\n<code>ssh_options='-q -o ConnectTimeout=10'<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>Chequemos los comandos:<\/p>\n<p style=\"padding-left: 40px\"><code>[postgres@postgres1 ~]$ repmgr node service --list-actions --action=start<\/code><br \/>\n<code>sudo \/bin\/systemctl start postgresql-13<\/code><br \/>\n<code>[postgres@postgres1 ~]$ repmgr node service --list-actions --action=stop<\/code><br \/>\n<code>sudo \/bin\/systemctl stop postgresql-13<\/code><br \/>\n<code>[postgres@postgres1 ~]$ repmgr node service --list-actions --action=reload<\/code><br \/>\n<code>\/usr\/pgsql-13\/bin\/pg_ctl -D \/var\/lib\/pgsql\/13\/data reload<\/code><br \/>\n<code>[postgres@postgres1 ~]$ repmgr node service --list-actions --action=restart<\/code><br \/>\n<code>sudo \/bin\/systemctl restart postgresql-13<\/code><br \/>\n<code>[postgres@postgres1 ~]$ repmgr node service --list-actions --action=promote<\/code><br \/>\n<code>\/usr\/pgsql-13\/bin\/pg_ctl -D \/var\/lib\/pgsql\/13\/data promote<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>A\u00f1adimos el servicio al firewall:<\/p>\n<p style=\"padding-left: 40px\"><code>[root@postgres1 ~]# <strong>firewall-cmd --zone=public --permanent --add-service=postgresql<\/strong><\/code><br \/>\n<code>success<\/code><br \/>\n<code>[root@postgres1 ~]# firewall-cmd --reload<\/code><br \/>\n<code>success<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>Cambiamos la password al usuario postgres:<\/p>\n<p style=\"padding-left: 40px\"><code>[root@postgres1 ~]# <strong>passwd postgres<\/strong><\/code><br \/>\n<code>Changing password for user postgres.<\/code><br \/>\n<code>New password: <\/code><br \/>\n<code>BAD PASSWORD: The password contains the user name in some form<\/code><br \/>\n<code>Retype new password: <\/code><br \/>\n<code>passwd: all authentication tokens updated successfully.<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>Clonamos esta m\u00e1quina para hacer el resto de m\u00e1quinas (postgres2 y postgres3).<\/p>\n<p>Ojo!! porque el resto de m\u00e1quinas tienen que tener el PG_DATA vac\u00edo.<\/p>\n<p>Una vez clonadas y cambiadas sus hostnames e ips, configuramos el ssh sin password (entre todas):<\/p>\n<p style=\"padding-left: 40px\"><code>[postgres@postgres1 ~]$ <strong>ssh-keygen -t rsa -b 4096<\/strong><\/code><br \/>\n<code>Generating public\/private rsa key pair.<\/code><br \/>\n<code>Enter file in which to save the key (\/var\/lib\/pgsql\/.ssh\/id_rsa): <\/code><br \/>\n<code>Created directory '\/var\/lib\/pgsql\/.ssh'.<\/code><br \/>\n<code>Enter passphrase (empty for no passphrase): <\/code><br \/>\n<code>Enter same passphrase again: <\/code><br \/>\n<code>Your identification has been saved in \/var\/lib\/pgsql\/.ssh\/id_rsa.<\/code><br \/>\n<code>Your public key has been saved in \/var\/lib\/pgsql\/.ssh\/id_rsa.pub.<\/code><br \/>\n<code>The key fingerprint is:<\/code><br \/>\n<code>SHA256:eaAi7BRAmGHeiL39FqBiQMy5C9m00FLHSZYaCDhrsJQ postgres@nodo1<\/code><br \/>\n<code>The key's randomart image is:<\/code><br \/>\n<code>+---[RSA 4096]----+<\/code><br \/>\n<code>|@X+o+o |<\/code><br \/>\n<code>|#E*o+ |<\/code><br \/>\n<code>|=%+=. . |<\/code><br \/>\n<code>|*++= . . o |<\/code><br \/>\n<code>|+.B o o S . |<\/code><br \/>\n<code>|.= . o . . |<\/code><br \/>\n<code>| . o |<\/code><br \/>\n<code>| . |<\/code><br \/>\n<code>| |<\/code><br \/>\n<code>+----[SHA256]-----+<\/code><\/p>\n<p style=\"padding-left: 40px\"><code>[postgres@postgres1 ~]$ ssh-copy-id postgres@192.168.0.101<\/code><br \/>\n<code>[postgres@postgres1 ~]$ ssh-copy-id postgres@192.168.0.102<\/code><br \/>\n<code>[postgres@postgres1 ~]$ ssh-copy-id postgres@192.168.0.103<\/code><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/arumel.com\/es\/preparacion-entorno-repmgr-y-postgresql-13-parte-2\">Ir a parte 2<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; 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 el m\u00f3dulo por defecto: [root@postgres1 [&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":"off","_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":[65],"tags":[434,433],"class_list":["post-9995","post","type-post","status-publish","format-standard","hentry","category-postgresql-es","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>Preparaci\u00f3n entorno - Repmgr y Postgresql 13 (parte 1) - 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\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Preparaci\u00f3n entorno - Repmgr y Postgresql 13 (parte 1) - Arumel\" \/>\n<meta property=\"og:description\" content=\"&nbsp; 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 el m\u00f3dulo por defecto: [root@postgres1 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/arumel.com\/es\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\/\" \/>\n<meta property=\"og:site_name\" content=\"Arumel\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-12T11:53:42+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-manual.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\\\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\\\/\"},\"author\":{\"name\":\"sm\",\"@id\":\"http:\\\/\\\/arumel.com\\\/#\\\/schema\\\/person\\\/e270e777d900dcd47f8eb3895c076b64\"},\"headline\":\"Preparaci\u00f3n entorno &#8211; Repmgr y Postgresql 13 (parte 1)\",\"datePublished\":\"2021-01-12T11:53:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\\\/\"},\"wordCount\":243,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/arumel.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/repmgr-manual.png\",\"keywords\":[\"postgresql\",\"repmgr\"],\"articleSection\":[\"PostgreSQL\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/arumel.com\\\/es\\\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\\\/\",\"url\":\"https:\\\/\\\/arumel.com\\\/es\\\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\\\/\",\"name\":\"Preparaci\u00f3n entorno - Repmgr y Postgresql 13 (parte 1) - Arumel\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/arumel.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/arumel.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/repmgr-manual.png\",\"datePublished\":\"2021-01-12T11:53:42+00:00\",\"author\":{\"@id\":\"http:\\\/\\\/arumel.com\\\/#\\\/schema\\\/person\\\/e270e777d900dcd47f8eb3895c076b64\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\\\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/arumel.com\\\/es\\\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\\\/#primaryimage\",\"url\":\"http:\\\/\\\/arumel.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/repmgr-manual.png\",\"contentUrl\":\"http:\\\/\\\/arumel.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/repmgr-manual.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/arumel.com\\\/es\\\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Portada\",\"item\":\"https:\\\/\\\/arumel.com\\\/es\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Preparaci\u00f3n entorno &#8211; Repmgr y Postgresql 13 (parte 1)\"}]},{\"@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":"Preparaci\u00f3n entorno - Repmgr y Postgresql 13 (parte 1) - 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\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\/","og_locale":"es_ES","og_type":"article","og_title":"Preparaci\u00f3n entorno - Repmgr y Postgresql 13 (parte 1) - Arumel","og_description":"&nbsp; 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 el m\u00f3dulo por defecto: [root@postgres1 [&hellip;]","og_url":"https:\/\/arumel.com\/es\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\/","og_site_name":"Arumel","article_published_time":"2021-01-12T11:53:42+00:00","og_image":[{"url":"http:\/\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-manual.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\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\/#article","isPartOf":{"@id":"https:\/\/arumel.com\/es\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\/"},"author":{"name":"sm","@id":"http:\/\/arumel.com\/#\/schema\/person\/e270e777d900dcd47f8eb3895c076b64"},"headline":"Preparaci\u00f3n entorno &#8211; Repmgr y Postgresql 13 (parte 1)","datePublished":"2021-01-12T11:53:42+00:00","mainEntityOfPage":{"@id":"https:\/\/arumel.com\/es\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\/"},"wordCount":243,"commentCount":0,"image":{"@id":"https:\/\/arumel.com\/es\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\/#primaryimage"},"thumbnailUrl":"http:\/\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-manual.png","keywords":["postgresql","repmgr"],"articleSection":["PostgreSQL"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/arumel.com\/es\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/arumel.com\/es\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\/","url":"https:\/\/arumel.com\/es\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\/","name":"Preparaci\u00f3n entorno - Repmgr y Postgresql 13 (parte 1) - Arumel","isPartOf":{"@id":"http:\/\/arumel.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/arumel.com\/es\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\/#primaryimage"},"image":{"@id":"https:\/\/arumel.com\/es\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\/#primaryimage"},"thumbnailUrl":"http:\/\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-manual.png","datePublished":"2021-01-12T11:53:42+00:00","author":{"@id":"http:\/\/arumel.com\/#\/schema\/person\/e270e777d900dcd47f8eb3895c076b64"},"breadcrumb":{"@id":"https:\/\/arumel.com\/es\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/arumel.com\/es\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\/"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/arumel.com\/es\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\/#primaryimage","url":"http:\/\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-manual.png","contentUrl":"http:\/\/arumel.com\/wp-content\/uploads\/2021\/01\/repmgr-manual.png"},{"@type":"BreadcrumbList","@id":"https:\/\/arumel.com\/es\/preparacion-entorno-repmgr-y-postgresql-13-parte-1\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Portada","item":"https:\/\/arumel.com\/es\/"},{"@type":"ListItem","position":2,"name":"Preparaci\u00f3n entorno &#8211; Repmgr y Postgresql 13 (parte 1)"}]},{"@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-2Bd","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":10067,"url":"https:\/\/arumel.com\/es\/auto-failover-repmgr-y-postgresql-13-parte-1\/","url_meta":{"origin":9995,"position":0},"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":10040,"url":"https:\/\/arumel.com\/es\/preparacion-entorno-repmgr-y-postgresql-13-parte-2\/","url_meta":{"origin":9995,"position":1},"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":10097,"url":"https:\/\/arumel.com\/es\/failover-auto-pgbouncer-repmgr-postgresql-13-parte-1\/","url_meta":{"origin":9995,"position":2},"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":[]},{"id":10110,"url":"https:\/\/arumel.com\/es\/failover-auto-pgbouncer-repmgr-postgresql-13-parte-2\/","url_meta":{"origin":9995,"position":3},"title":"Failover auto &#8211; Pgbouncer + Repmgr + Postgresql 13 (parte 2)","author":"sm","date":"12 de enero de 2021","format":false,"excerpt":"Ver parte 1. Ahora vamos a probar como el pgbouncer puede dirigirnos nuestras sesiones al nodo r\/w (primary) o a los r\/o (secondary). En nuestro caso el primary es el nodo postgres2 y los secondary son el postgres1 y postgres3. Se pueden tener configuradas diferentes entradas en el fichero \/etc\/pgbouncer\/pgbouncer.database.ini\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\/pgbouncer-repmgr-auto-285x300.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":9995,"position":4},"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":9995,"position":5},"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":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/arumel.com\/es\/wp-json\/wp\/v2\/posts\/9995","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=9995"}],"version-history":[{"count":40,"href":"https:\/\/arumel.com\/es\/wp-json\/wp\/v2\/posts\/9995\/revisions"}],"predecessor-version":[{"id":10163,"href":"https:\/\/arumel.com\/es\/wp-json\/wp\/v2\/posts\/9995\/revisions\/10163"}],"wp:attachment":[{"href":"https:\/\/arumel.com\/es\/wp-json\/wp\/v2\/media?parent=9995"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arumel.com\/es\/wp-json\/wp\/v2\/categories?post=9995"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arumel.com\/es\/wp-json\/wp\/v2\/tags?post=9995"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}