Skip to content

Instantly share code, notes, and snippets.

View krishnachaitanyareddy's full-sized avatar

Krishna Chaitanya krishnachaitanyareddy

  • Adobe Inc
  • Austin
View GitHub Profile
@krishnachaitanyareddy
krishnachaitanyareddy / delete_table_from_metastore.sql
Created February 28, 2024 20:19 — forked from robcowie/delete_table_from_metastore.sql
Drop a table form the hive metastore
# DELETE A TABLE IN THE HIVE METASTORE
# BE CAREFUL! BACKUP THE DB BEFORE PROCEEDING!
set @table_name = '';
SELECT @tbl_id := TBl_ID FROM TBLS WHERE TBL_NAME = @table_name;
-- Delete partition key vals
DELETE pvk
FROM PARTITION_KEY_VALS pvk
@krishnachaitanyareddy
krishnachaitanyareddy / log_deployment.sh
Created June 22, 2017 07:18 — forked from Martlark/log_deployment.sh
Simple script to get logs from the pods of a deployment
#!/usr/bin/env bash
DEPLOYMENT=$1
for p in $(kubectl get pods | grep ^${DEPLOYMENT}- | cut -f 1 -d ' '); do
echo ---------------------------
echo $p
echo ---------------------------
kubectl logs $p
done
These are the steps that you need to follow in order to migrate scm database from PostgreSQL to MySQL - let me know if you need assistance or have any further questions.
1. Stop all cluster services including the Cloudera Manager monitoring services and Agents on all hosts, using the Cloudera Manager UI.
2. Invoke the API call to /api/v4/cm/deployment. Example that directs the resulting output to a file for later use:
$ curl -v -u admin:password http://your_cloudera_manager_host:7180/api/v4/cm/deployment > path/to/file
Note: It is critical this file be retained and protected as it will be needed to re-import the functional configuration into the new database.
3. Take a fail-safe database backup from the embedded postgres database or make a tarball (or other copy) of the /var/lib/cloudera-scm-server-db/ directory to a safe location. Either will accomplish the needed outcome, just pick the most convenient for your environment. And backup contents of the directory /etc/cloudera-scm-server/*
4. On the serv