ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anandha L Ranganathan <analog.s...@gmail.com>
Subject Re: Ambari-server schema upgrade failed -2.2.1.1
Date Wed, 25 May 2016 20:28:47 GMT
1) I didn't have the property   'db.mysql.jdbc.name'  in the ambari
property file - /etc/ambari-server/conf/ambari.properties

2) I also didn't  have the jar file under the path
/usr/share/java/mysql-connector-java.jar
but I have file  mysql-connector-java-5.1.36-bin.jar" in the same path.


[root@usw2dxdpmn02 ~]# ls -lrt
/usr/share/java/mysql-connector-java-5.1.36-bin.jar
-rw-r--r--. 1 root root 972009 Sep 11  2015
/usr/share/java/mysql-connector-java-5.1.36-bin.jar

3)  I copied the mysql-jdbc.jar with mysql-connector.jar
cp /usr/share/java/mysql-connector-java-5.1.36-bin.jar
/usr/share/java/mysql-connector-java.jar

4) re-ran the ambari-server upgrade and it ran fine without any issues and
db upgrade is completed.

Thanks Andrew and Jonathan for your quick reply.


I just have a question on DB upgrade.

1) Ambari-server was running fine before upgrade and I have no problem in
driver loading.  Does "DB upgrade " looking for different path  or
different jdbc driver jar file ?

2) I ran many times in my canary server but I never had any problem. It
always ran smooth.  I verified the properties in my canary server and jar
files and I don't see any differences.


Thanks
Anand












On Wed, May 25, 2016 at 12:45 PM, Andrew Stadtler <andy@phdata.io> wrote:

>
> # rpm -qa mysql-connector-java
>
> # ls -la /usr/share/java/mysql-connector-java.jar
>
> On May 25, 2016, at 2:44 PM, Andrew Stadtler <andy@phdata.io> wrote:
>
> Whats the output of these two commands?
>
> # rpm -qa mysql-connector-java
>
> # ls -la ls /usr/share/java/mysql-connector-java.jar
>
>
> On May 25, 2016, at 2:23 PM, Anandha L Ranganathan <analog.sony@gmail.com>
> wrote:
>
> I am trying to upgrade ambari-server with 2.2.1.1 version from 2.1.0
>
> 1) First upgraded ambari-server  with "yum upgrade ambari-server"
>
> Here is the message received.
> Updated:
>  ambari-server.x86_64 0:2.2.1.1-70
>
> Complete!
>
> 2)  Upgrade ambari-database with "ambari-server upgrade"
>
> This is the response I received.
>
> [root@usw2stdpmn02 yum.repos.d]# ambari-server upgrade
> Using python  /usr/bin/python
> Upgrading ambari-server
> Updating properties in ambari.properties ...
> WARNING: Can not find ambari-env.sh.rpmsave file from previous version,
> skipping restore of environment settings
> Fixing database objects owner
> Ambari Server configured for MySQL. Confirm you have made a backup of the
> Ambari Server database [y/n] (y)? y
> Upgrading database schema
> Error output from schema upgrade command:
> Exception in thread "main" java.lang.Exception: Unexpected error, upgrade
> failed
>    at
> org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:319)
> Caused by: com.google.inject.CreationException: Guice creation errors:
>
> 1) Error injecting constructor, java.lang.RuntimeException:
> java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
>  at
> org.apache.ambari.server.orm.DBAccessorImpl.<init>(DBAccessorImpl.java:77)
>  while locating org.apache.ambari.server.orm.DBAccessorImpl
>  while locating org.apache.ambari.server.orm.DBAccessor
>    for field at
> org.apache.ambari.server.orm.dao.DaoUtils.dbAccessor(DaoUtils.java:36)
>  at org.apache.ambari.server.orm.dao.DaoUtils.class(DaoUtils.java:36)
>  while locating org.apache.ambari.server.orm.dao.DaoUtils
>    for field at
> org.apache.ambari.server.orm.dao.HostComponentStateDAO.daoUtils(HostComponentStateDAO.java:39)
>  at
> org.apache.ambari.server.orm.dao.HostComponentStateDAO.class(HostComponentStateDAO.java:39)
>  while locating org.apache.ambari.server.orm.dao.HostComponentStateDAO
>    for field at
> org.apache.ambari.server.orm.models.HostComponentSummary.hostComponentStateDao(HostComponentSummary.java:52)
> Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException:
> com.mysql.jdbc.Driver
>    at
> org.apache.ambari.server.orm.DBAccessorImpl.<init>(DBAccessorImpl.java:103)
>    at
> org.apache.ambari.server.orm.DBAccessorImpl$$FastClassByGuice$$86dbc63e.newInstance(<generated>)
>    at
> com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
>    at
> com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60)
>    at
> com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
>    at
> com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
>    at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:54)
>    at
> com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:53)
>    at
> com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:110)
>    at
> com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:94)
>    at
> com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
>    at
> com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
>    at
> com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
>    at
> com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
>    at com.google.inject.Scopes$1$1.get(Scopes.java:65)
>    at
> com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
>    at
> com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:53)
>    at
> com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:110)
>    at
> com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:94)
>    at
> com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
>    at
> com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
>    at
> com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
>    at
> com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
>    at com.google.inject.Scopes$1$1.get(Scopes.java:65)
>    at
> com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
>    at
> com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:53)
>    at
> com.google.inject.internal.InjectionRequestProcessor$StaticInjection$1.call(InjectionRequestProcessor.java:116)
>    at
> com.google.inject.internal.InjectionRequestProcessor$StaticInjection$1.call(InjectionRequestProcessor.java:110)
>    at
> com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
>    at
> com.google.inject.internal.InjectionRequestProcessor$StaticInjection.injectMembers(InjectionRequestProcessor.java:110)
>    at
> com.google.inject.internal.InjectionRequestProcessor.injectMembers(InjectionRequestProcessor.java:78)
>    at
> com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:170)
>    at
> com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:109)
>    at com.google.inject.Guice.createInjector(Guice.java:95)
>    at com.google.inject.Guice.createInjector(Guice.java:72)
>    at com.google.inject.Guice.createInjector(Guice.java:62)
>    at
> org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:280)
>
>
>
> I verified that my mysql jdbc drives exists in the following path.
>
>
> [root@usw2stdpmn02 resources]# ls -lrt
> /var/lib/ambari-server/resources/mysql-connector-java-5.1.36-bin.jar
> -rw-r--r--. 1 root root 972009 Sep  3  2015
> /var/lib/ambari-server/resources/mysql-connector-java-5.1.36-bin.jar
>
>
>
> What is the workaround and how would I fix this problem ?
>
>
>
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message