Migrate from the Cloudera Manager External PostgreSQL Database Server to a MySQL/Oracle Database Server

When you migrate from the Cloudera Manager external PostgreSQL database server to a MySQL or Oracle database server, you export the Cloudera Manager configuration, prepare the target database for Cloudera Manager, and complete other tasks.

Minimum Required Role: Operator (also provided by Configurator, Cluster Administrator, Limited Cluster Administrator , and Full Administrator)

  1. Migrate from the embedded PostgreSQL database server to an external PostgreSQL database server as described in the topic Migrating from the Cloudera Manager Embedded PostgreSQL Database Server to an External PostgreSQL Database.
  2. Upgrade the Cloudera Manager enterprise license by navigating to Administration > Licenses and installing a valid Cloudera Manager license.
  1. Perform the following steps to disable redaction by setting a JVM parameter:
    1. Log in the Cloudera Manager server host using ssh.
    2. Edit the /etc/default/cloudera-scm-server file by adding the following property (separate each property with a space) to the line that begins with export CMF_JAVA_OPTS.
      -Dcom.cloudera.api.redaction=false
      For example:
      export CMF_JAVA_OPTS="-Xmx2G -Dcom.cloudera.api.redaction=false"
    3. Restart Cloudera Manager Server:
      sudo systemctl restart cloudera-scm-server
  2. Export your Cloudera Manager Configuration. First, get the latest supported API version:
    curl -u <admin_username>:<admin_password> "http://<cm_server_host>:7180/api/version"
    curl -u <admin_username>:<admin_password> "http://<cm_server_host>:7180/api/<api_version> /cm/deployment" > <path_to_file>/cm-deployment.json

    The following is an example of the API version command:

    curl -u admin:admin "http://10.17.103.191:7180/api/v19/cm/deployment" > /root/cm-deployment.json
  3. Preserve Cloudera Manager's GUID by running the following command on the Cloudera Manager server to create a /etc/cloudera-scm-server/uuid file:
    sudo -u postgres psql -qtAX scm -c "select GUID from CM_VERSION" > uuid
    Move the UUID file to Cloudera Manager server's /etc/cloudera-scm-server directory.
    sudo mv uuid /etc/cloudera-scm-server/
  4. Stop the cluster and the Cloudera Management services. For details, see Starting, Stopping, Refreshing, and Restarting a Cluster and Stopping the Cloudera Management Service.
  5. Run the following command to stop the Cloudera Manager server:
    sudo systemctl stop cloudera-scm-server
  6. Prepare the target database for Cloudera Manager. For details, see Install and Configure MySQL for Cloudera Software or Install and Configure Oracle Database for Cloudera Software.
  7. Run the following command to obtain the value of the GUID:
    cat /etc/cloudera-scm-server/uuid
  8. Insert the GUID returned from the previous command into MySQL or Oracle as follows:
    1. Run the following command to login to MySQL:
      sudo -u mysql -p <name_of_cm_database>
    2. Run the following command to login to Oracle:
      sqlplus system@localhost
      Enter password: [***password***]
    3. Run the following command to update the GUID:
      update cm_version set guid = '[***GUID***]’
  9. The process directory (/var/run/cloudera-scm-agent/process/) must be cleaned out for all hosts with agents running on them. The agent completes this cleanup with a server reboot. However, if a server reboot is not a viable option, do the following steps to accomplish the same task.
    1. Run the following command on all hosts to stop the agent and supervisor:
      sudo systemctl stop cloudera-scm-agent
    2. Run the following command to confirm that the agent and supervisor processes are stopped:
      ps -ef | grep -i cmf-agent; ps -ef | grep -i supervisor
    3. Move the existing /var/run/cloudera-scm-agent/ directory:
      mv /var/run/cloudera-scm-agent /var/run/cloudera-scm-agent-BU

      The agent recreates the directory. Delete the backed-up copy after confirming that the migration was successful.

    4. Run the following command on all hosts to start the agent and supervisor:
      sudo systemctl start cloudera-scm-agent
  10. Run the following command to start the Cloudera Manager server:
    sudo systemctl start cloudera-scm-server
  11. Login to Cloudera Manager. Exit the installation wizard by clicking the product logo in the upper-left corner to stop the wizard and return to the Cloudera Manager home page.
  12. Run the following command to restore the Cloudera Manager configuration:
    curl -H "Content-Type: application/json" --upload-file <path_to_file>/cm-deployment.json -u <admin_username>:<admin_password> "http://<cm_server_host>:7180/api/<api_version>/cm/deployment?deleteCurrentDeployment=true"
    The following example shows how to restore a Cloudera Manager configuration:
    curl -H "Content-Type: application/json" --upload-file /root/cm-deployment.json -u admin:admin "http://172.31.113.146:7180/api/v19/cm/deployment?deleteCurrentDeployment=true"
  13. Start the following: Cloudera Management Service, Host Monitor, and Services Monitor. Verify that all the services in the Cloudera Management Service started and are Healthy. For details, see Starting the Cloudera Management Service and Starting and Stopping Cloudera Management Service Roles.
  14. Go to Home > Status and select the cluster(s) that you previously stopped, and select Start from the Actions drop-down menu.