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

Commit 37e1a7f

Browse files
committed
Fixed Kerberos deployment, added HA variable so this is no longer coupled directly with secure cluster install.
1 parent a7abcd7 commit 37e1a7f

File tree

6 files changed

+87
-57
lines changed

6 files changed

+87
-57
lines changed

compute.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module "bastion" {
22
source = "modules/bastion"
3-
instances = "1"
3+
instances = "${var.bastion_node_count}"
44
region = "${var.region}"
55
compartment_ocid = "${var.compartment_ocid}"
66
subnet_id = "${module.network.bastion-id}"
@@ -41,6 +41,7 @@ module "utility" {
4141
block_volume_count = "${var.block_volumes_per_worker}"
4242
AD = "${var.availability_domain}"
4343
deployment_type = "${var.deployment_type}"
44+
hdfs_ha = "${var.hdfs_ha}"
4445
cluster_name = "${var.cluster_name}"
4546
}
4647

schema.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ groupings:
1616
- ${deployment_type}
1717
- ${log_volume_size_in_gbs}
1818
- ${cloudera_volume_size_in_gbs}
19+
- title: "High Availability"
20+
variables:
21+
- ${hdfs_ha}
22+
visible:
23+
not:
24+
- eq:
25+
- ${deployment_type}
26+
- "simple"
1927
- title: "Worker Node Options"
2028
variables:
2129
- ${worker_instance_shape}
@@ -40,6 +48,7 @@ groupings:
4048
- title: "Edge Node Options"
4149
variables:
4250
- ${bastion_instance_shape}
51+
- ${bastion_node_count}
4352

4453
- title: "Pre-Defined"
4554
variables:
@@ -106,6 +115,15 @@ variables:
106115
title: "Deployment Type"
107116
required: true
108117

118+
hdfs_ha:
119+
type: enum
120+
enum:
121+
- "True"
122+
- "False"
123+
title: "High Availability"
124+
description: "Enable High Availability?"
125+
required: true
126+
109127
worker_instance_shape:
110128
type: enum
111129
enum:
@@ -179,6 +197,13 @@ variables:
179197
title: "Shape of Edge Nodes"
180198
required: true
181199

200+
bastion_node_count:
201+
type: integer
202+
title: "Number of Edge Nodes"
203+
description: "Enter a number, 0 to service limit of shape"
204+
minimum: 0
205+
required: true
206+
182207
ssh_public_key:
183208
type: string
184209
title: "SSH Public Key"

scripts/boot.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,24 @@ includedir /etc/krb5.conf.d/
5353
[domain_realm]
5454
.${realm} = ${REALM}
5555
${realm} = ${REALM}
56+
bastion1.cdhvcn.oraclevcn.com = ${REALM}
57+
.bastion1.cdhvcn.oraclevcn.com = ${REALM}
58+
bastion2.cdhvcn.oraclevcn.com = ${REALM}
59+
.bastion2.cdhvcn.oraclevcn.com = ${REALM}
60+
bastion3.cdhvcn.oraclevcn.com = ${REALM}
61+
.bastion3.cdhvcn.oraclevcn.com = ${REALM}
62+
.public1.cdhvcn.oraclevcn.com = ${REALM}
63+
public1.cdhvcn.oraclevcn.com = ${REALM}
64+
.public2.cdhvcn.oraclevcn.com = ${REALM}
65+
public2.cdhvcn.oraclevcn.com = ${REALM}
66+
.public3.cdhvcn.oraclevcn.com = ${REALM}
67+
public3.cdhvcn.oraclevcn.com = ${REALM}
68+
.private1.cdhvcn.oraclevcn.com = ${REALM}
69+
private1.cdhvcn.oraclevcn.com = ${REALM}
70+
.private2.cdhvcn.oraclevcn.com = ${REALM}
71+
private2.cdhvcn.oraclevcn.com = ${REALM}
72+
.private3.cdhvcn.oraclevcn.com = ${REALM}
73+
private3.cdhvcn.oraclevcn.com = ${REALM}
5674
5775
[kdc]
5876
profile = /var/kerberos/krb5kdc/kdc.conf

scripts/cms_mysql.sh

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ availability_domain=`curl -L http://169.254.169.254/opc/v1/instance/metadata/ava
1414
worker_shape=`curl -L http://169.254.169.254/opc/v1/instance/metadata/worker_shape`
1515
worker_disk_count=`curl -L http://169.254.169.254/opc/v1/instance/metadata/block_volume_count`
1616
deployment_type=`curl -L http://169.254.169.254/opc/v1/instance/metadata/deployment_type`
17+
hdfs_ha=`curl -L http://169.254.169.254/opc/v1/instance/metadata/hdfs_ha`
1718
cluster_name=`curl -L http://169.254.169.254/opc/v1/instance/metadata/cluster_name`
1819
EXECNAME="TUNING"
1920
log "-> START"
@@ -46,7 +47,7 @@ log "-> INSTALL"
4647
yum -y install krb5-server krb5-libs krb5-workstation >> $LOG_FILE
4748
KERBEROS_PASSWORD="SOMEPASSWORD"
4849
SCM_USER_PASSWORD="somepassword"
49-
kdc_server=${cm_fqdn}
50+
kdc_fqdn=${cm_fqdn}
5051
realm="hadoop.com"
5152
REALM="HADOOP.COM"
5253
log "-> CONFIG"
@@ -78,6 +79,24 @@ includedir /etc/krb5.conf.d/
7879
[domain_realm]
7980
.${realm} = ${REALM}
8081
${realm} = ${REALM}
82+
bastion1.cdhvcn.oraclevcn.com = ${REALM}
83+
.bastion1.cdhvcn.oraclevcn.com = ${REALM}
84+
bastion2.cdhvcn.oraclevcn.com = ${REALM}
85+
.bastion2.cdhvcn.oraclevcn.com = ${REALM}
86+
bastion3.cdhvcn.oraclevcn.com = ${REALM}
87+
.bastion3.cdhvcn.oraclevcn.com = ${REALM}
88+
.public1.cdhvcn.oraclevcn.com = ${REALM}
89+
public1.cdhvcn.oraclevcn.com = ${REALM}
90+
.public2.cdhvcn.oraclevcn.com = ${REALM}
91+
public2.cdhvcn.oraclevcn.com = ${REALM}
92+
.public3.cdhvcn.oraclevcn.com = ${REALM}
93+
public3.cdhvcn.oraclevcn.com = ${REALM}
94+
.private1.cdhvcn.oraclevcn.com = ${REALM}
95+
private1.cdhvcn.oraclevcn.com = ${REALM}
96+
.private2.cdhvcn.oraclevcn.com = ${REALM}
97+
private2.cdhvcn.oraclevcn.com = ${REALM}
98+
.private3.cdhvcn.oraclevcn.com = ${REALM}
99+
private3.cdhvcn.oraclevcn.com = ${REALM}
81100
82101
[kdc]
83102
profile = /var/kerberos/krb5kdc/kdc.conf
@@ -388,6 +407,11 @@ for w in `seq 1 $num_workers`; do
388407
done;
389408
log "-->Host List: ${fqdn_list}"
390409
log "-->Cluster Build"
391-
log "---> python /var/lib/cloud/instance/scripts/deploy_on_oci.py -D ${deployment_type} -m ${cm_ip} -i ${fqdn_list} -d ${worker_disk_count} -w ${worker_shape} -n ${num_workers} -cdh ${cdh_version} -ad ${availability_domain} -N ${cluster_name}"
392-
python /var/lib/cloud/instance/scripts/deploy_on_oci.py -D ${deployment_type} -m ${cm_ip} -i ${fqdn_list} -d ${worker_disk_count} -w ${worker_shape} -n ${num_workers} -cdh ${cdh_version} -ad ${availability_domain} -N ${cluster_name} 2>&1 1>> $LOG_FILE
410+
if [ $hdfs_ha = "True" ]; then
411+
log "---> python /var/lib/cloud/instance/scripts/deploy_on_oci.py -D ${deployment_type} -H -m ${cm_ip} -i ${fqdn_list} -d ${worker_disk_count} -w ${worker_shape} -n ${num_workers} -cdh ${cdh_version} -ad ${availability_domain} -N ${cluster_name}"
412+
python /var/lib/cloud/instance/scripts/deploy_on_oci.py -D ${deployment_type} -H -m ${cm_ip} -i ${fqdn_list} -d ${worker_disk_count} -w ${worker_shape} -n ${num_workers} -cdh ${cdh_version} -ad ${availability_domain} -N ${cluster_name} 2>&1 1>> $LOG_FILE
413+
else
414+
log "---> python /var/lib/cloud/instance/scripts/deploy_on_oci.py -D ${deployment_type} -m ${cm_ip} -i ${fqdn_list} -d ${worker_disk_count} -w ${worker_shape} -n ${num_workers} -cdh ${cdh_version} -ad ${availability_domain} -N ${cluster_name}"
415+
python /var/lib/cloud/instance/scripts/deploy_on_oci.py -D ${deployment_type} -m ${cm_ip} -i ${fqdn_list} -d ${worker_disk_count} -w ${worker_shape} -n ${num_workers} -cdh ${cdh_version} -ad ${availability_domain} -N ${cluster_name} 2>&1 1>> $LOG_FILE
416+
fi
393417
log "->DONE"

scripts/deploy_on_oci.py

Lines changed: 7 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
data_tiering = 'False'
3131
nvme_disks = 0
3232
deployment_type = 'simple' # type: str
33+
availability_domain = 'None'
3334
# Custom Global Parameters - Customize below here
3435
debug = 'False' # type: str
3536
# Define new admin username and password for Cloudera Manager
@@ -42,7 +43,7 @@
4243
cluster_primary_version = ' '
4344
kafka_parcel_url = ' '
4445
secure_cluster = 'True' # type: bool
45-
hdfs_ha = 'True' # type: bool
46+
hdfs_ha = 'False' # type: bool
4647
# These should match what is in the Cloudera Manager CloudInit bootstrap file and instance boot files
4748
realm = 'HADOOP.COM'
4849
kdc_admin = 'cloudera-scm@HADOOP.COM'
@@ -592,29 +593,6 @@ def monitor_parcel(parcel_product, parcel_version, target_stage):
592593
print('\n\n')
593594

594595

595-
def read_parcels():
596-
"""
597-
List all parcels the cluster has access to
598-
:return:
599-
"""
600-
try:
601-
api_response = parcels_api.read_parcels(cluster_name, view='FULL')
602-
pprint(api_response)
603-
except ApiException as e:
604-
print('Exception calling ParcelResourceApi->read_parcels {}'.format(e))
605-
606-
607-
def delete_parcel(parcel_product, parcel_version):
608-
"""
609-
Delete specified parcel
610-
:param parcel_product: Parcel Product Name - e.g. CDH, SPARK_ON_YARN
611-
:param parcel_version: Version of Parcel
612-
:return:
613-
"""
614-
parcel_api.start_removal_of_distribution_command(cluster_name, parcel_product, parcel_version)
615-
parcel_api.remove_download_command(cluster_name, parcel_product, parcel_version)
616-
617-
618596
def restart_cluster():
619597
"""
620598
Restart Cluster
@@ -771,19 +749,6 @@ def begin_trial():
771749
print('Exception calling ClouderaManagerResourceApi -> begin_trial: {}\n'.format(e))
772750

773751

774-
def end_trial():
775-
"""
776-
End Trial License
777-
:return:
778-
"""
779-
try:
780-
api_response = cloudera_manager_api.end_trial()
781-
if debug == 'True':
782-
pprint(api_response)
783-
except ApiException as e:
784-
print('Exception calling ClouderaManagerResourceApi -> end_trial: {}\n'.format(e))
785-
786-
787752
def update_mgmt_rcg(rcg_name, role, display_name, rcg_config):
788753
"""
789754
Create Management Services using api_mgmt_service_list
@@ -1531,19 +1496,6 @@ def create_mgmt_roles(mgmt_rcg, mgmt_rcg_roletype, mgmt_host_id, mgmt_hostname,
15311496
print('Exception calling MgmtRolesResourceApi -> create_roles {}\n'.format(e))
15321497

15331498

1534-
def lookup_host_uuid(hostname):
1535-
"""
1536-
Search cluster_host_list for a specific hostname - depends on list_hosts()
1537-
:param hostname: Hostname to return UUID for
1538-
:return:
1539-
"""
1540-
for x in range(0, len(cluster_host_list.items)):
1541-
if hostname in cluster_host_list.items[x].hostname:
1542-
print(cluster_host_list.items[x].host_id)
1543-
else:
1544-
pass
1545-
1546-
15471499
def cluster_action(action, *kwargs):
15481500
"""
15491501
Execute a cluster action
@@ -1966,7 +1918,7 @@ def config_mgmt_for_kerberos():
19661918
Setup Cloudera Manager Kerberos Configuration
19671919
:return:
19681920
"""
1969-
cm_fqdn = cm_hostname + 'public' + availability_domain + '.cdhvcn.oraclevcn.com'
1921+
cm_fqdn = cm_hostname
19701922
KDC_ADMIN_HOST = cm_client.ApiConfig(name='KDC_ADMIN_HOST', value=cm_fqdn)
19711923
KDC_ADMIN_PASSWORD = cm_client.ApiConfig(name='KDC_ADMIN_PASSWORD', value=kdc_password)
19721924
KDC_ADMIN_USER = cm_client.ApiConfig(name='KDC_ADMIN_USER', value=kdc_admin)
@@ -2067,7 +2019,8 @@ def options_parser(args=None):
20672019
'OCI using cm_client with Cloudera '
20682020
'Manager API %s' % (cdh_version,
20692021
api_version))
2070-
parser.add_argument('-D', '--deployment_type', metavar='deployment_type', help='simple, no HA or Kerberos at deployment, or secure to enable both')
2022+
parser.add_argument('-D', '--deployment_type', metavar='deployment_type', help='simple, no Kerberos at deployment, or secure to enable')
2023+
parser.add_argument('-H', '--hdfs_ha', action='store_true')
20712024
parser.add_argument('-m', '--cm_server', metavar='cm_server', required='True',
20722025
help='Cloudera Manager IP to connect API using cm_client')
20732026
parser.add_argument('-i', '--input_host_list', metavar='input_host_list',
@@ -2088,6 +2041,7 @@ def options_parser(args=None):
20882041
cdh_version = options.cdh_version
20892042
if cluster_primary_version == '6':
20902043
remote_parcel_url = 'https://archive.cloudera.com/cdh6/' + options.cdh_version + '/parcels' # type: str
2044+
kafka_parcel_url = ' '
20912045
else:
20922046
remote_parcel_url = 'https://archive.cloudera.com/cdh5/parcels/' + options.cdh_version #type: str
20932047
if options.cdh_version.split('.')[2] >= '13':
@@ -2322,7 +2276,7 @@ def enable_kerberos():
23222276
#
23232277

23242278
if __name__ == '__main__':
2325-
cm_server, input_host_list, disk_count, license_file, worker_shape, num_workers, deployment_type, cdh_version, cms_version, cluster_name, cluster_primary_version, kafka_parcel_url =\
2279+
cm_server, input_host_list, disk_count, license_file, worker_shape, num_workers, deployment_type, cdh_version, availability_domain, cluster_name, cluster_primary_version, kafka_parcel_url =\
23262280
options_parser(sys.argv[1:])
23272281
if debug == 'True':
23282282
print('cm_server = %s' % cm_server)

variables.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ variable "deployment_type" {
2424
default = "simple"
2525
}
2626

27+
variable "hdfs_ha" {
28+
default = "False"
29+
}
30+
2731
variable "worker_instance_shape" {
2832
default = "BM.DenseIO2.52"
2933
}
@@ -74,6 +78,10 @@ variable "bastion_instance_shape" {
7478
default = "VM.Standard2.4"
7579
}
7680

81+
variable "bastion_node_count" {
82+
default = "1"
83+
}
84+
7785
# Which AD to target - this can be adjusted. Default 1 for single AD regions.
7886
variable "availability_domain" {
7987
default = "1"

0 commit comments

Comments
 (0)