Support Questions

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

Ambari is not connecting to the right DB

avatar
Expert Contributor

I am trying to install a new cluster and in the process i configured ambari to talk to a remote mysql db running on a different machine in the cluster. However when I try to start the ambari, it is failing to start because it is trying to connect to the local db which doesnt exisits. I checked ambari.properties file to see if i have the correct hostname for the remote mysql db. The properties file looks fine.

Is there any other place i need to check to see if it has the correct remote db hostname configured? Please advise

1 ACCEPTED SOLUTION

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

24 REPLIES 24

avatar
Expert 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)

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

avatar
Expert Contributor

Error message is attached


error.png

avatar
Expert 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?

avatar
Master Mentor
@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?

avatar
Master Mentor

@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

avatar
Expert Contributor

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

avatar
Master Mentor

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

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

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