Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit 7a358b2

Browse files
committed
A number of changes:
Fixed user_data CloudInit formatting error with log function Renamed some scripts for easier recognition Rolled CMS and MySQL setup into Extended Metadata Created a small user_data boot script to pull down Extended Metadata scripts and execute Associated Terraform changes for extended metadata Stripped all un-necessary elements from deploy_on_oci.py to get under 32000 byte limit for CloudInit and leave some headroom for changes This includes removal of all cluster actions, support functions, etc which do not directly build a cluster (e.g. Delete, View config, etc)
1 parent 25f8ed3 commit 7a358b2

File tree

8 files changed

+78
-294
lines changed

8 files changed

+78
-294
lines changed

scripts/boot.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
22
LOG_FILE="/var/log/cloudera-OCI-initialize.log"
3-
log() { echo "$(date) [${EXECNAME}]: $*" >> "${LOG_FILE}" }
3+
log() {
4+
echo "$(date) [${EXECNAME}]: $*" >> "${LOG_FILE}"
5+
}
46
cm_fqdn=`curl -L http://169.254.169.254/opc/v1/instance/metadata/cloudera_manager`
57
cdh_version=`curl -L http://169.254.169.254/opc/v1/instance/metadata/cdh_version`
68
cdh_major_version=`echo $cdh_version | cut -d '.' -f1`

scripts/cloudera_manager.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

scripts/cloudera_manager_boot.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
LOG_FILE="/var/log/cloudera-OCI-initialize.log"
3+
log() {
4+
echo "$(date) [${EXECNAME}]: $*" >> "${LOG_FILE}"
5+
}
6+
EXECNAME="Metadata Extraction"
7+
log "->Deployment Script Decode"
8+
curl -L http://169.254.169.254/opc/v1/instance/metadata/deploy_on_oci | base64 -d >> deploy_on_oci.py.gz
9+
log "-->Extract"
10+
gunzip deploy_on_oci.py.gz >> $LOG_FILE
11+
log "->CMS Setup Script Decode"
12+
curl -L http://169.254.169.254/opc/v1/instance/metadata/cm_install | base64 -d >> cms_mysql.sh.gz
13+
log"-->Extract"
14+
gunzip cms_mysql.sh.gz
15+
chmod +x cms_mysql.sh
16+
EXECNAME="CMS Setup"
17+
log "->Execute"
18+
./cms_mysql.sh

scripts/cm_boot_mysql.sh renamed to scripts/cms_mysql.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/bin/bash
2+
23
LOG_FILE="/var/log/cloudera-OCI-initialize.log"
3-
log() { echo "$(date) [${EXECNAME}]: $*" >> "${LOG_FILE}" }
4+
log() {
5+
echo "$(date) [${EXECNAME}]: $*" >> "${LOG_FILE}"
6+
}
47
cm_fqdn=`curl -L http://169.254.169.254/opc/v1/instance/metadata/cloudera_manager`
58
cm_ip=`host ${cm_fqdn} | gawk '{print $4}'`
69
cdh_version=`curl -L http://169.254.169.254/opc/v1/instance/metadata/cdh_version`
@@ -384,6 +387,6 @@ for w in `seq 1 $num_workers`; do
384387
fi
385388
done;
386389
echo "curl -L http://169.254.169.254/opc/v1/instance/metadata/deploy_on_oci | base64 -d " >> $LOG_FILE
387-
echo "python deploy_on_oci.py -B -S -m ${cm_ip} -i ${worker_fqdn_list} -d ${worker_disk_count} -w ${worker_shape} -n ${num_workers} -cdh ${cdh_version} -ad ${availability_domain}" >> $LOG_FILE
390+
echo "python deploy_on_oci.py -S -m ${cm_ip} -i ${worker_fqdn_list} -d ${worker_disk_count} -w ${worker_shape} -n ${num_workers} -cdh ${cdh_version} -ad ${availability_domain}" >> $LOG_FILE
388391
EXECNAME="END"
389392
log "->DONE"
File renamed without changes.

0 commit comments

Comments
 (0)