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

Ambari is not connecting to the right DB

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

Accepted Solutions
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

24 REPLIES 24
Highlighted

Re: Ambari is not connecting to the right DB

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

Highlighted

Re: Ambari is not connecting to the right DB

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.

Highlighted

Re: Ambari is not connecting to the right DB

@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

Highlighted

Re: Ambari is not connecting to the right DB

Contributor

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

Highlighted

Re: Ambari is not connecting to the right DB

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

Highlighted

Re: Ambari is not connecting to the right DB

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

Highlighted

Re: Ambari is not connecting to the right DB

@rbalam Did you run drop database ambari_database; ?

Highlighted

Re: Ambari is not connecting to the right DB

@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;

Highlighted

Re: Ambari is not connecting to the right DB

@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;

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