ambari-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alejandro Fernandez <afernan...@hortonworks.com>
Subject Re: Full hostname not visibile in ambari web interface
Date Tue, 30 Sep 2014 17:59:57 GMT
I just created AMBARI-7562
<https://issues.apache.org/jira/browse/AMBARI-7562> to provide an
API/utility to change the hostname.

If you're feeling brave,

Ambari does not currently support changing host names through Ambari UI. As
a result, users need to follow a procedure to change the host name in the
Ambari database. The procedure essentially does an Ambari database dump,
and changes all occurrences of the old host name to the new host name, then
restores the data back into the database. The following procedure can be
used to change host name in the Ambari database.

1. Stop all services through Ambari UI.
2. Stop ambari-server on Ambari server host from command line, please run:

> ambari-server stop

3. Stop ambari-agent on all of the hosts from command line, please run:

> ambari-agent stop

4. Backup database on the Ambari server from command line, please run:

> mkdir /var/db_backup
> cd /var/db_backup

Postgres

> pg_dump -U ambari ambari > ambari1.sql (default password: bigdata)
> pg_dump -U mapred ambarirca > ambarirca1.sql (default password: mapred)

MySQL

In Linux, the MySQL databases are stored in /var/lib/mysql by default.

> mysqldump -u ambari ambari > ambari1.sql (default password: bigdata)

5. Replace all occurrences of old hostname with new hostname.

For example:

> sed 's/old-hostname/new-hostname/g' ambari1.sql > ambari2.sql
> sed 's/old-hostname/new-hostname/g' ambarirca1.sql > ambarirca2.sql (not
needed when using MySQL)

Warning: Use tools that are appropriate for you. Please be careful to not
accidentally replace unintended strings in the database data.

6. Clean up Ambari database from command line, please run:

> ambari-server reset

7. Recreate Ambari database from command line, please run:

Postgres

> su postgres -c 'psql -c "drop database ambari" '
> su postgres -c 'psql -c "drop database ambarirca" '
> su postgres -c 'psql -c "create database ambari" '
> su postgres -c 'psql -c "create database ambarirca" '

MySQL

> mysql -u ambari -pbigdata
mysql> DROP DATABASE ambari;
mysql> CREATE DATABASE ambari;
mysql> exit;

8. Load into Ambari database with the modified database generated in step 5
and run the following commands:

Postgres

> su postgres -c 'psql -f ambari2.sql -d ambari'
> su postgres -c 'psql -f ambarirca2.sql -d ambarirca'

MySQL

> mysql -u ambari -pbigdata ambari < ambari2.sql (default password: bigdata)

9. Start ambari-server on Ambari server host from command line, please run:

> ambari-server start

10. Start ambari-agent on all of the hosts from command line, please run:

> ambari-agent start
Note: if using Vagrant and CentOS, can run ./control-agents.sh <num> (if
the highest agent name is c6403, then num is 3. The command will be start).
11. Verify that Ambari shows new host name. Restart all services through
Ambari UI.

Note: This procedure does not modify any database that is used by Hadoop
components such as Hive metastore database or Oozie database. If database
access were granted to old hosts, you may need to grant permissions to the
new host before starting the Hadoop service.

On Mon, Sep 29, 2014 at 11:58 PM, ÐΞ€ρ@Ҝ (๏̯͡๏) <deepujain@gmail.com> wrote:

> I have few hosts that have novalocal instead of full hostname
> Any suggestions to fix ?
>
> Ex: invisio-365818.novalocal
>
> --
> Deepak
>
>


-- 
[image: Hortonworks, Inc.] <http://hortonworks.com/> *Alejandro Fernandez
<afernandez@hortonworks.com>**Engineering - Ambari*
786.303.7149

-- 
CONFIDENTIALITY NOTICE
NOTICE: This message is intended for the use of the individual or entity to 
which it is addressed and may contain information that is confidential, 
privileged and exempt from disclosure under applicable law. If the reader 
of this message is not the intended recipient, you are hereby notified that 
any printing, copying, dissemination, distribution, disclosure or 
forwarding of this communication is strictly prohibited. If you have 
received this communication in error, please contact the sender immediately 
and delete it from your system. Thank You.

Mime
View raw message