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 Setup Automation using MYSQL database

Highlighted

Ambari Setup Automation using MYSQL database

New Contributor

Hi All,

I am working on a task to automate the whole installation.. where I am struck with ambari-server installation and setup. My script is issuing a command like..

ambari-server setup -j /usr/lib/jvm/jre-1.7.0-openjdk.x86_64 -s --jdbc-driver /usr/share/java/mysql-connector-java.jar --jdbc-db mysql

The installation is going through successfull, but he server is not starting.. The log is pasted below.

## installing ambari-agent

Verifying Python version compatibility...

Using python /usr/bin/python2.6

Checking for previously running Ambari Agent...

Starting ambari-agent

Verifying ambari-agent process status...

Ambari Agent successfully started

Agent PID at: /var/run/ambari-agent/ambari-agent.pid

Agent out at: /var/log/ambari-agent/ambari-agent.out

Agent log at: /var/log/ambari-agent/ambari-agent.log

## install ambari-server

cp: cannot stat `/var/lib/ambari-server/resources/views/*.jar': No such file or directory

Using python /usr/bin/python2.6

Setup ambari-server

Copying /usr/share/java/mysql-connector-java.jar to /var/lib/ambari-server/resources

JDBC driver was successfully initialized.

Ambari Server 'setup' completed successfully.

nohup: ignoring input and appending output to `nohup.out'

Ambari Server failed to start

## Success! All done.

root@ico-svr hdp_install]# ambari-server start

Using python /usr/bin/python2.6 Starting ambari-server

ERROR: Exiting with exit code -1. REASON: DB Name property not set in config file.

- If this is a new setup, then run the "ambari-server setup" command to create the user - If this is an upgrade of an existing setup, run the "ambari-server upgrade" command. Refer to the Ambari documentation for more information on setup and upgrade.

Can any faced this issue , any help would be appreciated.

Thanks

Siva

6 REPLIES 6

Re: Ambari Setup Automation using MYSQL database

@Siva Konda

It may not be possible with msyql

http://docs.hortonworks.com/HDPDocuments/Ambari-2.2.0.0/bk_Installing_HDP_AMB/content/_setup_options...

-s (or --silent)Setup runs silently. Accepts all the default prompt values, such as:
  • User account "root" for the ambari-server
  • Oracle 1.8 JDK (which is installed at /usr/jdk64). This can be overridden by adding the -j option and specifying an existing JDK path.
  • Embedded PostgreSQL for Ambari DB (with database name "ambari")

If you want to run the Ambari Server as non-root, you must run setup in interactive mode. When prompted to customize the ambari-server user account, provide the account information. Refer to Configuring Ambari for Non-Root for more information.

Re: Ambari Setup Automation using MYSQL database

New Contributor

Hi Neeraj,

Thanks for the quick reply. My requirement is to force to use MySQL database. The hortonworks documentation says that you can specify the database that you want to..

http://docs.hortonworks.com/HDPDocuments/Ambari-2.1.1.0/bk_Installing_HDP_AMB/content/_setup_options...

Thanks

siva

Re: Ambari Setup Automation using MYSQL database

@Siva Konda Can you check this file? /etc/ambari-server/conf/ambari.properties

In my case

[root@phdns01 ~]# grep server.jdbc.database /etc/ambari-server/conf/ambari.properties

server.jdbc.database=postgres

server.jdbc.database_name=ambari

[root@phdns01 ~]#

Re: Ambari Setup Automation using MYSQL database

@Siva Konda

See this

I was able to reproduce the issue. As said earlier , -s will work with postgres only as it default db for ambari.

1546-screen-shot-2016-01-25-at-40301-pm.png


screen-shot-2016-01-25-at-40301-pm.png

Re: Ambari Setup Automation using MYSQL database

Mentor

@Siva Konda has this been resolved? Can you provide a solution or accept the best answer?

Re: Ambari Setup Automation using MYSQL database

@Siva Konda

[root@ambari yum.repos.d]# ambari-server start Using python /usr/bin/python Starting ambari-server ERROR: Exiting with exit code -1. REASON: DB Name property not set in config file. - If this is a new setup, then run the "ambari-server setup" command to create the user - If this is an upgrade of an existing setup, run the "ambari-server upgrade" command. Refer to the Ambari documentation for more information on setup and upgrade.

I faced same issue, but after running ambari-server upgrade command, I tried to start the ambari server and its started successfully.

[root@ambari 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 Embedded Postgres. Confirm you have made a backup of the Ambari Server database [y/n] (y)? y Upgrading database schema Adjusting ambari-server permissions and ownership... Ambari Server 'upgrade' completed successfully.

[root@ambari yum.repos.d]# ambari-server start Using python /usr/bin/python Starting ambari-server Ambari Server running with administrator privileges. Organizing resource files at /var/lib/ambari-server/resources... Server PID at: /var/run/ambari-server/ambari-server.pid Server out at: /var/log/ambari-server/ambari-server.out Server log at: /var/log/ambari-server/ambari-server.log Waiting for server start.................... Ambari Server 'start' completed successfully.

If this is resolved your issue. Lets close this thread so it will help to others.