Mysql monitoring using Prometheus and Grafana - grafana

I need to monitor Mysql using Prometheus and Grafana;
Added mysqld exporter in the client server
while starting the mysqld in the client server it reports as :
time="2017-09-05T11:42:53Z" level=info msg="Error scraping slave state: dial tcp [::1]:3306: getsockopt: connection refused" file="mysqld_exporter.go" line=824
time="2017-09-05T11:42:53Z" level=info msg="Error scraping table schema: dial tcp [::1]:3306: getsockopt: connection refused" file="mysqld_exporter.go" line=836
In client server :
I have downloaded the mysqld exporter
Extracted it
Created .my.cnf file
[client]
user=prom
password=abc123
Given permission to that user by using this command
mysql> GRANT REPLICATION CLIENT, PROCESS ON . TO 'prom'#'localhost' identified by 'abc123';
mysql> GRANT SELECT ON performance_schema.* TO 'prom'#'localhost';
Executed this command
./mysqld_exporter -config.my-cnf=".my.cnf"
Prometheus status page shows as UP condition for this.
In Grafana no data is loaded for MySQL

Related

Connection refused when deploying in cloud on kubernetes

I am deploying kubernetes in Cloud and I'm trying to call another container inside the same pod through an API.
I am using localhost but also I treid with 127.0.0.1. Also, I tried with the container's name.
2022/11/04 15:50:47 dial tcp [::1]:4245: connect: connection refused
2022/11/04 15:50:47 Successfully processed file.json file
2022/11/04 15:50:47 Get "http://localhost:4245/api/admin/projects/default": dial tcp [::1]:4245: connect: connection refused
panic: Get "http://localhost:4245/api/admin/projects/default": dial tcp [::1]:4245: connect: connection refused
goroutine 1 [running]:
log.Panic({0xc000119dc8?, 0xc000166000?, 0x6aaaea?})
/opt/app-root/src/sdk/go1.19.2/src/log/log.go:388 +0x65
main.StatusServer({0xc000020570?, 0x30?}, {0x0, 0x0})
/build/script.go:197 +0x1ee
main.ProcessData({0xc000020041, 0x15}, {0x0, 0x0}, {0xc00002000f?, 0x43ce05?})
/build/script.go:291 +0xa6
main.main()
/build/script.go:443 +0xc5
Any idea if I can call the container like that?
You get a connection refused means you reached localhost and it decided to refuse the connection.
This is most likly because nothing is listening on the port.
If it was a firewall issue the request would timeout.
You can check listening ports with command like:
netstat -an
If not installed maybe you can try it from the workernode where the pod is running.
Another method of testing is to use
curl http://127.0.0.1:4245
This will probably result in same connection refused.
Are you really sure the container is running in same pod?
Please check your deployment and service.
If you cant find the failure please come back with more information so it can be analysed.

Cannot connect to haproxy exporter

I have configured HAProxy locally in my machine and I have tried to read the metrics of it using haproxy_exporter.
I am using the docker image of the haproxy_exporter and used the below-given command to execute it.
docker run -p 9101:9101 prom/haproxy-exporter:latest --haproxy.scrape-uri="http://localhost:8181/stats;csv"
If I try to reach the metric endpoint, I am getting this error saying that the connection is refused. What am I doing wrong?
ts=2022-05-06T10:03:49.462Z caller=haproxy_exporter.go:584 level=info msg="Starting haproxy_exporter" version="(version=0.13.0, branch=HEAD, revision=c5c72aa059b69c18ab38fd63777653c13eddaa7f)"
ts=2022-05-06T10:03:49.462Z caller=haproxy_exporter.go:585 level=info msg="Build context" context="(go=go1.17.3, user=root#77b4a325967c, date=20211126-09:54:41)"
ts=2022-05-06T10:03:49.462Z caller=haproxy_exporter.go:603 level=info msg="Listening on address" address=:9101
ts=2022-05-06T10:03:49.464Z caller=tls_config.go:195 level=info msg="TLS is disabled." http2=false
ts=2022-05-06T10:03:56.366Z caller=haproxy_exporter.go:399 level=error msg="Can't scrape HAProxy" err="Get \"http://localhost:8181/stats;csv\": dial tcp 127.0.0.1:8181: connect: connection refused"

