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 , Full Administrator)
-
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.
- 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
- Preserve Cloudera Manager's GUID by running the following command to create a
/etc/cloudera-scm-server/uuid
file. On a host that has an agent, run:sudo -u postgres psql -qtAX scm -c "select GUID from CM_VERSION" > uuid
Then move the UUID file to Cloudera Manager server's
/etc/cloudera-scm-server
directory. - Stop the cluster and the Cloudera Management Services.
- Stop the Cloudera Manager Server:
sudo service cloudera-scm-server stop
- Prepare the target database for Cloudera Manager. For details, refer to the topics Install and Configure MySQL for Cloudera Software or Install and Configure Oracle Database for Cloudera Software.
- The process directory (
/var/run/cloudera-scm-agent/process/
) must be cleaned out for all of the hosts that have agents running on them. The agent completes this cleanup with a server reboot. However, if a server reboot is not a viable option, use one of the following options to accomplish the same task.-
- Stop the agent and
supervisor:
sudo systemctl stop cloudera-scm-agent
- Confirm that the agent and supervisor process are
stopped:
ps -ef | grep -i cmf-agent; ps -ef | grep -i supervisor
- Perform a clean
start:
service cloudera-scm-agent next_start_clean
Alternatively, run the following command to view the start options available on your platform:service cloudera-scm-agent clean_start
- Ensure that the process is
empty:
ls -la /var/run/cloudera-scm-agent/process/
- Stop the agent and
supervisor:
- Alternatively:
- Stop the agent and
supervisor:
sudo systemctl stop cloudera-scm-agent
- Confirm that the agent and supervisor process are
stopped:
ps -ef | grep -i cmf-agent; ps -ef | grep -i supervisor
- Move the existing
/var/run/cloudera-scm-agent/
directory:mv /var/run/cloudera-scm-agent /var/run/cloudera-scm-agent-BU
- Stop the agent and
supervisor:
The agent will recreate the directory. Delete the backed up copy after confirming that the migration was successful.
-
- Start the Cloudera Manager server:
service cloudera-scm-server start
- Log in to Cloudera Manager. Exit the installation wizard by clicking the product log in the upper-left corner to stop the wizard and return to the Cloudera Manager home page.
- Upgrade the Cloudera Manager Enterprise License by navigating to Administration > Licenses and installing a valid Cloudera Manager license.
- Restore the Cloudera Manager configuration:
The following example shows how to restore a 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"
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"
- 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.
- Select the Home > Status tab for the cluster(s) that you previously stopped, and in the Actions dropdown, select Start.