Changing Hostnames

Minimum Required Role: Full Administrator

After you have installed Cloudera Manager and created a cluster, you may need to update the names of the hosts running the Cloudera Manager Server or cluster services. To update a deployment with new hostnames, follow these steps:
  1. Verify if TLS/SSL certificates have been issued for any of the services and make sure to create new TLS/SSL certificates in advance for services protected by TLS/SSL. See Configuring Encryption.
  2. Export the Cloudera Manager configuration using one of the following methods:
    • Open a browser and go to this URL http://cm_hostname:7180/api/api_version/cm/deployment. Save the displayed configuration.
    • From terminal type:

      $ curl -u admin:admin http://cm_hostname:7180/api/api_version/cm/deployment > cme-cm-export.json

      If Cloudera Manager SSL is in use, specify the -k switch:

      $ curl -k -u admin:admin http://cm_hostname:7180/api/api_version/cm/deployment > cme-cm-export.json

    where cm_hostname is the name of the Cloudera Manager host and api_version is the correct version of the API for the version of Cloudera Manager you are using. For example, http://tcdn5-1.ent.cloudera.com:7180/api/v11/cm/deployment.
  3. Stop all services on the cluster.
  4. Stop the Cloudera Management Service.
  5. Stop the Cloudera Manager Server.
  6. Stop the Cloudera Manager Agents on the hosts that will be having the hostname changed.
  7. Back up the Cloudera Manager Server database using mysqldump, pg_dump, or another preferred backup utility. Store the backup in a safe location.
  8. Update names and principals:
    1. Update the target hosts using standard per-OS/name service methods (/etc/hosts, dns, /etc/sysconfig/network, hostname, and so on). Ensure that you remove the old hostname.
    2. If you are changing the hostname of the host running Cloudera Manager Server do the following:
      1. Change the hostname per step 8.a.
      2. Update the Cloudera Manager hostname in /etc/cloudera-scm-agent/config.ini on all Agents.
    3. If the cluster is configured for Kerberos security, do the following:
      1. Remove the old hostname cluster principals.
        • If you are using an MIT KDC, remove old hostname cluster service principals from the KDC database using one of the following:
          • Use the delprinc command within kadmin.local interactive shell.

            OR

          • From the command line:
            kadmin.local -q "listprincs" | grep -E "(HTTP|hbase|hdfs|hive|httpfs|hue|impala|mapred|solr|oozie|yarn|zookeeper)[^/]*/[^/]*@" > cluster-princ.txt

            Open cluster-princ.txt and remove any noncluster service principal entries. Make sure that the default krbtgt and other principals you created, or that were created by Kerberos by default, are not removed by running the following: for i in `cat cluster-princ.txt`; do yes yes | kadmin.local -q "delprinc $i"; done.

        • For an Active Directory KDC, an AD administrator must manually delete the principals for the old hostname from Active Directory.
      2. Start the Cloudera Manager database and Cloudera Manager Server.
      3. Start the Cloudera Manager Agents on the newly renamed hosts. The Agents should show a current heartbeat in Cloudera Manager.
      4. Within the Cloudera Manager Admin Console click the Hosts tab.
      5. Select the checkbox next to the host with the new name.
      6. Select Actions > Regenerate Keytab.
  9. If one of the hosts that was renamed has a NameNode configured with high availability and automatic failover enabled, reconfigure the ZooKeeper Failover Controller znodes to reflect the new hostname.
    1. Start ZooKeeper Servers.
    2. On one of the hosts that has a ZooKeeper Server role, run zookeeper-client.
      1. If the cluster is configured for Kerberos security, configure ZooKeeper authorization as follows:
        1. Go to the HDFS service.
        2. Click the Instances tab.
        3. Click the Failover Controller role.
        4. Click the Process tab.
        5. In the Configuration Files column of the hdfs/hdfs.sh ["zkfc"] program, expand Show.
        6. Inspect core-site.xml in the displayed list of files and determine the value of the ha.zookeeper.auth property, which will be something like: digest:hdfs-fcs:TEbW2bgoODa96rO3ZTn7ND5fSOGx0h. The part after digest:hdfs-fcs: is the password (in the example it is TEbW2bgoODa96rO3ZTn7ND5fSOGx0h)
        7. Run the addauth command with the password:
          addauth digest hdfs-fcs:TEbW2bgoODa96rO3ZTn7ND5fSOGx0h
      2. Verify that the HA znode exists: ls /hadoop-ha.
      3. Delete the HDFS znode: rmr /hadoop-ha/nameservice1.
      4. If you are not running JobTracker in a high availability configuration, delete the HA znode: rmr /hadoop-ha.
    3. In the Cloudera Manager Admin Console, go to the HDFS service.
    4. Click the Instances tab.
    5. Select Actions > Initialize High Availability State in ZooKeeper....
  10. Update the Hive metastore:
    1. Back up the Hive metastore database.
    2. Go the Hive service.
    3. Select Actions > Update Hive Metastore NameNodes and confirm the command.
  11. Update the Database Hostname property for each of the cluster roles for which a database is located on the host being renamed. This is required for both Cloudera Management Service roles (Reports Manager, Activity Monitor, Navigator Audit and Metadata Server) and for cluster services such as Hue, Hive, and so on.
  12. Start all cluster services.
  13. Start the Cloudera Management Service.
  14. Deploy client configurations.