{"id":1533,"date":"2024-10-16T05:51:17","date_gmt":"2024-10-16T05:51:17","guid":{"rendered":"https:\/\/craftcookcode.com\/?p=1533"},"modified":"2024-10-16T05:51:17","modified_gmt":"2024-10-16T05:51:17","slug":"docker-qlik-replicate-and-postres-stitching-them-together","status":"publish","type":"post","link":"https:\/\/craftcookcode.com\/?p=1533","title":{"rendered":"Docker, Qlik Replicate and Postres &#8211; stitching them together"},"content":{"rendered":"\n<p>So far &#8211; what do we have?<\/p>\n\n\n\n<p>We have:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/craftcookcode.com\/?p=1424\" title=\"\">Postges working in a docker container<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/craftcookcode.com\/?p=1507\" target=\"_blank\" rel=\"noopener\" title=\"\">Qlik Replicate working in a docker container<\/a><\/li>\n<\/ol>\n\n\n\n<p>Let&#8217;s see if we can get them talking to each other<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Working on Postgres Config files<\/h2>\n\n\n\n<p>First modification is needed is to the postgresql.conf for the postgres docker image.  If you were following the docker-compose.yml in my previous post; you can find the file under:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n~\/apps\/postgres-plv8\/postgresql.conf\n<\/pre><\/div>\n\n\n<p>The following changes need to be made in postgresql.conf as found in the <a href=\"https:\/\/help.qlik.com\/en-US\/replicate\/November2023\/Content\/Replicate\/Main\/PostgreSQL\/prereq_postgresql_source.htm#anchor-2\" target=\"_blank\" rel=\"noopener\" title=\"\">Qlik documentation<\/a><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nwal_level = logical\nmax_replication_slots = 3       # max number of replication slots\n<\/pre><\/div>\n\n\n<p>Now to added the following lines to <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n~\/apps\/postgres-plv8\/pg_hba.conf\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# Allow replication connections from localhost, by a user with the\n# replication privilege.\nlocal   replication     all                                     trust\nhost    replication     all             127.0.0.1\/32            trust\nhost    replication     all             ::1\/128                 trust\n<\/pre><\/div>\n\n\n<p>Once done &#8211; the docker container needs to be restarted for the changes to take effect.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Setting up QR<\/h2>\n\n\n\n<p>Log into QR using the address:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:&#47;&#47;127.0.0.1:3552\/attunityreplicate<\/code><\/pre>\n\n\n\n<p>Create a new postgres connection<\/p>\n\n\n\n<p>Fill out the following fields:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Field <\/strong><\/td><td><strong>Value<\/strong><\/td><\/tr><tr><td>Server<\/td><td>host.docker.internal<\/td><\/tr><tr><td>Port<\/td><td>9432<\/td><\/tr><tr><td>Username<\/td><td>Username from the docker-compose.yml file for postgres<\/td><\/tr><tr><td>Password<\/td><td>Password from the docker-compose.yml for postgres<\/td><\/tr><tr><td>Database<\/td><td>Database from docker-compose.yml for postgres<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"963\" src=\"https:\/\/craftcookcode.com\/wp-content\/uploads\/2024\/10\/code_docker_connection-1024x963.png\" alt=\"\" class=\"wp-image-1546\" srcset=\"https:\/\/craftcookcode.com\/wp-content\/uploads\/2024\/10\/code_docker_connection-1024x963.png 1024w, https:\/\/craftcookcode.com\/wp-content\/uploads\/2024\/10\/code_docker_connection-300x282.png 300w, https:\/\/craftcookcode.com\/wp-content\/uploads\/2024\/10\/code_docker_connection-768x722.png 768w, https:\/\/craftcookcode.com\/wp-content\/uploads\/2024\/10\/code_docker_connection.png 1440w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>From here a QR task can be built to read from the postgres database<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"489\" src=\"https:\/\/craftcookcode.com\/wp-content\/uploads\/2024\/10\/code_docker_connection_02-1024x489.png\" alt=\"\" class=\"wp-image-1547\" srcset=\"https:\/\/craftcookcode.com\/wp-content\/uploads\/2024\/10\/code_docker_connection_02-1024x489.png 1024w, https:\/\/craftcookcode.com\/wp-content\/uploads\/2024\/10\/code_docker_connection_02-300x143.png 300w, https:\/\/craftcookcode.com\/wp-content\/uploads\/2024\/10\/code_docker_connection_02-768x367.png 768w, https:\/\/craftcookcode.com\/wp-content\/uploads\/2024\/10\/code_docker_connection_02-1536x734.png 1536w, https:\/\/craftcookcode.com\/wp-content\/uploads\/2024\/10\/code_docker_connection_02-2048x979.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>So far &#8211; what do we have? We have: Let&#8217;s see if we can get them talking to each other Working on Postgres Config files First&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[68,64,16],"tags":[],"class_list":["post-1533","post","type-post","status-publish","format-standard","hentry","category-docker","category-postgres","category-qlik-replicate"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/craftcookcode.com\/index.php?rest_route=\/wp\/v2\/posts\/1533","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/craftcookcode.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/craftcookcode.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/craftcookcode.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/craftcookcode.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1533"}],"version-history":[{"count":6,"href":"https:\/\/craftcookcode.com\/index.php?rest_route=\/wp\/v2\/posts\/1533\/revisions"}],"predecessor-version":[{"id":1548,"href":"https:\/\/craftcookcode.com\/index.php?rest_route=\/wp\/v2\/posts\/1533\/revisions\/1548"}],"wp:attachment":[{"href":"https:\/\/craftcookcode.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/craftcookcode.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1533"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/craftcookcode.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}