-
Notifications
You must be signed in to change notification settings - Fork 761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error 9002: SSL connection is required. #226
Comments
The exporter currently doesn't support SSL connection parameters via the For more advanced SSL use, like custom certificate verification, some additional configuration support is needed. Happy to review pull requests to add this. |
Instead of .my.cnf I exported the FATA[0000] no user specified under [client] in /home/vagrant/.my.cnf file=mysqld_exporter.go line=1958 Also, the value provided in I tried echo the variable in terminal: There is no parameter to add ssl in connection. From our server side ssl is required in order to connect with database. |
If it is attempting to read the .cnf file, it means that the exporter was unable to read the Try |
I tried both things. That's why I am getting output on applying this command: It's weird! Do you think, this is because I am using vagrant and not the real os? |
package main import ( func main() { When I tried to run this sample script I got correct result. But, when I tried to build the script and run binary like |
This issue is being solved by running command with root rather running it like Please provide me detail how to add ssl and I will send you pull request with that feature with Also, I am running Azure MySQL database and the username by default contains Thanks! |
The mysqld_exporter requires no privileges, so running with root/sudo is unnecessary. As for the username, sorry, I don't have a quick answer for that. I would consult the upstream go mysql driver docs. |
Hey, did you solve this issue? i am facing the same issue :/ |
Per discussion in #226, there is no way to specify a custom CA that the mysqld exporter will trust when establishing a SSL connection to a mysql server. So if a mysql server has a custom truststore, an operator would need to set DSN, where tls=skip-verify. With this change, a user can define the ssl options in the mysql cnf and then the mysqld exporter will construct a DSN and a custom TLS config based on those options.
This should now be fixed in 0.11.0. 🎉 |
Probably can be closed. |
Host operating system: output of
uname -a
Linux vagrant-ubuntu-trusty-64 3.13.0-121-generic #170-Ubuntu SMP Wed Jun 14 09:04:33 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
MySQL server version
5.6
mysqld_exporter command line flags
What did you do that produced an error?
.my.cnf file:
[client]
user=dsad@dsa
password=dasd@dsaW#
host=eastus1-a.control.database.windows.net
[mysqld]
ssl-cert=/etc/mysql/BaltimoreCyberTrustRoot.crt.pem
ssl-ca=/etc/mysql/BaltimoreCyberTrustRoot.crt.pem
Command to run mysqld_exporter:
sudo ./mysqld_exporter -config.my-cnf=".my.cnf"
What did you expect to see?
Successfully connected to Azure database
What did you see instead?
INFO[0325] Error scraping slave state: Error 9002: SSL connection is required. Please specify SSL options and retry. file=mysqld_exporter.go line=824
INFO[0325] Error scraping table schema: Error 9002: SSL connection is required. Please specify SSL options and retry. file=mysqld_exporter.go line=836
INFO[0327] Error scraping global state: Error 9002: SSL connection is required. Please specify SSL options and retry. file=mysqld_exporter.go line=812
INFO[0328] Error scraping global variables: Error 9002: SSL connection is required. Please specify SSL options and retry. file=mysqld_exporter.go line=818
The text was updated successfully, but these errors were encountered: