Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

ambari server connect mysql so frequent!!

avatar
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

avatar
Master 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

avatar
Master 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

avatar

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

avatar

@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.

avatar
Expert Contributor

I use yum install the mysql-connector-java

avatar
Master 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.

avatar
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

avatar
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.