Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created on
11-28-2019
12:11 AM
- last edited on
11-28-2019
12:37 AM
by
VidyaSargur
sudo apt-get install libmysql-java
Reading package lists... Done
Building dependency tree
Reading state information... Done
libmysql-java is already the newest version (5.1.45-1).
0 upgraded, 0 newly installed, 0 to remove and 92 not upgraded.
/usr/jdk64/jdk1.8.0_112/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar org.apache.ambari.server.DBConnectionVerification "jdbc:mysql://XXXXXX:3306/ambari" "ambari" "password" com.mysql.jdbc.Driver
ERROR: Unable to connect to the DB. Please check DB connection properties.
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
Created on 11-28-2019 02:06 AM - edited 11-28-2019 02:07 AM
Hi @Manoj690
Can you copy - "/var/lib/ambari-server/resources/mysql-connector-java.jar" to "/usr/share/java/"
and retry.
Make sure you use correct java path for the java version you are pointing too.
Created on 11-28-2019 12:50 AM - edited 11-28-2019 12:52 AM
Hi @Manoj690
Can you share output of below commands -
Created on 11-28-2019 01:12 AM - edited 11-28-2019 01:15 AM
#ls -ltr /usr/share/java/mysql.jar
ls: cannot access '/usr/share/java/mysql.jar': No such file or directory
# find / -name mysql.jar
find: ‘/run/user/1000/doc’: Permission denied
find: ‘/run/user/1000/gvfs’: Permission denied
# find / -name mysql-connector-java*.jar
/usr/share/java/mysql-connector-java.jar
/var/lib/ambari-server/resources/mysql-connector-java.jar
find: ‘/run/user/1000/doc’: Permission denied
find: ‘/run/user/1000/gvfs’: Permission denied
/home/gaian/Downloads/mysql-connector-java.jar
Created on 11-28-2019 02:06 AM - edited 11-28-2019 02:07 AM
Hi @Manoj690
Can you copy - "/var/lib/ambari-server/resources/mysql-connector-java.jar" to "/usr/share/java/"
and retry.
Make sure you use correct java path for the java version you are pointing too.
Created 11-28-2019 02:10 AM
Created 11-28-2019 02:19 AM
Hi @Manoj690
Now the error is different -
"jdbc:mysql://xxxxx:3306/ambari" "ambari" "Password" com.mysql.jdbc.Driver
ERROR: Unable to connect to the DB. Please check DB connection properties.
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications
link failure
Probably check connection to your DB server from ambari node.
Login to ambari server and telnet -
$telnet <DB_HOST> 3306
Make sure IPtables/selinux is disabled.
If you think initial issue is resolved please close this topic my accepting the correct reply on thread.
Will be happy to help you for above issue. Please keep posted.
Created 11-28-2019 02:24 AM
telnet is working but still shows same error ,, iptables and selinux are disabled
Created 11-28-2019 02:43 AM
From Ambari node can you try -
mysql -u <ambari_DB_username> <Ambari_DB_name> -h <DB_hostname> -P <Port>
Check if you are able to successfully login to the DB from ambari node.
Created 11-28-2019 03:00 AM
Created 11-28-2019 03:28 AM
@Manoj690 login to mysql and follow step 2 from below link
make sure you give. permission as per your ambari hostname(FQDN) also.