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

re-run ambari server setup so that you can enter your remote db information. @rbalam

ambari-server stop

ambari-server reset

ambari-server setup

avatar
Expert Contributor

I am not able to reset ambari as it is saying i need to use DDL scripts for the remote DB host. Could you tell me how i can use Ambari-DDL-MySQL-DROP.sql to remove everything from mysql server and then use Ambari-DDL-MySQL-CREATE.sql to recreate the schema? There are other Databases running on the same mysql host, so i want to be careful not to delete any other tables.

avatar
Master Mentor
@rbalam

Please see this http://docs.hortonworks.com/HDPDocuments/Ambari-2.2.0.0/bk_ambari_reference_guide/content/_using_amb...

You can drop the database as normal mysql statement and run the above scripts mentioned in the doc

avatar
Expert Contributor

I tried to do that but here is what I saw on the console .. please see the attached for error message

avatar
Master Mentor

@rbalam I dont see the error details. DId you attach log?

avatar
Master Mentor

@rbalam I see the error. Whats the OS ? See this thread

avatar
Master Mentor

@rbalam Did you run drop database ambari_database; ?

avatar
Master Mentor

@rbalam

Do this...

login to mysql

drop database ambari;

CREATE DATABASE ambari;

USE ambari;

SOURCE /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql;

avatar
Master Mentor

@rbalam You may want to remove customer name.

You need to follow the doc step by step. Missing the permsisions

CREATE USER '<AMBARIUSER>'@'%' IDENTIFIED BY '<AMBARIPASSWORD>';

GRANT ALL PRIVILEGES ON *.* TO '<AMBARIUSER>'@'%';

CREATE USER '<AMBARIUSER>'@'localhost' IDENTIFIED BY '<AMBARIPASSWORD>';

GRANT ALL PRIVILEGES ON *.* TO '<AMBARIUSER>'@'localhost';

CREATE USER '<AMBARIUSER>'@'<AMBARISERVERFQDN>' IDENTIFIED BY '<AMBARIPASSWORD>';

GRANT ALL PRIVILEGES ON *.* TO '<AMBARIUSER>'@'<AMBARISERVERFQDN>';

FLUSH PRIVILEGES;