Hi there,
I could successfully connect the pmm-client and server without any issues and the metrics are coming like a charm in my grafana dashboard.
After my successful configuration, I tried to set up a proxy server(Nginx) between the pmm client and server. I can set up the basic nginx reverse proxy configuration and able to load the pmm-dashboard URL by using my proxy domain name.
ISSUE:
But the issue popped up when I tried to config the pmm-admin using the proxy domain instead of the direct IP address of my PMM server. It is getting connected and showing in the PMM-Inventory under Nodes, but no metrics showing in the dashboards.
Similiar to the case : https://jira.percona.com/browse/PMM-5368
LOGS/CONFIGS :
Logs from client
Dec 27 07:21:04 server-name pmm-agent: #033[31mERRO#033[0m[2020-12-27T07:21:04.351-05:00] Failed to establish two-way communication channel: context canceled. #033[31mcomponent#033[0m=client
Dec 27 07:21:18 server-name pmm-agent: #033[36mINFO#033[0m[2020-12-27T07:21:18.598-05:00] Connecting to <a href="https://admin:***@proxy-domain.com:443/">https://admin:***@proxy-domain.com:443/</a> ... #033[36mcomponent#033[0m=client
Dec 27 07:21:18 server-name pmm-agent: #033[36mINFO#033[0m[2020-12-27T07:21:18.615-05:00] Connected to proxy-domain.com:443. #033[36mcomponent#033[0m=client
Dec 27 07:21:18 server-name pmm-agent: #033[36mINFO#033[0m[2020-12-27T07:21:18.615-05:00] Establishing two-way communication channel ... #033[36mcomponent#033[0m=client
Dec 27 07:21:23 server-name pmm-agent: #033[31mERRO#033[0m[2020-12-27T07:21:23.598-05:00] Failed to establish two-way communication channel: context canceled. #033[31mcomponent#033[0m=client
Logs from proxy server
2020/12/27 07:21:26 [info] 24356#24356: *25170 client canceled stream 1, client: 162.154.189.70, server: proxy-domain.com, request: "POST /agent.Agent/Connect HTTP/2.0", host: "proxy-domain.com"
2020/12/27 07:21:26 [info] 24356#24356: *25170 client prematurely closed stream, client: 162.154.189.70, server: proxy-domain.com, request: "POST /agent.Agent/Connect HTTP/2.0", host: "proxy-domain.com"
2020/12/27 07:21:30 [info] 24356#24356: *25184 client canceled stream 1, client: 162.154.189.182, server: proxy-domain.com, request: "POST /agent.Agent/Connect HTTP/2.0", host: "proxy-domain.com"
2020/12/27 07:21:30 [info] 24356#24356: *25184 client prematurely closed stream, client: 162.154.189.182, server: proxy-domain.com, request: "POST /agent.Agent/Connect HTTP/2.0", host: "proxy-domain.com"
Logs from PMM container(seems like not related):
2020/12/27 12:50:50 [warn] 41#41: *562869 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000049734 while sending to client, client: 172.17.0.1, server: _, request: "POST /victoriametrics/api/v1/write HTTP/1.1", host: "pmm-server-IP:443"
2020/12/27 12:50:59 [error] 41#41: *563285 upstream rejected request with error 0 while reading response header from upstream, client: 172.17.0.1, server: _, request: "POST /agent.Agent/Connect HTTP/2.0", upstream: "grpc://127.0.0.1:7771", host: "pmm-server-IP"
2020/12/27 12:51:00 [warn] 41#41: *562869 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000049735 while sending to client, client: 172.17.0.1, server: _, request: "POST /victoriametrics/api/v1/write HTTP/1.1", host: "pmm-server-IP:443"
2020/12/27 12:51:02 [error] 41#41: *563289 upstream rejected request with error 0 while reading response header from upstream, client: 172.17.0.1, server: _, request: "POST /agent.Agent/Connect HTTP/2.0", upstream: "grpc://127.0.0.1:7771", host: "pmm-server-IP"
Config I am using in the proxy server:
server {
#listen 80;
listen 443 ssl http2;
server_name proxy-domain.com;
location / {
proxy_pass <a href="https://pmm-server-IP:443/;">https://pmm-server-IP:443/;</a>
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forward-Proto http;
proxy_set_header X-Nginx-Proxy true;
proxy_redirect off;
}
}
Again into the issue:
What I am missing here? Even it is something related to NGINX, could you please give me a hint so that I could work on that. Please note that the dashboard is still accessible under the proxy domain and I can still set up the pmm-client successfully if I am using the IP instead of the proxy domain.
Working:
pmm-admin config --server-insecure-tls --server-url=https://admin:kck1dJpkCD7p5hBHh@pmm-server-IP:443
Not working:
pmm-admin config --server-insecure-tls --server-url=https://admin:kck1dJpkCD7p5hBHh@proxy-domain.com:443
Checking local pmm-agent status…
pmm-agent is running.
Registering pmm-agent on PMM Server...
Registered.
Configuration file /usr/local/percona/pmm2/config/pmm-agent.yaml updated.
Reloading pmm-agent configuration...
Configuration reloaded.
Checking local pmm-agent status...
pmm-agent is running.
pmm-admin list
Failed to get PMM Server parameters from local pmm-agent: pmm-agent is not connected to PMM Server.