Quick update -- there's actually more to do.
THIS IS ALL UNSUPPORTED AND AT YOUR OWN RISK. BE WARNED!
Disable DB Encryption
- Stop cloudera-director-server.
systemctl stop cloudera-director-server
- Disable database encryption with these settings in /etc/cloudera-director-server/application.properties. This assumes a default install, with default keys.
lp.encryption.twoWayCipher: transitional
lp.encryption.twoWayCipherConfig: desede;ZGVmYXVsdGRpcmVjdG9yZGVzZWRla2V5|passthrough;
- Start cloudera-director-server and wait a few minutes so that the database decrypts.
systemctl start cloudera-director-server
- Log in to the director database.
mysql -h --ssl-ca=/etc/cloudera-director-server/rds-combined-ca-bundle.pem --ssl-verify-server-cert -u director -p
- Run the following query to verify that the database is decrypted. You should see plaintext values in the response.
USE director;
SELECT TEMPLATE FROM EXTERNAL_DATABASE_SERVERS;
Here is an example response (truncated and redacted):
+-------...-----+
| TEMPLATE ... |
| {"name":"my-manager-db","type":"MYSQL","host":"1.2.3.4","port":null,"adminUser":"my_username","adminPassword":"my_password","config":{"engineVersion":"5.6.37","allocatedStorage":"20","multiAZ":"false","vpcSecurityGroupIds":"sg-1234567a","dbSubnetGroupName":"my-rds-subnet-group","instanceClass":"db.m4.large","storageEncrypted":"true"},"tags":{}} |
+-------...-----+
Update the database
Before we actually edit the hostname, we should have Director update the misc database properties.
- Stop cloudera-director-server.
systemctl stop cloudera-director-server
- Log in to the director database.
mysql -h --ssl-ca=/etc/cloudera-director-server/rds-combined-ca-bundle.pem --ssl-verify-server-cert -u director -p
- Run the following query to enable 'refreshExternalDatabaseServersOnStart'.
USE director;
UPDATE SERVER_CONFIGS SET CONFIG_VALUE = 'true' WHERE CONFIG_KEY = 'refreshExternalDatabaseServersOnStart';
- Start cloudera-director-server.
systemctl start cloudera-director-server
- Login to the director web interface and check the database servers. In a few minutes, you should see updated properties (versions become accurate, etc).
- Once the databases look updated, stop cloudera-director-server.
systemctl stop cloudera-director-server
- Run the following query to disable 'refreshExternalDatabaseServersOnStart'. Otherwise, director will overwrite the new hostname with the old IP address on every startup.
USE director;
UPDATE SERVER_CONFIGS SET CONFIG_VALUE = 'false' WHERE CONFIG_KEY = 'refreshExternalDatabaseServersOnStart';
- We will need to update both the 'TEMPLATE' and 'EXTERNAL_DATABASE_SERVER' properties. I prefer to work on one field at a time.
Run the following query gather the current database template properties, which will will be modifying and then updating.
USE director;
SELECT TEMPLATE FROM EXTERNAL_DATABASE_SERVERS;
- Carefully copy the output into a text editor, and update the json accordingly.
- Validate the new property using jq. You should see pretty json output.
echo '{new long json string}' | jq .
- Run the following query update the database template property. BE WARNED that if you have multiple DB servers listed, it's super important that the WHERE clause be correct or you'll overwrite all the DB's with the new value.
USE director;
UPDATE EXTERNAL_DATABASE_SERVERS SET TEMPLATE = '{new long json string}' WHERE NAME = 'my-manager-db';
- Perform the same steps for the EXTERNAL_DATABASE_SERVER field. Example:
SELECT EXTERNAL_DATABASE_SERVER FROM EXTERNAL_DATABASE_SERVERS;
<echo '{new long strong}' | jq .
UPDATE EXTERNAL_DATABASE_SERVERS SET EXTERNAL_DATABASE_SERVER = '{new long strong}' WHERE NAME = 'my-manager-db';
- Start cloudera-director-server and hope for the best.
If everything looks good -- stop cloudera server, re-enable encryption, and start cloudera server back up.