Openshift origin oc cluster up fails

Using the last version of openshift origin v3.10.0 i run the following command on centos VM:
oc cluster up --public-hostname=192.168.56.15 --http-proxy=http://proxy.ip:port --https-proxy=https://proxy.ip:port --no-proxy=[192.168.56.0/24,172.0.0. 0/8,192.168.56.15,192.168.56.15,localhost]
In result i get:
Getting a Docker client ...
Checking if image openshift/origin-control-plane:v3.10 is available ...
Checking type of volume mount ...
Determining server IP ...
Checking if OpenShift is already running ...
Checking for supported Docker version (=>1.22) ...
Checking if insecured registry is configured properly in Docker ...
Checking if required ports are available ...
Checking if OpenShift client is configured properly ...
Checking if image openshift/origin-control-plane:v3.10 is available ...
Starting OpenShift using openshift/origin-control-plane:v3.10 ...
I1003 10:58:00.643521 3446 flags.go:30] Running "create-kubelet-flags"
I1003 10:58:01.314805 3446 run_kubelet.go:48] Running "start-kubelet"
I1003 10:58:01.549316 3446 run_self_hosted.go:172] Waiting for the kube-apiserver to be ready ...
E1003 11:03:01.559324 3446 run_self_hosted.go:542] API server error: Get https://127.0.0.1:8443/healthz?timeout=32s: dial tcp 127.0.0.1:8443: getsockopt: connection refused ()
Error: timed out waiting for the condition
And while following the log of docker i notice the following error:
E1003 github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet.go:452: Failed to list *v1.Service: Get https://localhost:8443/api/v1/services?limit=500&resourceVersion=0: dial tcp [::1]:8443: getsockopt: connection refused
Which is a normal behavior since netstat shows only one port opened:
tcp6 0 0 :::10250 :::* LISTEN 3894/hyperkube
PS:
As you can see i use proxy.
I tried to use a local resolving, using dns instead of ip# and since i don't have a DNS server i used /etc/hosts, same problem.

Docker: skygear server not starting, connection refused

I followed the Docker manual on https://docs.skygear.io/server/guide/getting-started-docker.
I used Kitematic to download Skygear Server from SkygearIO.
When the server tries to start it can't connect to a database.
ERRO[0001] Unable to begin transaction for schema migration: dial tcp
[::1]:5432: getsockopt: connection refused logger=skydb
ERRO[0001] Failed to start skygear: failed to open connection: skydb/pq:
unable to connect to database because of a network error = dial tcp
[::1]:5432: getsockopt: connection refused
I can't seem to find the problem.
Please follow the Setup Skygear Development Server Locally.

Bluemix WebsocketListener.Start: Error connecting to a doppler server

Has anyone faced this issue with Bluemix? One of my Bluemix instances crashes repeatedly and the log file shows the following error. Seems to be an internal error within Bluemix environment, and I could not understand the reason for it.
......
2016-08-04T12:02:07.617+0530[DEA/75]OUTStopped app instance (index 0) with guid 9b4ebc26-e5f9-4c61-a54e-f8c7437185a7
2016-08-04T12:02:17.783+0530[LGR/null]ERRWebsocketListener.Start: Error connecting to a doppler server
2016-08-04T12:02:17.799+0530[LGR/null]ERRproxy: error connecting to 158.85.134.172:8081: dial tcp 158.85.134.172:8081: getsockopt: connection refused
2016-08-04T12:02:17.899+0530[LGR/null]ERRproxy: error connecting to 158.85.134.172:8081: dial tcp 158.85.134.172:8081: getsockopt: connection refused