Support Questions

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

Ambari Server fails to start after installing JCE

avatar
Contributor

While restarting ambari server after installing JCE, it fails to come up

This is what i see in ambari server logs

7 Mar 2017 17:53:03,666 ERROR [main] DBAccessorImpl:117 - If you are using a non-default database for Ambari and a custom JDBC driver jar, you need to set property "server.jdbc.driver.path={path/to/custom_jdbc_driver}" in ambari.properties config file, to include it in ambari-server classpath.
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at org.apache.ambari.server.orm.DBAccessorImpl.<init>(DBAccessorImpl.java:89)
	at org.apache.ambari.server.orm.DBAccessorImpl$$FastClassByGuice$$86dbc63e.newInstance(<generated>)
	at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)

I see server.jdbc.driver.path missing in ambari.properties. I added it but still seeing this issue

1 ACCEPTED SOLUTION

avatar
Master Mentor

@vrathod

Do you have the following symlink present in the /usr/share/java directory to point to the mysql JDBC driver?

# ls -l /usr/share/java | grep mysql
-rwxrwxrwx. 1 root root   992808 Mar  9 08:49 mysql-connector-java-5.1.41-bin.jar
lrwxrwxrwx. 1 root root       35 Mar  9 08:50 mysql-connector-java.jar -> mysql-connector-java-5.1.41-bin.jar

.

If the mysql connector jar is not present there then please refer to then following link and then install the driver and create the symlink: http://docs.hortonworks.com/HDPDocuments/Ambari-2.4.2.0/bk_ambari-reference/content/using_ambari_wit...

Install the connector

# yum install mysql-connector-java

Confirm that .jar is in the Java share directory.

# ls /usr/share/java/mysql-connector-java.jar

Make sure the .jar file has the appropriatepermissions - 644.

Execute the following command:

ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar

View solution in original post

7 REPLIES 7

avatar
Master Mentor

@vrathod

Do you have the following symlink present in the /usr/share/java directory to point to the mysql JDBC driver?

# ls -l /usr/share/java | grep mysql
-rwxrwxrwx. 1 root root   992808 Mar  9 08:49 mysql-connector-java-5.1.41-bin.jar
lrwxrwxrwx. 1 root root       35 Mar  9 08:50 mysql-connector-java.jar -> mysql-connector-java-5.1.41-bin.jar

.

If the mysql connector jar is not present there then please refer to then following link and then install the driver and create the symlink: http://docs.hortonworks.com/HDPDocuments/Ambari-2.4.2.0/bk_ambari-reference/content/using_ambari_wit...

Install the connector

# yum install mysql-connector-java

Confirm that .jar is in the Java share directory.

# ls /usr/share/java/mysql-connector-java.jar

Make sure the .jar file has the appropriatepermissions - 644.

Execute the following command:

ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar

avatar
Contributor

Thanks @Jay SenSharma

I was pointing to the wrong path. After correcting it, ambari server started successfully. Still not sure what removed server.jdbc.driver.path.

avatar
Master Mentor

@vrathod

The driver jar might have been deleted accidentally. As i have never seen such issue earlier, there is no existing JIRA as well on the similar issue. So i am suspecting that it might be deleted accidentally.

avatar
Master Mentor

@vrathod

As this issue is resolved then please mark the answer as "Accepted".

avatar
Explorer

@jsensharma 

i was do that these steps but still gives this problems

 

Ambari Server running with administrator privileges.
Organizing resource files at /var/lib/ambari-server/resources...
Ambari database consistency check started...
No errors were found.
ERROR: Exiting with exit code 1.
REASON: Database check failed to complete. Please check /var/log/ambari-server/ambari-server.log and /var/log/ambari-server/ambari-server-check-database.log for more information.

 

avatar

Hi @AarifAkhter

As this thread was marked 'Solved' 03-18-2017 you would have a better chance of receiving a resolution by starting a new thread. This will also provide the opportunity to provide details specific to your environment that could aid others in providing a more targeted answer to your question. 

 

 

Bill Brooks, Community Moderator
Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.

avatar
Contributor

run

ambari-server setup --jdbc-db=mysql --jdbc-driver=path

usually path of mysql driver is /usr/share/java/mysql-connector-java.jar. It may be different for you.

restart ambari server.