loading table of contents...

Chapter 4. Changing Host Names

In some situations, after you have created your cluster you might require changing the hostnames of the hosts. In addition to any infrastructure and environment changes you need to make, you also need to change the host names that Ambari is using to manage the HDP cluster. Use this procedure to change the host names in Ambari.

[Important]Important

It is critical that you make a backup of your Ambari database prior to executing this procedure.

  1. You must disable Kerberos prior to executing this procecure.

    Using Ambari Web, browse to Admin > Kerberos and click Disable Kerberos.

  2. In the Ambari Background Operations dialog, stop all pending commands and jobs.

  3. Stop all services.

  4. Backup the Ambari database.

  5. Stop ambari-server and ambari-agents on all hosts.

    ambari-server stop

    ambari-agent stop

  6. Create *.json file with host names changes.

    Example: host_names_changes.json

    {
      "cluster1" : {
          "c6400.ambari.apache.org" : "c6410.ambari.apache.org",
          "c6401.ambari.apache.org" : "c6411.ambari.apache.org",
         ....
      }
    }

    where cluster1 is cluster name and "c6400.ambari.apache.org" : "c6410.ambari.apache.org"is the host names pair in the format "current_host_name" : "new_host_name".

  7. Execute the following command on the ambari-server host:

    ambari-server update-host-names host_names_changes.json
  8. After successful end of this action, please update host names for all nodes, according to changes that you added to *.json file.

  9. If you changed the host name for the node on which the ambari server resides, then you must update that name for every ambari-agent.

    In /etc/ambari-agent/conf/ambari-agent.ini, update the "hostname" field to the new host name for node on which the ambari-server resides.

  10. Start ambari-server and ambari-agents on all hosts.

    ambari-server start

    ambari-agent start

  11. Start all services, using Ambari Web.

    For each, browse to Services > <service_name> > Service Actions, choose Start.

    [Note]Note

    If you have NameNode HA enabled, after starting the ZooKeeper service, you must:

    1. Start all ZooKeeper components.

    2. Execute the following command on both NameNode hosts:

      hdfs zkfc -formatZK -force
  12. If you disabled Kerberos before starting this procedure, you must Enable Kerberos Security by working through either the automated or manual setup documented in Hortonworks Data Platform Apache Ambari Security.

    [Note]Note

    If you enable Kerberos with the manual option, you must be sure to generate and deploy new keytabs that contain the new host names.