usage issues prometheus mysql exporter

1,244 views
Skip to first unread message

Machiel Richards

unread,
Mar 23, 2017, 5:34:11 AM3/23/17
to promethe...@googlegroups.com

Good day

While trying to run the mysqld_exporter on the database server directly , I get the following error :

INFO[0000] Error scraping slave state: Error 1045: Access denied for user 'user'@'::1' (using password: YES) file=mysqld_exporter.go line=824

I have setup the user for both localhost and 127.0.0.1 , however it seems to be trying to use the ipv6 address, however we do not use ipv6 yet at all. 

  How can I resolve this. 

 using mysqld_exporter-0.7.1.linux-amd64


 Any assistance will be appreciated. 
 Thank you. 


--
I am a bomb technician...If you see me running, TRY TO KEEP UP!

Julius Volz

unread,
Mar 23, 2017, 8:57:23 AM3/23/17
to Machiel Richards, Prometheus Users
I guess localhost resolves to ::1 if you have v6 enabled on the host? Does the same happen when you tell it to connect to 127.0.0.1?

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CAAEZYqM_5x0JSX3cbUu2vYYiQ_3zuE43HgDEjnPJL%2BVV2KFp_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Machiel Richards

unread,
Mar 23, 2017, 8:59:13 AM3/23/17
to Julius Volz, Prometheus Users
I found out that it still connects on ipv4 as well, however that error keeps on repeating for the ipv6.

I am trying to figure out how to setup the collector to force only ipv4.


Julius Volz

unread,
Mar 23, 2017, 9:04:35 AM3/23/17
to Machiel Richards, Prometheus Users
On Thu, Mar 23, 2017 at 1:59 PM, Machiel Richards <machiel....@gmail.com> wrote:
I found out that it still connects on ipv4 as well, however that error keeps on repeating for the ipv6.

I'm not sure I understand. Do you mean that the TCP connection actually does happen over IPv4, but it still results in an error message about ::1?
 

Machiel Richards

unread,
Mar 23, 2017, 9:10:13 AM3/23/17
to Julius Volz, Prometheus Users
Sorry, let me rephrase

     This is a new setup that we are busy trying to get working.

      On my laptop when I tested all was well as it only has ipv4 enabled.

      However, trying to startup the collector on the server where ipv6 is enabled but not used, we keep on getting the error about '::1'.

         That said, the collector does in fact seem to start on ipv4 despite all the errors for the ipv6 address.

         The problem is however, that because this is going to be deployed on a production environment, we can not have millions of logs for ipv6 that are irrelevant as this will cause important messages to be missed.

         so my question is , how can we get the collector to ignore the ipv6 completely.


Regards
     

Nicholas Capo

unread,
Mar 23, 2017, 9:17:51 AM3/23/17
to Machiel Richards, Julius Volz, Prometheus Users

The MySQL exporter listens on ipv4 to be scraped, then when scraped (or thereabouts) it connects to MySQL using the connection string provided in it's config.

The error messages says that MySQL isn't listening on ipv6.

I have a feeling you should change the configured connection string to use 127.0.0.1 instead of localhost, which will not effect the listening ip for the exporter.

Nicholas


To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.



--
I am a bomb technician...If you see me running, TRY TO KEEP UP!

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.



--
I am a bomb technician...If you see me running, TRY TO KEEP UP!

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CAAEZYqOgU8ph2h4EiZhu3sjCQC_Vi_dbv3EYoUtG9vErDe3zfw%40mail.gmail.com.

Machiel Richards

unread,
Mar 23, 2017, 9:26:03 AM3/23/17
to Nicholas Capo, Julius Volz, Prometheus Users
Well I am not using a connection string and instead using the .my,cnf file in the directory where it runs from.

Using connection strings for startup is not an option as we try to keep things as secure as possible.

so is there an option I can add to the cnf file in order to achieve this?



To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.



--
I am a bomb technician...If you see me running, TRY TO KEEP UP!

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.



--
I am a bomb technician...If you see me running, TRY TO KEEP UP!

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.

Nicholas Capo

unread,
Mar 23, 2017, 10:30:58 AM3/23/17
to Machiel Richards, Julius Volz, Prometheus Users

Can you paste us your my.cnf?

Nicholas


To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.



--
I am a bomb technician...If you see me running, TRY TO KEEP UP!

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.



--
I am a bomb technician...If you see me running, TRY TO KEEP UP!

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.



--
I am a bomb technician...If you see me running, TRY TO KEEP UP!

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CAAEZYqNpxCtanWfB9PvsnD%3DZD9XtG-VHJ4-MMqnQ8%3DWKXraiTQ%40mail.gmail.com.

Machiel Richards

unread,
Mar 24, 2017, 12:49:43 AM3/24/17
to Nicholas Capo, Julius Volz, Prometheus Users
These are the only options in the .my.cnf file that we created for this purpose and is obviously seperate from the main my.cnf file

#cat .my.cnf
[client]
user=grafana
password=*********
 


To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.



--
I am a bomb technician...If you see me running, TRY TO KEEP UP!

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.



--
I am a bomb technician...If you see me running, TRY TO KEEP UP!

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.



--
I am a bomb technician...If you see me running, TRY TO KEEP UP!

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.

Machiel Richards

unread,
Mar 24, 2017, 2:53:59 AM3/24/17
to Nicholas Capo, Julius Volz, Prometheus Users
Hi Guys

    So I have managed to progress to the point where I can provide the following information.

     The original server where I had the errors for host '::1' , was sorted out by adding permissions for that host as it seems the server was setup with support for ipv6.

      However, on a second server, where I am trying to get the mysqld_exporter working, the server is not in fact setup for ipv6 support , resulting in the exporter not working as it keeps on giving the error :

dial tcp [::1]:3306: getsockopt: connection refused


      So looking at the running ports, there is no such port as it is running on purely ipv4 config , but somehow the exporter does not want to work unless it is able to access the ipv6 port.

      Surely there must be some way to configure it in order to only use the ip versions that are running and not to try and connect to something that is not in fact running.


       Regards

To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.



--
I am a bomb technician...If you see me running, TRY TO KEEP UP!

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.



--
I am a bomb technician...If you see me running, TRY TO KEEP UP!

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.



--
I am a bomb technician...If you see me running, TRY TO KEEP UP!

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages