Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Please see the Cloudera blog for information on the Cloudera Response to CVE-2021-4428

ambari server connect mysql so frequent!!

Expert Contributor

I install ambari-server 2.4.2.0 and the newest hdp 2.5

after I start the ambari server, I found mysql was connect too often.

my mysql server just used for ambari ,hive,grafana.

when I stop the ambari server,the top commands show :

14070-top-mysql-no-ambari.png

After I start the ambari server, the top command show :

14071-top-mysql-with-ambari.png

I use show processlist in mysql,it often shows:

mysql-connector-java .... show variables where ...

14072-top-mysql-with-ambari1.png

I don't know why the ambari server connect to mysql so frequent..

1 ACCEPTED SOLUTION

Accepted Solutions

Super Mentor

@darkz yu

Are to you using Ambari Database as mysql?

By any change is there any possibility that you can upgrade your mysql-connector-java driver version from 5.1.17 to 5.1.38 or later. As i remember there was some CPU utilization issue reported for the "5.1.17" version of connector.

You can drop the latest mysql-connector-java jar inside the "/usr/share/java" directory and then create a symlink "/usr/share/java/mysql-connector-java.jar"

as following to point to it. Then restart the components that are using mysql.

# ls -lan /usr/share/java/mysql-*
-rw-r--r--. 1 0 0 819803 Jun 22  2012 /usr/share/java/mysql-connector-java-5.1.17.jar
-rwxrwxrwx. 1 0 0 992808 Mar  9 08:49 /usr/share/java/mysql-connector-java-5.1.41-bin.jar
lrwxrwxrwx. 1 0 0  35 Mar  9 08:50 /usr/share/java/mysql-connector-java.jar -> mysql-connector-java-5.1.41-bin.jar

.

mysql-connector-java driver downlaod link: https://dev.mysql.com/downloads/connector/j/5.1.html

View solution in original post

7 REPLIES 7

Super Mentor

@darkz yu

Are to you using Ambari Database as mysql?

By any change is there any possibility that you can upgrade your mysql-connector-java driver version from 5.1.17 to 5.1.38 or later. As i remember there was some CPU utilization issue reported for the "5.1.17" version of connector.

You can drop the latest mysql-connector-java jar inside the "/usr/share/java" directory and then create a symlink "/usr/share/java/mysql-connector-java.jar"

as following to point to it. Then restart the components that are using mysql.

# ls -lan /usr/share/java/mysql-*
-rw-r--r--. 1 0 0 819803 Jun 22  2012 /usr/share/java/mysql-connector-java-5.1.17.jar
-rwxrwxrwx. 1 0 0 992808 Mar  9 08:49 /usr/share/java/mysql-connector-java-5.1.41-bin.jar
lrwxrwxrwx. 1 0 0  35 Mar  9 08:50 /usr/share/java/mysql-connector-java.jar -> mysql-connector-java-5.1.41-bin.jar

.

mysql-connector-java driver downlaod link: https://dev.mysql.com/downloads/connector/j/5.1.html

View solution in original post

This helped me 🙂

just a litte more detai for the sym link:

	rm /usr/share/java/mysql-connector-java.jar 
	ln -s /usr/share/java/mysql-connector-java-5.1.45-bin.jar /usr/share/java/mysql-connector-java.jar

@jsensharma

Thank you for your answer.

I am facing similar issue with Ambari 2.7.0, Mysql 5.7.29.

I am unable to get into admin account even once and on click of Login it just hangs and says 'Unable to connect to Ambari Server. Confirm Ambari Server is running and you can reach Ambari Server from this machine.' after some seconds.'

 

I even posted details here: https://stackoverflow.com/q/60743259/7051479

 

Could you please help me out on this.

Expert Contributor

I use yum install the mysql-connector-java

Super Mentor

@darkz yu

Repository Jars are not upgraded frequently. Just check if you have later version of mysq-connector-java available at your OS repository? If not then better to download the Jar from previously shared link and then load it.

Expert Contributor

I install newer mysql-connector,and it is ok now

uninstall older connector:

rpm -e mysql-connector-java

install newer version from mysql local HDP-UTILS repo

rpm -ivh http://192.168.112.47/repo/HDP-UTILS-1.1.0.21/repos/centos6/mysql-connector-java/mysql-connector-jav...

then restart the ambari server:

sudo service ambari-server restart

Expert Contributor

@Jay SenSharma

It sees strange,I found the version of mysql-connector is mysql-connector-java-5.1.17-6.el6.noarch on mysql another cluster,but there is nothing wrong about it.