{"id":8914,"date":"2022-03-06T17:10:30","date_gmt":"2022-03-06T16:10:30","guid":{"rendered":"https:\/\/blog.capdata.fr\/?p=8914"},"modified":"2022-03-06T17:16:22","modified_gmt":"2022-03-06T16:16:22","slug":"comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived","status":"publish","type":"post","link":"https:\/\/blog.capdata.fr\/index.php\/comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived\/","title":{"rendered":"Comparatif des gestionnaires de VIP dans un cluster Patroni : \u00e9pisode 1 (KEEPALIVED)"},"content":{"rendered":"<a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fblog.capdata.fr%2Findex.php%2Fwp-json%2Fwp%2Fv2%2Fposts%2F8914&#038;text=Article%20sur%20le%20blog%20de%20la%20Capdata%20Tech%20Team%20%3A%20\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/blog.capdata.fr\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=https%3A%2F%2Fblog.capdata.fr%2Findex.php%2Fwp-json%2Fwp%2Fv2%2Fposts%2F8914&#038;title=Comparatif%20des%20gestionnaires%20de%20VIP%20dans%20un%20cluster%20Patroni%20%3A%20%C3%A9pisode%201%20%28KEEPALIVED%29\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/blog.capdata.fr\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=Comparatif%20des%20gestionnaires%20de%20VIP%20dans%20un%20cluster%20Patroni%20%3A%20%C3%A9pisode%201%20%28KEEPALIVED%29&#038;body=Article%20sur%20le%20blog%20de%20la%20Capdata%20Tech%20Team%20%3A%20:%20https%3A%2F%2Fblog.capdata.fr%2Findex.php%2Fwp-json%2Fwp%2Fv2%2Fposts%2F8914\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/blog.capdata.fr\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/mail.png\" \/><\/a><p>Hello \u00e0 toutes \/ tous, <\/p>\n<p>Suite \u00e0 <a href=\"https:\/\/blog.capdata.fr\/index.php\/haute-disponibilite-de-postgresql-avec-patroni\/\">l&#8217;article de Ludo sur Patroni<\/a>, cette semaine nous allons faire un comparatif des solutions de gestion de VIP dans un cluster. <\/p>\n<p>Car si Patroni g\u00e8re le d\u00e9ploiement et la supervision d&#8217;instances PostgreSQL dans un cluster actif \/ passif, il ne g\u00e8re pas les redirections de connexion en cas de bascule. Il faudra donc s&#8217;appuyer sur une solution tierce. On travaille toujours \u00e0 partir de conteneurs LXD, comme en t\u00e9moigneront les commandes. Si vous \u00eates en environnement on-prem, simplement ignorer les pr\u00e9fixes type <em>&#8216;lxc exec node &#8212; &#8230;&#8217;<\/em><\/p>\n<h2>KEEPALIVED:<\/h2>\n<p>C&#8217;est la solution la plus courante. Elle consiste \u00e0 d\u00e9marrer un service qui va cr\u00e9er une interface virtuelle en fonction de l&#8217;\u00e9tat d&#8217;une ressource (en l&#8217;occurrence ici un appel REST vers Patroni pour nous indiquer si le noeud local est le leader). <\/p>\n<p>En cas d&#8217;erreur sur le test, qui indiquerait que le service n&#8217;est pas joignable, <em>keepalived <\/em>tombe l&#8217;interface sur le noeud en \u00e9chec et la remonte sur le noeud survivant. Coupl\u00e9 \u00e0 Patroni, qui va g\u00e9rer le promote de l&#8217;instance standby, c&#8217;est un outil simple pour rediriger automatiquement les connexions. <\/p>\n<h3>Sch\u00e9ma:<\/h3>\n<p>On utilisera donc un cluster \u00e0 base de conteneurs LXD, \u00e0 3 noeuds pour le quorum ETCD. Patroni \/ PostgreSQL \/ Keepalived seront d\u00e9ploy\u00e9s sur les 2 premiers noeuds seulement.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.capdata.fr\/wp-content\/uploads\/2022\/03\/patroni_keepalived-1024x621.png\" alt=\"\" width=\"640\" height=\"388\" class=\"aligncenter size-large wp-image-8919\" srcset=\"https:\/\/blog.capdata.fr\/wp-content\/uploads\/2022\/03\/patroni_keepalived-1024x621.png 1024w, https:\/\/blog.capdata.fr\/wp-content\/uploads\/2022\/03\/patroni_keepalived-300x182.png 300w, https:\/\/blog.capdata.fr\/wp-content\/uploads\/2022\/03\/patroni_keepalived-768x466.png 768w, https:\/\/blog.capdata.fr\/wp-content\/uploads\/2022\/03\/patroni_keepalived.png 1119w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<h3>Installation et configuration de keepalived sur les 2 noeuds Patroni:<\/h3>\n<p>A faire sur pgpat1 et pgpat2:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@pgpat1:~# apt-get install -y keepalived curl\r\n# Bug https:\/\/bugs.debian.org\/cgi-bin\/bugreport.cgi?bug=878241\r\nroot@pgpat1:~# apt-get install -y libipset-dev\r\n<\/pre>\n<p>Le fichier de configuration par d\u00e9faut se trouvera sous <em>\/etc\/keepalived\/keepalived.conf<\/em>, il faudra le cr\u00e9er car il n&#8217;existe pas au pr\u00e9alable:<\/p>\n<p><strong>Sur pgpat1: <\/strong><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@pgpat1:~# vi \/etc\/keepalived\/keepalived.conf\r\nglobal_defs { \r\n  router_id pgpat1\r\n  enable_script_security\r\n  script_user root\r\n}\r\n\r\nvrrp_script whosprimary {\r\n  script &quot;\/usr\/bin\/curl -X GET -I --fail http:\/\/10.186.157.60:8008\/primary&quot;\r\n  user root\r\n}\r\n\r\nvrrp_instance PGPAT1 {\r\n  state MASTER\r\n  interface eth0\r\n  virtual_router_id 50\r\n  unicast_peer {\r\n    10.186.157.60\r\n    10.186.157.216\r\n  }\r\n  advert_int 1\r\n  authentication {\r\n    auth_type PASS\r\n    auth_pass ~bG7n)4?\r\n  }\r\n  virtual_ipaddress {\r\n    10.186.157.199\/24 dev eth0 label eth0:1\r\n  }\r\n  track_script {\r\n    whosprimary\r\n  }\r\n  no_accept\r\n}\r\n<\/pre>\n<p>Le script <em>whosprimary <\/em>effectuera la requ\u00eate en REST, et notre VIP portera l&#8217;adresse <strong>10.186.157.199<\/strong>. On red\u00e9marre le service \u00e0 l&#8217;issue:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@ubuntu20:~# lxc exec pgpat1 -- systemctl restart keepalived.service\r\nroot@ubuntu20:~# lxc exec pgpat1 -- systemctl status keepalived.service\r\n\u25cf keepalived.service - Keepalive Daemon (LVS and VRRP)\r\n   Loaded: loaded (\/lib\/systemd\/system\/keepalived.service; enabled; vendor preset: enabled)\r\n  Drop-In: \/run\/systemd\/system\/keepalived.service.d\r\n           \u2514\u2500zzz-lxc-service.conf\r\n   Active: active (running) since Sun 2022-03-06 14:50:49 UTC; 7min ago\r\n  Process: 338 ExecStart=\/usr\/sbin\/keepalived $DAEMON_ARGS (code=exited, status=0\/SUCCESS)\r\n Main PID: 346 (keepalived)\r\n    Tasks: 2 (limit: 4619)\r\n   CGroup: \/system.slice\/keepalived.service\r\n           \u251c\u2500346 \/usr\/sbin\/keepalived -P\r\n           \u2514\u2500347 \/usr\/sbin\/keepalived -P\r\n\r\n<\/pre>\n<p>On peut alors tester si la VIP est correctement mont\u00e9e sur le noeud pgpat1 et tester une connexion vers l&#8217;instance PostgreSQL:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@ubuntu20:~# lxc exec pgpat1 -- ip addr show | grep eth0:1\r\n    inet 10.186.157.199\/24 scope global secondary eth0:1\r\n\r\nroot@ubuntu20:~# psql -U postgres -h 10.186.157.199 \\ \r\n-p 5432 postgres -c &quot;\\conninfo&quot;\r\nPassword for user postgres: \r\nYou are connected to database &quot;postgres&quot; as user &quot;postgres&quot; \r\non host &quot;10.186.157.199&quot; at port &quot;5432&quot;.\r\n<\/pre>\n<p><strong>Sur pgpat2:<\/strong><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@pgpat2:~# vi \/etc\/keepalived\/keepalived.conf\r\n\r\nglobal_defs { \r\n  router_id pgpat2\r\n  enable_script_security\r\n  script_user root\r\n}\r\n\r\nvrrp_script whosprimary {\r\n  script &quot;\/usr\/bin\/curl -X GET -I --fail http:\/\/10.186.157.216:8008\/primary&quot;\r\n  user root\r\n}\r\n\r\nvrrp_instance PGPAT2 {\r\n  state MASTER\r\n  interface eth0\r\n  virtual_router_id 51\r\n  unicast_peer {\r\n    10.186.157.60\r\n    10.186.157.216\r\n  }\r\n  advert_int 1\r\n  authentication {\r\n    auth_type PASS\r\n    auth_pass ~bG7n)4?\r\n  }\r\n  virtual_ipaddress {\r\n    10.186.157.199\/24 dev eth0 label eth0:1\r\n  }\r\n  track_script {\r\n    whosprimary\r\n  }\r\n  no_accept\r\n}\r\n<\/pre>\n<p>Noter que <em>virtual_router_id<\/em> doit avoir un id unique sur la topologie. Puis m\u00eame chose on red\u00e9marre <em>keepalived <\/em>et on v\u00e9rifie qu&#8217;il se positionne bien en off:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@ubuntu20:~# lxc exec pgpat2 -- systemctl restart keepalived.service\r\nroot@ubuntu20:~# lxc exec pgpat2 -- systemctl status keepalived.service\r\n\u25cf keepalived.service - Keepalive Daemon (LVS and VRRP)\r\n   Loaded: loaded (\/lib\/systemd\/system\/keepalived.service; enabled; vendor preset: enabled)\r\n  Drop-In: \/run\/systemd\/system\/keepalived.service.d\r\n           \u2514\u2500zzz-lxc-service.conf\r\n   Active: active (running) since Sun 2022-03-06 14:56:10 UTC; 4min 8s ago\r\n  Process: 362 ExecStart=\/usr\/sbin\/keepalived $DAEMON_ARGS (code=exited, status=0\/SUCCESS)\r\n Main PID: 365 (keepalived)\r\n    Tasks: 3 (limit: 4619)\r\n   CGroup: \/system.slice\/keepalived.service\r\n           \u251c\u2500365 \/usr\/sbin\/keepalived\r\n           \u251c\u2500366 \/usr\/sbin\/keepalived\r\n           \u2514\u2500367 \/usr\/sbin\/keepalived\r\n\r\nMar 06 15:00:09 pgpat2 Keepalived_vrrp[367]: \/usr\/bin\/curl -X GET -I --fail http:\/\/10.186.157.216:8008\/primary exited with status 22\r\nMar 06 15:00:10 pgpat2 Keepalived_vrrp[367]: \/usr\/bin\/curl -X GET -I --fail http:\/\/10.186.157.216:8008\/primary exited with status 22\r\n(...)\r\n<\/pre>\n<p>Ok on voit bien que sur le noeud pgpat2 la r\u00e9ponse de l&#8217;api REST de Patroni est en \u00e9chec ce qui montre que l&#8217;instance PostgreSQL a bien le r\u00f4le standby. <\/p>\n<h3>Tests de d\u00e9faillance:<\/h3>\n<p>Pour v\u00e9rifier que la VIP bascule correctement, on utilisera deux \u00e0 trois fen\u00eatres XTERM:<br \/>\n&#8211; Une pour tomber et red\u00e9marrer le service Patroni noeud par noeud, et tester la connexion \u00e0 PostgreSQL via la VIP.<br \/>\n&#8211; Une pour observer les changements de VIP entre conteneurs avec <em>lxc list &#8230;<\/em><br \/>\n&#8211; Une avec un ping directement sur la VIP pour voir combien de hops sont perdus pendant la bascule.<\/p>\n<p><strong>Test 1 : arr\u00eat de Patroni sur le leader:<\/strong><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@ubuntu20:~# lxc exec pgpat1 -- systemctl stop patroni\r\n<\/pre>\n<p>Surveillance de la bascule:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@ubuntu20:~# watch lxc list pgpat\r\n\r\nEvery 2,0s: lxc list pgpat                                                                                                                                                                         \r\n\r\n+--------+---------+-------------------------+-----------------------------------------------+-----------+-----------+\r\n|  NAME  |  STATE  |          IPV4           |                     IPV6                      |   TYPE    | SNAPSHOTS |\r\n+--------+---------+-------------------------+-----------------------------------------------+-----------+-----------+\r\n| pgpat1 | RUNNING | 10.186.157.60 (eth0)    | fd42:a4e7:fd78:5160:216:3eff:feaf:c4a5 (eth0) | CONTAINER | 0         |\r\n|        |         | 10.186.157.199 (eth0:1) |                                               |           |           |\r\n+--------+---------+-------------------------+-----------------------------------------------+-----------+-----------+\r\n| pgpat2 | RUNNING | 10.186.157.216 (eth0)   | fd42:a4e7:fd78:5160:216:3eff:fe8c:9004 (eth0) | CONTAINER | 0         |\r\n+--------+---------+-------------------------+-----------------------------------------------+-----------+-----------+\r\n| pgpat3 | RUNNING | 10.186.157.3 (eth0)     | fd42:a4e7:fd78:5160:216:3eff:fe8c:fd27 (eth0) | CONTAINER | 0         |\r\n+--------+---------+-------------------------+-----------------------------------------------+-----------+-----------+\r\n(...)\r\nEvery 2,0s: lxc list pgpat                                                                                                                                                                         ubuntu20: Sun Mar  6 16:10:08 2022\r\n\r\n+--------+---------+-------------------------+-----------------------------------------------+-----------+-----------+\r\n|  NAME  |  STATE  |          IPV4           |                     IPV6                      |   TYPE    | SNAPSHOTS |\r\n+--------+---------+-------------------------+-----------------------------------------------+-----------+-----------+\r\n| pgpat1 | RUNNING | 10.186.157.60 (eth0)    | fd42:a4e7:fd78:5160:216:3eff:feaf:c4a5 (eth0) | CONTAINER | 0         |\r\n+--------+---------+-------------------------+-----------------------------------------------+-----------+-----------+\r\n| pgpat2 | RUNNING | 10.186.157.216 (eth0)   | fd42:a4e7:fd78:5160:216:3eff:fe8c:9004 (eth0) | CONTAINER | 0         |\r\n|        |         | 10.186.157.199 (eth0:1) |                                               |           |           |\r\n+--------+---------+-------------------------+-----------------------------------------------+-----------+-----------+\r\n| pgpat3 | RUNNING | 10.186.157.3 (eth0)     | fd42:a4e7:fd78:5160:216:3eff:fe8c:fd27 (eth0) | CONTAINER | 0         |\r\n+--------+---------+-------------------------+-----------------------------------------------+-----------+-----------+\r\n<\/pre>\n<p>Test de connexion depuis un client tiers:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@ubuntu20:~# psql -U postgres -h 10.186.157.199 -p 5432 postgres \\\r\n-c &quot;\\conninfo&quot;\r\nPassword for user postgres: \r\nYou are connected to database &quot;postgres&quot; as user &quot;postgres&quot; \r\non host &quot;10.186.157.199&quot; at port &quot;5432&quot;.\r\n<\/pre>\n<p><strong>Test 2 : Failback sur l&#8217;ancien primaire :<\/strong><br \/>\nRestart de Patroni sur pgpat1 et stop sur pgpat2 :<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@ubuntu20:~# lxc exec pgpat1 -- systemctl start patroni\r\nroot@ubuntu20:~# lxc exec pgpat2 -- systemctl stop patroni\r\n<\/pre>\n<p> Surveillance de la bascule:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@ubuntu20:~# watch lxc list pgpat\r\n\r\nubuntu20: Sun Mar  6 16:10:52 2022\r\n\r\n+--------+---------+-------------------------+-----------------------------------------------+-----------+-----------+\r\n|  NAME  |  STATE  |          IPV4           |                     IPV6                      |   TYPE    | SNAPSHOTS |\r\n+--------+---------+-------------------------+-----------------------------------------------+-----------+-----------+\r\n| pgpat1 | RUNNING | 10.186.157.60 (eth0)    | fd42:a4e7:fd78:5160:216:3eff:feaf:c4a5 (eth0) | CONTAINER | 0         |\r\n+--------+---------+-------------------------+-----------------------------------------------+-----------+-----------+\r\n| pgpat2 | RUNNING | 10.186.157.216 (eth0)   | fd42:a4e7:fd78:5160:216:3eff:fe8c:9004 (eth0) | CONTAINER | 0         |\r\n|        |         | 10.186.157.199 (eth0:1) |                                               |           |           |\r\n+--------+---------+-------------------------+-----------------------------------------------+-----------+-----------+\r\n| pgpat3 | RUNNING | 10.186.157.3 (eth0)     | fd42:a4e7:fd78:5160:216:3eff:fe8c:fd27 (eth0) | CONTAINER | 0         |\r\n+--------+---------+-------------------------+-----------------------------------------------+-----------+-----------+\r\n(...)\r\nEvery 2,0s: lxc list pgpat                                                                                                                                                                         ubuntu20: Sun Mar  6 16:10:56 2022\r\n\r\n+--------+---------+-------------------------+-----------------------------------------------+-----------+-----------+\r\n|  NAME  |  STATE  |          IPV4           |                     IPV6                      |   TYPE    | SNAPSHOTS |\r\n+--------+---------+-------------------------+-----------------------------------------------+-----------+-----------+\r\n| pgpat1 | RUNNING | 10.186.157.60 (eth0)    | fd42:a4e7:fd78:5160:216:3eff:feaf:c4a5 (eth0) | CONTAINER | 0         |\r\n|        |         | 10.186.157.199 (eth0:1) |                                               |           |           |\r\n+--------+---------+-------------------------+-----------------------------------------------+-----------+-----------+\r\n| pgpat2 | RUNNING | 10.186.157.216 (eth0)   | fd42:a4e7:fd78:5160:216:3eff:fe8c:9004 (eth0) | CONTAINER | 0         |\r\n+--------+---------+-------------------------+-----------------------------------------------+-----------+-----------+\r\n| pgpat3 | RUNNING | 10.186.157.3 (eth0)     | fd42:a4e7:fd78:5160:216:3eff:fe8c:fd27 (eth0) | CONTAINER | 0         |\r\n+--------+---------+-------------------------+-----------------------------------------------+-----------+-----------+\r\n<\/pre>\n<p>et test de connexion depuis un client tiers:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@ubuntu20:~# psql -U postgres -h 10.186.157.199 -p 5432 postgres \\\r\n-c &quot;\\conninfo&quot;\r\nPassword for user postgres: \r\nYou are connected to database &quot;postgres&quot; as user &quot;postgres&quot; \r\non host &quot;10.186.157.199&quot; at port &quot;5432&quot;.\r\n<\/pre>\n<p>Si on regarde les traces du ping sur la VIP pour observer le temps de bascule, on verra 2 \u00e0 3 hops perdus \u00e0 chaque fois, ce qui correspond \u00e0 environ 3 secondes d&#8217;interruption :<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@ubuntu20:~# ping -a 10.186.157.199\r\nPING 10.186.157.199 (10.186.157.199) 56(84) bytes of data.\r\n64 bytes from 10.186.157.199: icmp_seq=1 ttl=64 time=0.053 ms\r\n64 bytes from 10.186.157.199: icmp_seq=2 ttl=64 time=0.089 ms\r\n64 bytes from 10.186.157.199: icmp_seq=3 ttl=64 time=0.050 ms\r\n64 bytes from 10.186.157.199: icmp_seq=4 ttl=64 time=0.112 ms\r\n64 bytes from 10.186.157.199: icmp_seq=5 ttl=64 time=0.051 ms\r\nFrom 10.186.157.216 icmp_seq=6 Redirect Host(New nexthop: 199.157.186.10)\r\nFrom 10.186.157.60 icmp_seq=6 Redirect Host(New nexthop: 199.157.186.10)\r\nFrom 10.186.157.60 icmp_seq=6 Destination Host Unreachable\r\n64 bytes from 10.186.157.199: icmp_seq=10 ttl=64 time=1524 ms\r\n64 bytes from 10.186.157.199: icmp_seq=11 ttl=64 time=504 ms\r\n64 bytes from 10.186.157.199: icmp_seq=12 ttl=64 time=0.052 ms\r\n64 bytes from 10.186.157.199: icmp_seq=13 ttl=64 time=0.094 ms\r\n(...)\r\n<\/pre>\n<p>OK nous avons valid\u00e9 qu&#8217;en cas de perte du service Patroni, le cluster bascule et notre vip bascule correctement sur le nouveau primary. Je n&#8217;ai volontairement pas d\u00e9taill\u00e9 la partie Patroni, je vous renvoie sur l&#8217;article de Ludo cit\u00e9 au d\u00e9but. <\/p>\n<p>Prochain \u00e9pisode, nous verrons comment utiliser <a href=\"https:\/\/github.com\/cybertec-postgresql\/vip-manager\">vip-manager de Cybertec<\/a>, et le comparer \u00e0 <em>keepalived<\/em>. <\/p>\n<p><em>To be continued&#8230;<\/em>. Bonne fin de weekend, \u00e0+ <\/p>\n<a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fblog.capdata.fr%2Findex.php%2Fwp-json%2Fwp%2Fv2%2Fposts%2F8914&#038;text=Article%20sur%20le%20blog%20de%20la%20Capdata%20Tech%20Team%20%3A%20\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/blog.capdata.fr\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=https%3A%2F%2Fblog.capdata.fr%2Findex.php%2Fwp-json%2Fwp%2Fv2%2Fposts%2F8914&#038;title=Comparatif%20des%20gestionnaires%20de%20VIP%20dans%20un%20cluster%20Patroni%20%3A%20%C3%A9pisode%201%20%28KEEPALIVED%29\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/blog.capdata.fr\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=Comparatif%20des%20gestionnaires%20de%20VIP%20dans%20un%20cluster%20Patroni%20%3A%20%C3%A9pisode%201%20%28KEEPALIVED%29&#038;body=Article%20sur%20le%20blog%20de%20la%20Capdata%20Tech%20Team%20%3A%20:%20https%3A%2F%2Fblog.capdata.fr%2Findex.php%2Fwp-json%2Fwp%2Fv2%2Fposts%2F8914\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/blog.capdata.fr\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/mail.png\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>Hello \u00e0 toutes \/ tous, Suite \u00e0 l&#8217;article de Ludo sur Patroni, cette semaine nous allons faire un comparatif des solutions de gestion de VIP dans un cluster. Car si Patroni g\u00e8re le d\u00e9ploiement et la supervision d&#8217;instances PostgreSQL dans&hellip; <a href=\"https:\/\/blog.capdata.fr\/index.php\/comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived\/\" class=\"more-link\">Continuer la lecture <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":8920,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[383,266],"tags":[390,389,388],"class_list":["post-8914","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-container","category-postgresql","tag-keepalived","tag-patroni","tag-vip"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Comparatif des gestionnaires de VIP dans un cluster Patroni : \u00e9pisode 1 (KEEPALIVED) - Capdata TECH BLOG<\/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:\/\/blog.capdata.fr\/index.php\/comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Comparatif des gestionnaires de VIP dans un cluster Patroni : \u00e9pisode 1 (KEEPALIVED) - Capdata TECH BLOG\" \/>\n<meta property=\"og:description\" content=\"Hello \u00e0 toutes \/ tous, Suite \u00e0 l&#8217;article de Ludo sur Patroni, cette semaine nous allons faire un comparatif des solutions de gestion de VIP dans un cluster. Car si Patroni g\u00e8re le d\u00e9ploiement et la supervision d&#8217;instances PostgreSQL dans&hellip; Continuer la lecture &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.capdata.fr\/index.php\/comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived\/\" \/>\n<meta property=\"og:site_name\" content=\"Capdata TECH BLOG\" \/>\n<meta property=\"article:published_time\" content=\"2022-03-06T16:10:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-03-06T16:16:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.capdata.fr\/wp-content\/uploads\/2022\/03\/auguillage.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"612\" \/>\n\t<meta property=\"og:image:height\" content=\"408\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"David Baffaleuf\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u00c9crit par\" \/>\n\t<meta name=\"twitter:data1\" content=\"David Baffaleuf\" \/>\n\t<meta name=\"twitter:label2\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/blog.capdata.fr\/index.php\/comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/blog.capdata.fr\/index.php\/comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived\/\"},\"author\":{\"name\":\"David Baffaleuf\",\"@id\":\"https:\/\/blog.capdata.fr\/#\/schema\/person\/136297da9f61d6e4878abe0f48bc5fbf\"},\"headline\":\"Comparatif des gestionnaires de VIP dans un cluster Patroni : \u00e9pisode 1 (KEEPALIVED)\",\"datePublished\":\"2022-03-06T16:10:30+00:00\",\"dateModified\":\"2022-03-06T16:16:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/blog.capdata.fr\/index.php\/comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived\/\"},\"wordCount\":1558,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/blog.capdata.fr\/#organization\"},\"keywords\":[\"keepalived\",\"patroni\",\"vip\"],\"articleSection\":[\"Container\",\"PostgreSQL\"],\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/blog.capdata.fr\/index.php\/comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.capdata.fr\/index.php\/comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived\/\",\"url\":\"https:\/\/blog.capdata.fr\/index.php\/comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived\/\",\"name\":\"Comparatif des gestionnaires de VIP dans un cluster Patroni : \u00e9pisode 1 (KEEPALIVED) - Capdata TECH BLOG\",\"isPartOf\":{\"@id\":\"https:\/\/blog.capdata.fr\/#website\"},\"datePublished\":\"2022-03-06T16:10:30+00:00\",\"dateModified\":\"2022-03-06T16:16:22+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/blog.capdata.fr\/index.php\/comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.capdata.fr\/index.php\/comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.capdata.fr\/index.php\/comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/blog.capdata.fr\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Comparatif des gestionnaires de VIP dans un cluster Patroni : \u00e9pisode 1 (KEEPALIVED)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.capdata.fr\/#website\",\"url\":\"https:\/\/blog.capdata.fr\/\",\"name\":\"Capdata TECH BLOG\",\"description\":\"Le blog technique sur les bases de donn\u00e9es de CAP DATA Consulting\",\"publisher\":{\"@id\":\"https:\/\/blog.capdata.fr\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.capdata.fr\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/blog.capdata.fr\/#organization\",\"name\":\"Capdata TECH BLOG\",\"url\":\"https:\/\/blog.capdata.fr\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\/\/blog.capdata.fr\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/blog.capdata.fr\/wp-content\/uploads\/2023\/01\/logo_capdata.webp\",\"contentUrl\":\"https:\/\/blog.capdata.fr\/wp-content\/uploads\/2023\/01\/logo_capdata.webp\",\"width\":800,\"height\":254,\"caption\":\"Capdata TECH BLOG\"},\"image\":{\"@id\":\"https:\/\/blog.capdata.fr\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/cap-data-consulting\/mycompany\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/blog.capdata.fr\/#\/schema\/person\/136297da9f61d6e4878abe0f48bc5fbf\",\"name\":\"David Baffaleuf\",\"sameAs\":[\"http:\/\/www.capdata.fr\"],\"url\":\"https:\/\/blog.capdata.fr\/index.php\/author\/dbaffaleuf\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Comparatif des gestionnaires de VIP dans un cluster Patroni : \u00e9pisode 1 (KEEPALIVED) - Capdata TECH BLOG","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:\/\/blog.capdata.fr\/index.php\/comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived\/","og_locale":"fr_FR","og_type":"article","og_title":"Comparatif des gestionnaires de VIP dans un cluster Patroni : \u00e9pisode 1 (KEEPALIVED) - Capdata TECH BLOG","og_description":"Hello \u00e0 toutes \/ tous, Suite \u00e0 l&#8217;article de Ludo sur Patroni, cette semaine nous allons faire un comparatif des solutions de gestion de VIP dans un cluster. Car si Patroni g\u00e8re le d\u00e9ploiement et la supervision d&#8217;instances PostgreSQL dans&hellip; Continuer la lecture &rarr;","og_url":"https:\/\/blog.capdata.fr\/index.php\/comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived\/","og_site_name":"Capdata TECH BLOG","article_published_time":"2022-03-06T16:10:30+00:00","article_modified_time":"2022-03-06T16:16:22+00:00","og_image":[{"width":612,"height":408,"url":"https:\/\/blog.capdata.fr\/wp-content\/uploads\/2022\/03\/auguillage.jpg","type":"image\/jpeg"}],"author":"David Baffaleuf","twitter_card":"summary_large_image","twitter_misc":{"\u00c9crit par":"David Baffaleuf","Dur\u00e9e de lecture estim\u00e9e":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.capdata.fr\/index.php\/comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived\/#article","isPartOf":{"@id":"https:\/\/blog.capdata.fr\/index.php\/comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived\/"},"author":{"name":"David Baffaleuf","@id":"https:\/\/blog.capdata.fr\/#\/schema\/person\/136297da9f61d6e4878abe0f48bc5fbf"},"headline":"Comparatif des gestionnaires de VIP dans un cluster Patroni : \u00e9pisode 1 (KEEPALIVED)","datePublished":"2022-03-06T16:10:30+00:00","dateModified":"2022-03-06T16:16:22+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.capdata.fr\/index.php\/comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived\/"},"wordCount":1558,"commentCount":0,"publisher":{"@id":"https:\/\/blog.capdata.fr\/#organization"},"keywords":["keepalived","patroni","vip"],"articleSection":["Container","PostgreSQL"],"inLanguage":"fr-FR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.capdata.fr\/index.php\/comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.capdata.fr\/index.php\/comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived\/","url":"https:\/\/blog.capdata.fr\/index.php\/comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived\/","name":"Comparatif des gestionnaires de VIP dans un cluster Patroni : \u00e9pisode 1 (KEEPALIVED) - Capdata TECH BLOG","isPartOf":{"@id":"https:\/\/blog.capdata.fr\/#website"},"datePublished":"2022-03-06T16:10:30+00:00","dateModified":"2022-03-06T16:16:22+00:00","breadcrumb":{"@id":"https:\/\/blog.capdata.fr\/index.php\/comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.capdata.fr\/index.php\/comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.capdata.fr\/index.php\/comparatif-des-gestionnaires-de-vip-dans-un-cluster-patroni-episode-1-keepalived\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/blog.capdata.fr\/"},{"@type":"ListItem","position":2,"name":"Comparatif des gestionnaires de VIP dans un cluster Patroni : \u00e9pisode 1 (KEEPALIVED)"}]},{"@type":"WebSite","@id":"https:\/\/blog.capdata.fr\/#website","url":"https:\/\/blog.capdata.fr\/","name":"Capdata TECH BLOG","description":"Le blog technique sur les bases de donn\u00e9es de CAP DATA Consulting","publisher":{"@id":"https:\/\/blog.capdata.fr\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.capdata.fr\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"fr-FR"},{"@type":"Organization","@id":"https:\/\/blog.capdata.fr\/#organization","name":"Capdata TECH BLOG","url":"https:\/\/blog.capdata.fr\/","logo":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/blog.capdata.fr\/#\/schema\/logo\/image\/","url":"https:\/\/blog.capdata.fr\/wp-content\/uploads\/2023\/01\/logo_capdata.webp","contentUrl":"https:\/\/blog.capdata.fr\/wp-content\/uploads\/2023\/01\/logo_capdata.webp","width":800,"height":254,"caption":"Capdata TECH BLOG"},"image":{"@id":"https:\/\/blog.capdata.fr\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.linkedin.com\/company\/cap-data-consulting\/mycompany\/"]},{"@type":"Person","@id":"https:\/\/blog.capdata.fr\/#\/schema\/person\/136297da9f61d6e4878abe0f48bc5fbf","name":"David Baffaleuf","sameAs":["http:\/\/www.capdata.fr"],"url":"https:\/\/blog.capdata.fr\/index.php\/author\/dbaffaleuf\/"}]}},"_links":{"self":[{"href":"https:\/\/blog.capdata.fr\/index.php\/wp-json\/wp\/v2\/posts\/8914","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capdata.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capdata.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capdata.fr\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capdata.fr\/index.php\/wp-json\/wp\/v2\/comments?post=8914"}],"version-history":[{"count":12,"href":"https:\/\/blog.capdata.fr\/index.php\/wp-json\/wp\/v2\/posts\/8914\/revisions"}],"predecessor-version":[{"id":8929,"href":"https:\/\/blog.capdata.fr\/index.php\/wp-json\/wp\/v2\/posts\/8914\/revisions\/8929"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capdata.fr\/index.php\/wp-json\/wp\/v2\/media\/8920"}],"wp:attachment":[{"href":"https:\/\/blog.capdata.fr\/index.php\/wp-json\/wp\/v2\/media?parent=8914"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capdata.fr\/index.php\/wp-json\/wp\/v2\/categories?post=8914"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capdata.fr\/index.php\/wp-json\/wp\/v2\/tags?post=8914"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}