You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ambari.apache.org by ๏̯͡๏ <ÐΞ€ρ@Ҝ>, de...@gmail.com on 2014/09/30 08:58:33 UTC

Full hostname not visibile in ambari web interface

I have few hosts that have novalocal instead of full hostname
Any suggestions to fix ?

Ex: invisio-365818.novalocal

-- 
Deepak

Re: Full hostname not visibile in ambari web interface

Posted by Alejandro Fernandez <af...@hortonworks.com>.
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, ÐΞ€ρ@Ҝ (๏̯͡๏) <de...@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
<af...@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.