Unable to install Postgres extension pg_prometheus and prometheus-postgresql-adapter manually on CentOS












0















I am trying to setup Prometheus with PostgreSQL DB on a CentOS server. I am able to install Prometheus and PostgreSQL on the server but unable to install pg_prometheus extension and the prometheus-postgresql-adapter.



Need help to manually install pg_prometheus extension and prometheus-postgresql-adapter on CentOS?



I am aware that there are Docker images from TimescaleDB for this but I am trying to avoid using Docker for my proof-of-concept, at least for now.










share|improve this question





























    0















    I am trying to setup Prometheus with PostgreSQL DB on a CentOS server. I am able to install Prometheus and PostgreSQL on the server but unable to install pg_prometheus extension and the prometheus-postgresql-adapter.



    Need help to manually install pg_prometheus extension and prometheus-postgresql-adapter on CentOS?



    I am aware that there are Docker images from TimescaleDB for this but I am trying to avoid using Docker for my proof-of-concept, at least for now.










    share|improve this question



























      0












      0








      0








      I am trying to setup Prometheus with PostgreSQL DB on a CentOS server. I am able to install Prometheus and PostgreSQL on the server but unable to install pg_prometheus extension and the prometheus-postgresql-adapter.



      Need help to manually install pg_prometheus extension and prometheus-postgresql-adapter on CentOS?



      I am aware that there are Docker images from TimescaleDB for this but I am trying to avoid using Docker for my proof-of-concept, at least for now.










      share|improve this question
















      I am trying to setup Prometheus with PostgreSQL DB on a CentOS server. I am able to install Prometheus and PostgreSQL on the server but unable to install pg_prometheus extension and the prometheus-postgresql-adapter.



      Need help to manually install pg_prometheus extension and prometheus-postgresql-adapter on CentOS?



      I am aware that there are Docker images from TimescaleDB for this but I am trying to avoid using Docker for my proof-of-concept, at least for now.







      linux centos centos-7 postgresql






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 29 '18 at 7:41









      Mureinik

      2,36561625




      2,36561625










      asked Dec 28 '18 at 23:47









      GdcrocxGdcrocx

      13




      13






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Install PostgreSQL on CentOS



          Download the PostgreSQL Global Development Group RPM for CentOS x86-64



          wget https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm



          Run the PGDG RPM package



          sudo yum install pgdg-centos10-10-2.noarch.rpm



          Install and Setup PostgreSQL Server and all its components



          sudo yum install postgresql10-server.x86_64 postgresql10-contrib.x86_64 postgresql10-devel.x86_64 postgresql10.x86_64



          sudo /usr/pgsql-10/bin/postgresql-10-setup initdb



          sudo systemctl start postgresql-10



          sudo systemctl enable postgresql-10



          Secure your Postgres Environment on CentOS



          sudo passwd postgres (Enter a New Password)



          su - postgres



          psql -c "ALTER USER postgres WITH PASSWORD '<Your-New-Password>';"



          Change listen_addresses to listen_addresses = '*' in /var/lib/pgsql/10/data/postgresql.conf



          Change local all all peer to host all all 0.0.0.0/0 trust in /var/lib/pgsql/10/data/pg_hba.conf



          Restart the PostgreSQL Service with systemctl restart postgresql-10.service



          Check CentOS Firewall Rules to allow remote connection to PostgreSQL DB



          sudo firewall-cmd --get-active-zones




          sudo firewall-cmd --zone=public --add-port=5432/tcp --permanent




          sudo firewall-cmd --zone=public --add-port=8088/tcp --permanent




          sudo firewall-cmd --zone=public --add-port=8089/tcp --permanent



          sudo firewall-cmd --reload



          Install Prometheus



          Download Prometheus fof Linux amd-64



          wget https://github.com/prometheus/prometheus/releases/download/v2.6.0/prometheus-2.6.0.linux-amd64.tar.gz



          tar xvzf prometheus-2.6.0.linux-amd64.tar.gz



          cd prometheus-2.6.0.linux-amd64



          Update config for Prometheus



          vi prometheus.yml (job_name: 'prometheus', target: [':8088'])



          Run Prometheus



          nohup ./prometheus --config.file="prometheus.yml" --web.listen-address="0.0.0.0:8088" &



          Install pg_prometheus PostgreSQL Extension



          export PATH=$PATH:/usr/pgsql-10/bin



          git clone https://github.com/timescale/pg_prometheus.git



          cd pg_prometheus



          make



          make install



          Prometheus Storage Adapter



          Download the pre-built binary for Linux amd-64



          wget https://github.com/timescale/prometheus-postgresql-adapter/releases/download/0.4.1/prometheus-postgresql-adapter-0.4.1-linux-amd64.tar.gz



          tar xvzf prometheus-postgresql-adapter-0.4.1-linux-amd64.tar.gz



          Run the Prometheus Storage Adapter



          ./prometheus-postgresql-adapter -pg.host "<Your-IP-Address>" -pg.port "5432" -pg.user "postgres" -pg.password "1Password2" -pg.database "<Your-DB-Name>" -pg.schema "dbo" -pg.table "<Your-Table-Name>" -web.listen-address "172.16.152.29:8089" -log.level "debug" -pg.prometheus-log-samples -pg.read-only






          share|improve this answer

























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1388611%2funable-to-install-postgres-extension-pg-prometheus-and-prometheus-postgresql-ada%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Install PostgreSQL on CentOS



            Download the PostgreSQL Global Development Group RPM for CentOS x86-64



            wget https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm



            Run the PGDG RPM package



            sudo yum install pgdg-centos10-10-2.noarch.rpm



            Install and Setup PostgreSQL Server and all its components



            sudo yum install postgresql10-server.x86_64 postgresql10-contrib.x86_64 postgresql10-devel.x86_64 postgresql10.x86_64



            sudo /usr/pgsql-10/bin/postgresql-10-setup initdb



            sudo systemctl start postgresql-10



            sudo systemctl enable postgresql-10



            Secure your Postgres Environment on CentOS



            sudo passwd postgres (Enter a New Password)



            su - postgres



            psql -c "ALTER USER postgres WITH PASSWORD '<Your-New-Password>';"



            Change listen_addresses to listen_addresses = '*' in /var/lib/pgsql/10/data/postgresql.conf



            Change local all all peer to host all all 0.0.0.0/0 trust in /var/lib/pgsql/10/data/pg_hba.conf



            Restart the PostgreSQL Service with systemctl restart postgresql-10.service



            Check CentOS Firewall Rules to allow remote connection to PostgreSQL DB



            sudo firewall-cmd --get-active-zones




            sudo firewall-cmd --zone=public --add-port=5432/tcp --permanent




            sudo firewall-cmd --zone=public --add-port=8088/tcp --permanent




            sudo firewall-cmd --zone=public --add-port=8089/tcp --permanent



            sudo firewall-cmd --reload



            Install Prometheus



            Download Prometheus fof Linux amd-64



            wget https://github.com/prometheus/prometheus/releases/download/v2.6.0/prometheus-2.6.0.linux-amd64.tar.gz



            tar xvzf prometheus-2.6.0.linux-amd64.tar.gz



            cd prometheus-2.6.0.linux-amd64



            Update config for Prometheus



            vi prometheus.yml (job_name: 'prometheus', target: [':8088'])



            Run Prometheus



            nohup ./prometheus --config.file="prometheus.yml" --web.listen-address="0.0.0.0:8088" &



            Install pg_prometheus PostgreSQL Extension



            export PATH=$PATH:/usr/pgsql-10/bin



            git clone https://github.com/timescale/pg_prometheus.git



            cd pg_prometheus



            make



            make install



            Prometheus Storage Adapter



            Download the pre-built binary for Linux amd-64



            wget https://github.com/timescale/prometheus-postgresql-adapter/releases/download/0.4.1/prometheus-postgresql-adapter-0.4.1-linux-amd64.tar.gz



            tar xvzf prometheus-postgresql-adapter-0.4.1-linux-amd64.tar.gz



            Run the Prometheus Storage Adapter



            ./prometheus-postgresql-adapter -pg.host "<Your-IP-Address>" -pg.port "5432" -pg.user "postgres" -pg.password "1Password2" -pg.database "<Your-DB-Name>" -pg.schema "dbo" -pg.table "<Your-Table-Name>" -web.listen-address "172.16.152.29:8089" -log.level "debug" -pg.prometheus-log-samples -pg.read-only






            share|improve this answer






























              0














              Install PostgreSQL on CentOS



              Download the PostgreSQL Global Development Group RPM for CentOS x86-64



              wget https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm



              Run the PGDG RPM package



              sudo yum install pgdg-centos10-10-2.noarch.rpm



              Install and Setup PostgreSQL Server and all its components



              sudo yum install postgresql10-server.x86_64 postgresql10-contrib.x86_64 postgresql10-devel.x86_64 postgresql10.x86_64



              sudo /usr/pgsql-10/bin/postgresql-10-setup initdb



              sudo systemctl start postgresql-10



              sudo systemctl enable postgresql-10



              Secure your Postgres Environment on CentOS



              sudo passwd postgres (Enter a New Password)



              su - postgres



              psql -c "ALTER USER postgres WITH PASSWORD '<Your-New-Password>';"



              Change listen_addresses to listen_addresses = '*' in /var/lib/pgsql/10/data/postgresql.conf



              Change local all all peer to host all all 0.0.0.0/0 trust in /var/lib/pgsql/10/data/pg_hba.conf



              Restart the PostgreSQL Service with systemctl restart postgresql-10.service



              Check CentOS Firewall Rules to allow remote connection to PostgreSQL DB



              sudo firewall-cmd --get-active-zones




              sudo firewall-cmd --zone=public --add-port=5432/tcp --permanent




              sudo firewall-cmd --zone=public --add-port=8088/tcp --permanent




              sudo firewall-cmd --zone=public --add-port=8089/tcp --permanent



              sudo firewall-cmd --reload



              Install Prometheus



              Download Prometheus fof Linux amd-64



              wget https://github.com/prometheus/prometheus/releases/download/v2.6.0/prometheus-2.6.0.linux-amd64.tar.gz



              tar xvzf prometheus-2.6.0.linux-amd64.tar.gz



              cd prometheus-2.6.0.linux-amd64



              Update config for Prometheus



              vi prometheus.yml (job_name: 'prometheus', target: [':8088'])



              Run Prometheus



              nohup ./prometheus --config.file="prometheus.yml" --web.listen-address="0.0.0.0:8088" &



              Install pg_prometheus PostgreSQL Extension



              export PATH=$PATH:/usr/pgsql-10/bin



              git clone https://github.com/timescale/pg_prometheus.git



              cd pg_prometheus



              make



              make install



              Prometheus Storage Adapter



              Download the pre-built binary for Linux amd-64



              wget https://github.com/timescale/prometheus-postgresql-adapter/releases/download/0.4.1/prometheus-postgresql-adapter-0.4.1-linux-amd64.tar.gz



              tar xvzf prometheus-postgresql-adapter-0.4.1-linux-amd64.tar.gz



              Run the Prometheus Storage Adapter



              ./prometheus-postgresql-adapter -pg.host "<Your-IP-Address>" -pg.port "5432" -pg.user "postgres" -pg.password "1Password2" -pg.database "<Your-DB-Name>" -pg.schema "dbo" -pg.table "<Your-Table-Name>" -web.listen-address "172.16.152.29:8089" -log.level "debug" -pg.prometheus-log-samples -pg.read-only






              share|improve this answer




























                0












                0








                0







                Install PostgreSQL on CentOS



                Download the PostgreSQL Global Development Group RPM for CentOS x86-64



                wget https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm



                Run the PGDG RPM package



                sudo yum install pgdg-centos10-10-2.noarch.rpm



                Install and Setup PostgreSQL Server and all its components



                sudo yum install postgresql10-server.x86_64 postgresql10-contrib.x86_64 postgresql10-devel.x86_64 postgresql10.x86_64



                sudo /usr/pgsql-10/bin/postgresql-10-setup initdb



                sudo systemctl start postgresql-10



                sudo systemctl enable postgresql-10



                Secure your Postgres Environment on CentOS



                sudo passwd postgres (Enter a New Password)



                su - postgres



                psql -c "ALTER USER postgres WITH PASSWORD '<Your-New-Password>';"



                Change listen_addresses to listen_addresses = '*' in /var/lib/pgsql/10/data/postgresql.conf



                Change local all all peer to host all all 0.0.0.0/0 trust in /var/lib/pgsql/10/data/pg_hba.conf



                Restart the PostgreSQL Service with systemctl restart postgresql-10.service



                Check CentOS Firewall Rules to allow remote connection to PostgreSQL DB



                sudo firewall-cmd --get-active-zones




                sudo firewall-cmd --zone=public --add-port=5432/tcp --permanent




                sudo firewall-cmd --zone=public --add-port=8088/tcp --permanent




                sudo firewall-cmd --zone=public --add-port=8089/tcp --permanent



                sudo firewall-cmd --reload



                Install Prometheus



                Download Prometheus fof Linux amd-64



                wget https://github.com/prometheus/prometheus/releases/download/v2.6.0/prometheus-2.6.0.linux-amd64.tar.gz



                tar xvzf prometheus-2.6.0.linux-amd64.tar.gz



                cd prometheus-2.6.0.linux-amd64



                Update config for Prometheus



                vi prometheus.yml (job_name: 'prometheus', target: [':8088'])



                Run Prometheus



                nohup ./prometheus --config.file="prometheus.yml" --web.listen-address="0.0.0.0:8088" &



                Install pg_prometheus PostgreSQL Extension



                export PATH=$PATH:/usr/pgsql-10/bin



                git clone https://github.com/timescale/pg_prometheus.git



                cd pg_prometheus



                make



                make install



                Prometheus Storage Adapter



                Download the pre-built binary for Linux amd-64



                wget https://github.com/timescale/prometheus-postgresql-adapter/releases/download/0.4.1/prometheus-postgresql-adapter-0.4.1-linux-amd64.tar.gz



                tar xvzf prometheus-postgresql-adapter-0.4.1-linux-amd64.tar.gz



                Run the Prometheus Storage Adapter



                ./prometheus-postgresql-adapter -pg.host "<Your-IP-Address>" -pg.port "5432" -pg.user "postgres" -pg.password "1Password2" -pg.database "<Your-DB-Name>" -pg.schema "dbo" -pg.table "<Your-Table-Name>" -web.listen-address "172.16.152.29:8089" -log.level "debug" -pg.prometheus-log-samples -pg.read-only






                share|improve this answer















                Install PostgreSQL on CentOS



                Download the PostgreSQL Global Development Group RPM for CentOS x86-64



                wget https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm



                Run the PGDG RPM package



                sudo yum install pgdg-centos10-10-2.noarch.rpm



                Install and Setup PostgreSQL Server and all its components



                sudo yum install postgresql10-server.x86_64 postgresql10-contrib.x86_64 postgresql10-devel.x86_64 postgresql10.x86_64



                sudo /usr/pgsql-10/bin/postgresql-10-setup initdb



                sudo systemctl start postgresql-10



                sudo systemctl enable postgresql-10



                Secure your Postgres Environment on CentOS



                sudo passwd postgres (Enter a New Password)



                su - postgres



                psql -c "ALTER USER postgres WITH PASSWORD '<Your-New-Password>';"



                Change listen_addresses to listen_addresses = '*' in /var/lib/pgsql/10/data/postgresql.conf



                Change local all all peer to host all all 0.0.0.0/0 trust in /var/lib/pgsql/10/data/pg_hba.conf



                Restart the PostgreSQL Service with systemctl restart postgresql-10.service



                Check CentOS Firewall Rules to allow remote connection to PostgreSQL DB



                sudo firewall-cmd --get-active-zones




                sudo firewall-cmd --zone=public --add-port=5432/tcp --permanent




                sudo firewall-cmd --zone=public --add-port=8088/tcp --permanent




                sudo firewall-cmd --zone=public --add-port=8089/tcp --permanent



                sudo firewall-cmd --reload



                Install Prometheus



                Download Prometheus fof Linux amd-64



                wget https://github.com/prometheus/prometheus/releases/download/v2.6.0/prometheus-2.6.0.linux-amd64.tar.gz



                tar xvzf prometheus-2.6.0.linux-amd64.tar.gz



                cd prometheus-2.6.0.linux-amd64



                Update config for Prometheus



                vi prometheus.yml (job_name: 'prometheus', target: [':8088'])



                Run Prometheus



                nohup ./prometheus --config.file="prometheus.yml" --web.listen-address="0.0.0.0:8088" &



                Install pg_prometheus PostgreSQL Extension



                export PATH=$PATH:/usr/pgsql-10/bin



                git clone https://github.com/timescale/pg_prometheus.git



                cd pg_prometheus



                make



                make install



                Prometheus Storage Adapter



                Download the pre-built binary for Linux amd-64



                wget https://github.com/timescale/prometheus-postgresql-adapter/releases/download/0.4.1/prometheus-postgresql-adapter-0.4.1-linux-amd64.tar.gz



                tar xvzf prometheus-postgresql-adapter-0.4.1-linux-amd64.tar.gz



                Run the Prometheus Storage Adapter



                ./prometheus-postgresql-adapter -pg.host "<Your-IP-Address>" -pg.port "5432" -pg.user "postgres" -pg.password "1Password2" -pg.database "<Your-DB-Name>" -pg.schema "dbo" -pg.table "<Your-Table-Name>" -web.listen-address "172.16.152.29:8089" -log.level "debug" -pg.prometheus-log-samples -pg.read-only







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Jan 4 at 2:45

























                answered Dec 29 '18 at 4:53









                GdcrocxGdcrocx

                13




                13






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Super User!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1388611%2funable-to-install-postgres-extension-pg-prometheus-and-prometheus-postgresql-ada%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    How to make a Squid Proxy server?

                    Is this a new Fibonacci Identity?

                    19世紀