Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Ambari is not connecting to the right DB

Solved Go to solution
Highlighted

Re: Ambari is not connecting to the right DB

Contributor

i did all that and i ran ambari-setup once again and i gave the remote MySQL DB information by choosing option 3 for MySQL and tried to restart but it failed to restart again with the following error message .. which means it is trying to talk to a DB on the local host which doesn't exisits .. the remote mysql is running on FALBDCDQ0007V host ..

Exception in thread "main" com.google.inject.CreationException: Guice creation errors: 1) Error injecting constructor, java.lang.RuntimeException: java.sql.SQLException: Access denied for user 'ambari'@'FALBDCDQ0001V.farmersinsurance.com' (using password: YES) 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.TopologyRequestDAO.daoUtils(TopologyRequestDAO.java:31) at org.apache.ambari.server.orm.dao.TopologyRequestDAO.class(TopologyRequestDAO.java:31) while locating org.apache.ambari.server.orm.dao.TopologyRequestDAO for field at org.apache.ambari.server.topology.PersistedStateImpl.topologyRequestDAO(PersistedStateImpl.java:56) Caused by: java.lang.RuntimeException: java.sql.SQLException: Access denied for user 'ambari'@'FALBDCDQ0001V.farmersinsurance.com' (using password: YES) 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)

Highlighted

Re: Ambari is not connecting to the right DB

Mentor

@rbalam

I have attached a document on how to install your Ambari server successfully you will not find any better document than this .Please enjoy and revert set-up-mysql-for-ambari.pdf

I forgot to include the syntax to connect remotely to MySQL server but it should be fine

The Ambari Server host needs the mysql-connector-java driver installed to be able to communicate with the database you will need to install it on the local and remote server

Highlighted

Re: Ambari is not connecting to the right DB

Contributor

Error message is attached


error.png
Highlighted

Re: Ambari is not connecting to the right DB

Contributor

@Geoffrey Shelton Okot

Thanks for sending the doc but I did the installation exactly the same way you have it on your document and everything went fine but when i start the server it is looking for the local mySQL db which doesnt exists .. I checked ambari.properties and everything points to the remote mySQL server but for some reason the ambari server is trying to connect to the local mysql host ..

Please note that i m doing the installation using a local repo as this cluster doesnt have internet connect .. Do you have a doc to remove ambari binaries and configuration from everywhere to start from the scratch?

Highlighted

Re: Ambari is not connecting to the right DB

@rbalam

You are mixing couple of things here.

1) Cleanup https://community.hortonworks.com/content/idea/138/cleanup-scripts-to-remove-old-hdp-bits.html

2) ambari-server setup looks fine...as per the screenshot

whats the exact issue now?

View solution in original post

Highlighted

Re: Ambari is not connecting to the right DB

@rbalam It failed because of permission issue

java.sql.SQLException: Access denied for user 'ambari'@'FALBDCDQ0001V.farmersinsurance.com' (using

run this as root user

grant all privileges on *.* to 'ambari'@'FALBDCDQ0001V.farmersinsurance.com' identified by 'password' ;

make sure you can connect

mysql -u ambari -ppassword -h host

Highlighted

Re: Ambari is not connecting to the right DB

Contributor

FALBDCDQ0001V is not the correct MySQL host .. it should talk to FALBDCDQ0007V where i have all the permissions set for ambari user ..

Highlighted

Re: Ambari is not connecting to the right DB

@rbalam Ok..You can change the host entry to the correct one.

Re: Ambari is not connecting to the right DB

Contributor

@Neeraj Sabharwal

as i stated in the begining, the problem is with the ambari server trying to connect to the local mysql host when i configured it to talk to remote MySQL host ..

Ambari Server setup ran fine .. but when i try to restart it is failing because it is trying to talk to the local db instead of remote mysql db ..

I removed ambari-server binaries from the host using "yum remove ambari-server" and re-installed it using "yum install ambari-server" and ran the set up once again to point it to remote mysql db but it is still trying to talk to the local db when i tried to start using "ambari-server start" command ..

Highlighted

Re: Ambari is not connecting to the right DB

Mentor

@rbalam

Try this steps to clean up your failed installation, just to make sure did you in th eeralier steps copy mysql-connector-java.jar to /usr/share/java/ directory to both servers ?

Don't have an account?
Coming from Hortonworks? Activate your account here