# Correct flags to register a node

**URL:** <https://forums.percona.com/t/correct-flags-to-register-a-node/10435>\
**Category:** PMM 2.x\
**Created:** [May 12, 2021, 4:34pm UTC](https://forums.percona.com/t/correct-flags-to-register-a-node/10435 "2021-05-12T16:34:16Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![AND](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/and/32/3452_2.png) [@AND](https://forums.percona.com/u/AND)\
**Post date:** [May 12, 2021, 4:34pm UTC](https://forums.percona.com/t/correct-flags-to-register-a-node/10435/1 "2021-05-12T16:34:16Z")

</div>

Hello.  
I’m trying to deploy a Percona server in a brand new project, but I’m getting a problem with the node registry.

I’ve deploy pmm-server in a docker. Then registered a node with `sudo pmm-admin config --server-insecure-tls --server-url=https://admin:admin@127.0.0.1:443`. I’ve installed the pmm-client at same machine that is my docker server.

When I add a new postgre to get metrics, the “Home” dashboard shows a new “DB instance monitored”. The number get increased.  
But I just cant find the postgre in any node overview, the new service donst appear in service dropdown at postgres summary page.

I follow the docs to deploy everything. Is there some mistake?

---

<div class="post-metadata">

**Author:** ![Vadim\_Yalovets](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vadim_yalovets/32/43_2.png) [@Vadim\_Yalovets](https://forums.percona.com/u/Vadim_Yalovets)\
**Post date:** [May 12, 2021, 4:54pm UTC](https://forums.percona.com/t/correct-flags-to-register-a-node/10435/2 "2021-05-12T16:54:52Z")

</div>

Hi @AND,

Could you provide an output of the next command?  
`pmm-admin status`

---

<div class="post-metadata">

**Author:** ![AND](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/and/32/3452_2.png) [@AND](https://forums.percona.com/u/AND)\
**Post date:** [May 12, 2021, 4:58pm UTC](https://forums.percona.com/t/correct-flags-to-register-a-node/10435/3 "2021-05-12T16:58:26Z")

</div>

and@pmm-apalache-dev:~$ pmm-admin status  
Agent ID: /agent\_id/2eb448e2-96bc-4ec1-8b34-df9614e2649a  
Node ID : /node\_id/eebdbaa6-11cc-463f-b528-643501c96f99

PMM Server:  
URL : [https://127.0.0.1:443/](https://127.0.0.1:443/)  
Version: 2.17.0

PMM Client:  
Connected : true  
Time drift : 13.8µs  
Latency : 389.231µs  
pmm-admin version: 2.17.0  
pmm-agent version: 2.17.0  
Agents:  
/agent\_id/81b8ae0b-c715-406f-a67c-2b4080b80216 postgresql\_pgstatements\_agent Running  
/agent\_id/a0ba186a-cab1-433c-80cd-1767981aa719 node\_exporter Running  
/agent\_id/a9f14e1e-cefe-4892-93da-0cd7a90eb397 vmagent Running  
/agent\_id/d7d65ef4-2734-4229-8779-9e0c55de9114 postgres\_exporter Running

Adition info:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/b/b7cf4fc95174794fe4456e5e7ddb9eea5d17ebfd.png)

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [May 12, 2021, 5:44pm UTC](https://forums.percona.com/t/correct-flags-to-register-a-node/10435/4 "2021-05-12T17:44:29Z")

</div>

Change the time period to 5m (upper right corner). Do you see the server now?

---

<div class="post-metadata">

**Author:** ![AND](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/and/32/3452_2.png) [@AND](https://forums.percona.com/u/AND)\
**Post date:** [May 12, 2021, 5:47pm UTC](https://forums.percona.com/t/correct-flags-to-register-a-node/10435/5 "2021-05-12T17:47:27Z")

</div>

No, my new node with the postgres db added does not appear on the list.

He was shown in the System Node overview, but with “0 DB instances”.

---

<div class="post-metadata">

**Author:** ![AND](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/and/32/3452_2.png) [@AND](https://forums.percona.com/u/AND)\
**Post date:** [May 12, 2021, 7:33pm UTC](https://forums.percona.com/t/correct-flags-to-register-a-node/10435/6 "2021-05-12T19:33:44Z")

</div>

I have found something, but dont know how to fix.  
My list at [https://localhost/prometheus/targets](https://localhost/prometheus/targets) dont grow up when I add new services.  
Is there a mistake during pmm-node register?

---

<div class="post-metadata">

**Author:** ![Vadim\_Yalovets](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vadim_yalovets/32/43_2.png) [@Vadim\_Yalovets](https://forums.percona.com/u/Vadim_Yalovets)\
**Post date:** [May 13, 2021, 9:45am UTC](https://forums.percona.com/t/correct-flags-to-register-a-node/10435/7 "2021-05-13T09:45:24Z")

</div>

It looks like IP address of your node wasn’t correctly detected.  
You may check the auto detected IP on the inventory page.

 ![Screenshot_20210513_124020](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/a/aff935494ee01e07d5cadeb1c6af15b2960eefe3.png)

Also you may specify node’s IP manually in the config command.

 ![Screenshot_20210513_124338](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/a/aaa49b058ceeb0783cb48df9d36c32f6a1026274.png)

---

<div class="post-metadata">

**Author:** ![AND](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/and/32/3452_2.png) [@AND](https://forums.percona.com/u/AND)\
**Post date:** [May 13, 2021, 1:52pm UTC](https://forums.percona.com/t/correct-flags-to-register-a-node/10435/8 "2021-05-13T13:52:35Z")

</div>

Hi  
I have my node running in the host machine, and I can ping my pmm-server.

I have registered my node using this command: `sudo pmm-admin config --server-insecure-tls --server-url=https://admin:admin@127.0.0.1:443 172.17.0.1 generic Postgre1`

I have added this node, and registered a postgre to monitor.  
`sudo pmm-admin add postgresql --username=pmm --password=pmm2021 --service-name=postgre1-dev Postgre1 172.18.0.2:5432`

But in addres `https://localhost/prometheus/targets` my new target does not appear.

Where can I found all ports used by pmm?

---

<div class="post-metadata">

**Author:** ![Vadim\_Yalovets](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vadim_yalovets/32/43_2.png) [@Vadim\_Yalovets](https://forums.percona.com/u/Vadim_Yalovets)\
**Post date:** [May 13, 2021, 4:15pm UTC](https://forums.percona.com/t/correct-flags-to-register-a-node/10435/9 "2021-05-13T16:15:05Z")

</div>

> [@AND](#):
>
> But in addres `https://localhost/prometheus/targets` my new target does not appear.

Here are shown targets in pull mode.  
The mode (push/pull) is controlled by the `--metrics-mode` flag for the `pmm-admin config` and `pmm-admin add` commands. Push mode is used by default.

You may check used port in an output of command `pmm-admin list`  
 ![Screenshot_20210513_191344](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/1/1bdc5f71150282480a4cff6a9430bae9ed900203.png)

---

<div class="post-metadata">

**Author:** ![AND](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/and/32/3452_2.png) [@AND](https://forums.percona.com/u/AND)\
**Post date:** [May 13, 2021, 4:50pm UTC](https://forums.percona.com/t/correct-flags-to-register-a-node/10435/10 "2021-05-13T16:50:05Z")

</div>

When I try to run `pmm-admin list` inside server container, I’ve go  
t this:  
 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/3/39c8e62674eb19d148d73a202afb2dc5853e141a.png)

I tryed to deploy a pmm-client in a docker container, registered a new node and then added a postgre to monitoring, still dont getting any metrics, and also the node with a postgres db dont show on Postgres Overview

---

<div class="post-metadata">

**Author:** ![AND](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/and/32/3452_2.png) [@AND](https://forums.percona.com/u/AND)\
**Post date:** [May 13, 2021, 6:28pm UTC](https://forums.percona.com/t/correct-flags-to-register-a-node/10435/11 "2021-05-13T18:28:08Z")

</div>

I think I have found the issue, but dont know how to fix it.

I had another post talking about the bug with SSL conection with GCP SQL Instances that currently dont work with percona.

I’ve deployed a new agent within’a docker container, and watching logs:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/f/faae8428696b16c0d36b513c1b976eba1addc1a5.png)

This DB was previously with `SSL Only Conections`, but Percona dont work whit this. Then I have open it to all conection type, but GCP “looks like” keep forcing the conection trough SSL.

PS: Used flags `--tls --tls-skip-verify` but keep bloking in SSL.  
How do I proceed withing percona side?

---

<div class="post-metadata">

**Author:** ![Vadim\_Yalovets](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vadim_yalovets/32/43_2.png) [@Vadim\_Yalovets](https://forums.percona.com/u/Vadim_Yalovets)\
**Post date:** [May 14, 2021, 8:32am UTC](https://forums.percona.com/t/correct-flags-to-register-a-node/10435/12 "2021-05-14T08:32:57Z")

</div>

Are you able to directly connect to the postgresql service in SSL mode from pmm-client host?

---

<div class="post-metadata">

**Author:** ![AND](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/and/32/3452_2.png) [@AND](https://forums.percona.com/u/AND)\
**Post date:** [May 14, 2021, 3:47pm UTC](https://forums.percona.com/t/correct-flags-to-register-a-node/10435/13 "2021-05-14T15:47:57Z")

</div>

Are you able to directly connect to the postgresql service in SSL mode from pmm-client host? `yes sir.`

I cant conect to a Cloud SQL DB in GCP, pg\_hba.conf was refusing my conection with pmm\_user.  
found in error line, percona trying to conect to `cloudsqladmin` db…

In comand line to create an agent `pmm add postgre`, so my conection was going to `cloudsqladmin`, the “default” by google.  
Its happening because I’ve used `CREATE EXTENSION pg_stat_statements;` with my db-admin acount, and GCP dont swith defaultness to this extension.

To solve this problem, `CREATE EXTENSION pg_stat_statements;` should run with `postgres` user for GCP.

But know I’m facing a new challenge:

How can I set `pmm-admin` to ignore the database `cloudsqladmin`?

---

<div class="post-metadata">

**Author:** ![AND](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/and/32/3452_2.png) [@AND](https://forums.percona.com/u/AND)\
**Post date:** [May 17, 2021, 2:06pm UTC](https://forums.percona.com/t/correct-flags-to-register-a-node/10435/14 "2021-05-17T14:06:56Z")

</div>

`db=cloudsqladmin,user=wiser_pmm_user FATAL: pg_hba.conf rejects connection for host "XXX.XXX.XXX.XXX"`  
Whats the necessary roles for pmm user in CloudSQL?

---

<div class="post-metadata">

**Author:** ![HamidAkhtar](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/hamidakhtar/32/3688_2.png) [@HamidAkhtar](https://forums.percona.com/u/HamidAkhtar)\
**Post date:** [May 18, 2021, 11:21am UTC](https://forums.percona.com/t/correct-flags-to-register-a-node/10435/15 "2021-05-18T11:21:07Z")

</div>

The error seems like pg\_hba.conf is rejecting the connection requested. Is there a configuration statement that explicitly rejects connections?

The server logs will have more details about the connection requested, including the user name.

---

<div class="post-metadata">

**Author:** ![AND](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/and/32/3452_2.png) [@AND](https://forums.percona.com/u/AND)\
**Post date:** [May 20, 2021, 1:55pm UTC](https://forums.percona.com/t/correct-flags-to-register-a-node/10435/16 "2021-05-20T13:55:09Z")

</div>

Deeply analyzing, isnt a flag issue, but somethign with the `postgre_exporter`

Solved at:

> [@PMM for Google CloudSQL Postgre](https://forums.percona.com/t/pmm-for-google-cloudsql-postgre/10494):
>
> Im trying to monitor my CloudSQL postgre instance, followed step by step instructions from page but simply dont work: db=cloudsqladmin,user=postgres FATAL: pg\_hba.conf rejects connection for host "10.X.X.X", user "postgres", database "cloudsqladmin", SSL off" I can use psql to conect to instance; Firewall are entirely open; all comands run as sudo; Is this an postgres user issue? Its possible to teach pmm to ignore table cloudsqladmin?
