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

Commit 8d16552

Browse files
committed
Merge branch 'resource-manager'
Conflicts: terraform/modules/network/outputs.tf
2 parents 3c4059e + 9447522 commit 8d16552

30 files changed

+487
-343
lines changed

README.md

+17-51
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,55 @@
11
# oci-cloudera
22
This is a Terraform module that deploys [Cloudera Enterprise Data Hub](https://www.cloudera.com/products/enterprise-data-hub.html) on [Oracle Cloud Infrastructure (OCI)](https://cloud.oracle.com/en_US/cloud-infrastructure). It is developed jointly by Oracle and Cloudera.
33

4-
## Alternate Versions
5-
Future development will include support for EDH v5 clusters. In the meantime, use the [1.0.0 release](https://github.com/oci-quickstart/oci-cloudera/releases/tag/1.0.0) for v5 deployments.
4+
## Deployment Information
5+
The following table shows Recommended and Minimum supported OCI shapes for each cluster role:
66

77
| | Worker Nodes | Bastion Instance | Utility and Master Instances |
88
|-------------|----------------|------------------|------------------------------|
99
| Recommended | BM.DenseIO2.52 | VM.Standard2.4 | VM.Standard2.16 |
1010
| Minimum | VM.Standard2.8 | VM.Standard2.1 | VM.Standard2.8 |
1111

12-
Host types can be customized in this template. Also included with this template is an easy method to customize block volume quantity and size as pertains to HDFS capacity. See [variables.tf](https://github.com/oracle/oci-quickstart-cloudera/blob/master/terraform/variables.tf#L48-L62) for more information in-line.
12+
## Resource Manager Deployment
13+
This quickstart leverages [OCI Resource Manager](https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm) to make deployment quite easy. Simply [download the latest .zip](https://github.com/oracle/oci-quickstart-cloudera/zipball/resource-manager) and follow the [Resource Manager instructions](https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Tasks/usingconsole.htm) for how to build a stack. Prior to building the Stack, you may want to modify some parts of the deployment detailed in the sections below and the scripts [README](https://github.com/oracle/oci-quickstart-cloudera/blob/master/scripts/README.md).
1314

14-
## Prerequisites
15-
First off you'll need to do some pre deploy setup. That's all detailed [here](https://github.com/oracle/oci-quickstart-prerequisites).
15+
Alternatively you can also use a schema file to make setting deployment variables even easier. In order to leverage this feature, the GitHub zipball must be re-packaged so that it's contents are top-level prior to creating the ORM Stack. This is a straight forward process:
16+
```
17+
unzip oci-quickstart-cloudera*.zip
18+
cd oci-quickstart-cloudera-<TAB_COMPLETE>
19+
zip -r oci-quickstart-cloudera.zip *
20+
```
1621

17-
### Clone the Module
18-
Now, you'll want a local copy of this repo. You can make that with the commands:
19-
20-
git clone https://github.com/oracle/oci-quickstart-cloudera.git
21-
cd oci-quickstart-cloudera
22+
Use the oci-quickstart-cloudera.zip file created in the last step to create the ORM Stack. The schema file can even be customized for your use, enabling you to build a set of approved variables for deployment.
2223

2324
## Python Deployment using cm_client
2425
The deployment script "deploy_on_oci.py" uses cm_client against Cloudera Manger API v31. As such it does require some customization before execution. Reference the header section in the script, it is highly encouraged you modify the following variables before deployment:
2526

2627
admin_user_name
2728
admin_password
28-
cluster_name
29-
30-
Also if you modify the compute.tf in any way to change hostname parameters, you will need to update these variables for pattern matching, otherwise cluster deployment will fail:
3129

32-
worker_hosts_prefix = 'cdh-worker'
33-
namenode_host = 'cdh-master-1'
34-
secondary_namenode_host = 'cdh-master-2'
35-
cloudera_manager_host = 'cdh-utility-1'
36-
37-
In addition, further customization of the cluster deployment can be done by modification of the following functions:
30+
These variables are not passed too instance metadata for security purposes, as such they are only present in the CloudInit deployment script. You can sanitize these after deployment by removing the contents of /var/lib/cloud/instance/scripts/.
31+
In addition, advanced customization of the cluster deployment can be done by modification of the following functions:
3832

3933
setup_mgmt_rcg
4034
update_cluster_rcg_configuration
4135

42-
This does require some knowledge of Python and Cloudera - modify at your own risk. These functions contain Cloudera specific tuning parameters as well as host mapping for roles.
36+
This does require some knowledge of Python and Cloudera configuration - modify at your own risk. These functions contain Cloudera specific tuning parameters as well as host mapping for roles.
4337

4438
## Kerberos Secure Cluster option
4539

46-
This automation supports using a local KDC deployed on the Cloudera Manager instance for secure cluster operation. Please read the scripts [README](https://github.com/oracle/oci-quickstart-cloudera/blob/master/scripts/README.md) for information regarding how to set these parameters prior to deployment.
40+
This automation supports using a local KDC deployed on the Cloudera Manager instance for secure cluster operation. Please read the scripts [README](https://github.com/oracle/oci-quickstart-cloudera/blob/master/scripts/README.md) for information regarding how to set these parameters prior to deployment if desired. This is now enabled by a True/False flag in ORM deployment, and is on by default.
4741

4842
Also - for cluster management, you will need to manually create at a minimum the HDFS Superuser Principal as [detailed here](https://www.cloudera.com/documentation/enterprise/latest/topics/cm_sg_using_cm_sec_config.html#create-hdfs-superuser) after deployment.
49-
50-
Enabling Kerberos is managed using a terraform metadata tag "deployment_type" which is set in [variables.tf](https://github.com/oracle/oci-quickstart-cloudera/blob/master/terraform/variables.tf#L32). Setting this value to "secure" will enable cluster security as part of the setup process. Changing this to "simple" will deploy an unsecured cluster.
51-
43+
5244
## High Availability
5345

54-
High Availability is also offered as part of the deployment process. When secure cluster operation is chosen this is enabled by default. It can be disabled by either changing the deployment_type to "simple", or modifying the [deploy_on_oci.py](https://github.com/oracle/oci-quickstart-cloudera/blob/master/scripts/deploy_on_oci.py#L60) script and changing the value for "hdfs_ha" to False.
46+
High Availability for HDFS services is also offered as part of the deployment process. This can be toggled during the installation process by setting the value to "True".
5547

5648
## Metadata and MySQL
5749

5850
You can customize the default root password for MySQL by editing the source script [cms_mysql.sh](https://github.com/oracle/oci-quickstart-cloudera/blob/master/scripts/cms_mysql.sh#L188). For the various Cloudera databases, random passwords are generated and used. These are stored in a flat file on the Utility host for use at deployment time.
5951

6052
## Object Storage Integration
61-
As of the 2.1.0 release, included with this template is a means to deploy clusters with configuration to allow use of OCI Object Storage using S3 Compatability. In order to implement, an S3 Access and Secret key must be set up in the OCI Tenancy first. This process is detailed [here](https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcredentials.htm#Working2). Once that is in place, modify the [deploy_on_oci.py](https://github.com/oracle/oci-quickstart-cloudera/blob/master/scripts/deploy_on_oci.py#L101-L108) script, and set the following values:
62-
63-
s3_compat_enable = 'False'
64-
s3a_secret_key = 'None'
65-
s3a_access_key = 'None'
66-
s3a_endpoint = 'None'
67-
68-
The first should be set to 'True', then replace 'None" with each of the required values. This configuration will then be pushed as part of the cluster deployment.
69-
70-
## Deployment Syntax
71-
Deployment of the module is straight forward using the following Terraform commands
72-
73-
terraform init
74-
terraform plan
75-
terraform apply
76-
77-
This will create all the required elements in a compartment in the target OCI tenancy. This includes VCN and Security List parameters. Security audit of these in the [network module](https://github.com/oracle/oci-quickstart-cloudera/blob/master/terraform/modules/network/main.tf) is suggested.
78-
79-
## Destroy the Deployment
80-
81-
When you no longer need the deployment, you can run this command to destroy it:
82-
83-
terraform destroy
84-
85-
## Deployment Architecture
86-
8753
Here is a diagram showing what is deployed using this template. Note that resources are automatically distributed among Fault Domains in an Availability Domain to ensure fault tolerance. Additional workers deployed will stripe between the 3 fault domains in sequence starting with the Fault Domain 1 and incrementing sequentially.
8854

8955
![Deployment Architecture Diagram](https://github.com/oracle/oci-quickstart-cloudera/blob/master/images/deployment_architecture.png)
+11-20
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
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}"
77
availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[var.availability_domain - 1],"name")}"
88
image_ocid = "${var.InstanceImageOCID[var.region]}"
9-
ssh_keypath = "${var.ssh_keypath}"
109
ssh_private_key = "${var.ssh_private_key}"
1110
ssh_public_key = "${var.ssh_public_key}"
12-
private_key_path = "${var.private_key_path}"
1311
bastion_instance_shape = "${var.bastion_instance_shape}"
1412
log_volume_size_in_gbs = "${var.log_volume_size_in_gbs}"
1513
cloudera_volume_size_in_gbs = "${var.cloudera_volume_size_in_gbs}"
16-
user_data = "${base64encode(file("../scripts/boot.sh"))}"
14+
user_data = "${base64encode(file("scripts/boot.sh"))}"
1715
cloudera_manager = "cdh-utility-1.public${var.availability_domain}.${module.network.vcn-dn}"
1816
cm_version = "${var.cm_version}"
1917
cdh_version = "${var.cdh_version}"
20-
deployment_type = "${var.deployment_type}"
2118
}
2219

2320
module "utility" {
@@ -28,23 +25,23 @@ module "utility" {
2825
subnet_id = "${module.network.public-id}"
2926
availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[var.availability_domain - 1],"name")}"
3027
image_ocid = "${var.InstanceImageOCID[var.region]}"
31-
ssh_keypath = "${var.ssh_keypath}"
3228
ssh_private_key = "${var.ssh_private_key}"
3329
ssh_public_key = "${var.ssh_public_key}"
34-
private_key_path = "${var.private_key_path}"
3530
utility_instance_shape = "${var.utility_instance_shape}"
3631
log_volume_size_in_gbs = "${var.log_volume_size_in_gbs}"
3732
cloudera_volume_size_in_gbs = "${var.cloudera_volume_size_in_gbs}"
38-
user_data = "${base64encode(file("../scripts/cloudera_manager_boot.sh"))}"
39-
cm_install = "${base64gzip(file("../scripts/cms_mysql.sh"))}"
40-
deploy_on_oci = "${base64gzip(file("../scripts/deploy_on_oci.py"))}"
33+
user_data = "${base64encode(file("scripts/cloudera_manager_boot.sh"))}"
34+
cm_install = "${base64gzip(file("scripts/cms_mysql.sh"))}"
35+
deploy_on_oci = "${base64gzip(file("scripts/deploy_on_oci.py"))}"
4136
cloudera_manager = "cdh-utility-1.public${var.availability_domain}.${module.network.vcn-dn}"
4237
cm_version = "${var.cm_version}"
4338
cdh_version = "${var.cdh_version}"
4439
worker_shape = "${var.worker_instance_shape}"
45-
block_volume_count = "${var.block_volume_count}"
40+
block_volume_count = "${var.block_volumes_per_worker}"
4641
AD = "${var.availability_domain}"
47-
deployment_type = "${var.deployment_type}"
42+
hdfs_ha = "${var.hdfs_ha}"
43+
secure_cluster = "${var.secure_cluster}"
44+
cluster_name = "${var.cluster_name}"
4845
}
4946

5047
module "master" {
@@ -55,18 +52,15 @@ module "master" {
5552
subnet_id = "${module.network.private-id}"
5653
availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[var.availability_domain - 1],"name")}"
5754
image_ocid = "${var.InstanceImageOCID[var.region]}"
58-
ssh_keypath = "${var.ssh_keypath}"
5955
ssh_private_key = "${var.ssh_private_key}"
6056
ssh_public_key = "${var.ssh_public_key}"
61-
private_key_path = "${var.private_key_path}"
6257
master_instance_shape = "${var.master_instance_shape}"
6358
log_volume_size_in_gbs = "${var.log_volume_size_in_gbs}"
6459
cloudera_volume_size_in_gbs = "${var.cloudera_volume_size_in_gbs}"
65-
user_data = "${base64encode(file("../scripts/boot.sh"))}"
60+
user_data = "${base64encode(file("scripts/boot.sh"))}"
6661
cloudera_manager = "cdh-utility-1.public${var.availability_domain}.${module.network.vcn-dn}"
6762
cm_version = "${var.cm_version}"
6863
cdh_version = "${var.cdh_version}"
69-
deployment_type = "${var.deployment_type}"
7064
}
7165

7266
module "worker" {
@@ -77,19 +71,16 @@ module "worker" {
7771
subnet_id = "${module.network.private-id}"
7872
availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[var.availability_domain - 1],"name")}"
7973
image_ocid = "${var.InstanceImageOCID[var.region]}"
80-
ssh_keypath = "${var.ssh_keypath}"
8174
ssh_private_key = "${var.ssh_private_key}"
8275
ssh_public_key = "${var.ssh_public_key}"
83-
private_key_path = "${var.private_key_path}"
8476
worker_instance_shape = "${var.worker_instance_shape}"
8577
log_volume_size_in_gbs = "${var.log_volume_size_in_gbs}"
8678
cloudera_volume_size_in_gbs = "${var.cloudera_volume_size_in_gbs}"
8779
block_volumes_per_worker = "${var.block_volumes_per_worker}"
8880
data_blocksize_in_gbs = "${var.data_blocksize_in_gbs}"
89-
user_data = "${base64encode(file("../scripts/boot.sh"))}"
81+
user_data = "${base64encode(file("scripts/boot.sh"))}"
9082
cloudera_manager = "cdh-utility-1.public${var.availability_domain}.${module.network.vcn-dn}"
9183
cm_version = "${var.cm_version}"
9284
cdh_version = "${var.cdh_version}"
9385
block_volume_count = "${var.block_volumes_per_worker}"
94-
deployment_type = "${var.deployment_type}"
9586
}
File renamed without changes.

images/RM_variables.png

76.6 KB
Loading
File renamed without changes.

terraform/modules/bastion/main.tf renamed to modules/bastion/main.tf

-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ resource "oci_core_instance" "Bastion" {
1717
cloudera_manager = "${var.cloudera_manager}"
1818
cdh_version = "${var.cdh_version}"
1919
cm_version = "${var.cm_version}"
20-
deployment_type = "${var.deployment_type}"
2120
}
2221

2322
timeouts {
@@ -38,7 +37,6 @@ resource "oci_core_volume" "BastionLogVolume" {
3837
resource "oci_core_volume_attachment" "BastionLogAttachment" {
3938
count = "1"
4039
attachment_type = "iscsi"
41-
compartment_id = "${var.compartment_ocid}"
4240
instance_id = "${oci_core_instance.Bastion.id}"
4341
volume_id = "${oci_core_volume.BastionLogVolume.id}"
4442
device = "/dev/oracleoci/oraclevdb"
@@ -56,7 +54,6 @@ resource "oci_core_volume" "BastionClouderaVolume" {
5654
resource "oci_core_volume_attachment" "BastionClouderaAttachment" {
5755
count = "1"
5856
attachment_type = "iscsi"
59-
compartment_id = "${var.compartment_ocid}"
6057
instance_id = "${oci_core_instance.Bastion.id}"
6158
volume_id = "${oci_core_volume.BastionClouderaVolume.id}"
6259
device = "/dev/oracleoci/oraclevdc"

terraform/modules/bastion/variables.tf renamed to modules/bastion/variables.tf

-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
variable "region" {}
88
variable "compartment_ocid" {}
9-
variable "private_key_path" {}
109
variable "ssh_public_key" {}
1110
variable "ssh_private_key" {}
1211
variable "instances" {}
@@ -16,7 +15,6 @@ variable "image_ocid" {}
1615
variable "cm_version" {}
1716
variable "cdh_version" {}
1817
variable "cloudera_manager" {}
19-
variable "deployment_type" {}
2018

2119
# ---------------------------------------------------------------------------------------------------------------------
2220
# Optional variables
@@ -47,12 +45,6 @@ variable "bastion_instance_shape" {
4745
default = "VM.Standard2.8"
4846
}
4947

50-
# Path to SSH Key
51-
52-
variable "ssh_keypath" {
53-
default = "/home/opc/.ssh/id_rsa"
54-
}
55-
5648
# ---------------------------------------------------------------------------------------------------------------------
5749
# Constants
5850
# You probably don't need to change these.

terraform/modules/master/main.tf renamed to modules/master/main.tf

-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ resource "oci_core_instance" "Master" {
1919
cloudera_manager = "${var.cloudera_manager}"
2020
cdh_version = "${var.cdh_version}"
2121
cm_version = "${var.cm_version}"
22-
deployment_type = "${var.deployment_type}"
2322
}
2423

2524
timeouts {
@@ -41,7 +40,6 @@ resource "oci_core_volume" "MasterLogVolume" {
4140
resource "oci_core_volume_attachment" "MasterLogAttachment" {
4241
count = "${var.instances}"
4342
attachment_type = "iscsi"
44-
compartment_id = "${var.compartment_ocid}"
4543
instance_id = "${oci_core_instance.Master.*.id[count.index]}"
4644
volume_id = "${oci_core_volume.MasterLogVolume.*.id[count.index]}"
4745
device = "/dev/oracleoci/oraclevdb"
@@ -59,7 +57,6 @@ resource "oci_core_volume" "MasterClouderaVolume" {
5957
resource "oci_core_volume_attachment" "MasterClouderaAttachment" {
6058
count = "${var.instances}"
6159
attachment_type = "iscsi"
62-
compartment_id = "${var.compartment_ocid}"
6360
instance_id = "${oci_core_instance.Master.*.id[count.index]}"
6461
volume_id = "${oci_core_volume.MasterClouderaVolume.*.id[count.index]}"
6562
device = "/dev/oracleoci/oraclevdc"
@@ -77,7 +74,6 @@ resource "oci_core_volume" "MasterNNVolume" {
7774
resource "oci_core_volume_attachment" "MasterNNAttachment" {
7875
count = "${var.instances}"
7976
attachment_type = "iscsi"
80-
compartment_id = "${var.compartment_ocid}"
8177
instance_id = "${oci_core_instance.Master.*.id[count.index]}"
8278
volume_id = "${oci_core_volume.MasterNNVolume.*.id[count.index]}"
8379
device = "/dev/oracleoci/oraclevdd"

terraform/modules/master/variables.tf renamed to modules/master/variables.tf

-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
variable "region" {}
88
variable "compartment_ocid" {}
9-
variable "private_key_path" {}
109
variable "ssh_public_key" {}
1110
variable "ssh_private_key" {}
1211
variable "instances" {}
@@ -16,7 +15,6 @@ variable "image_ocid" {}
1615
variable "cm_version" {}
1716
variable "cdh_version" {}
1817
variable "cloudera_manager" {}
19-
variable "deployment_type" {}
2018

2119
# ---------------------------------------------------------------------------------------------------------------------
2220
# Optional variables
@@ -60,12 +58,6 @@ variable "master_instance_shape" {
6058
default = "VM.Standard2.8"
6159
}
6260

63-
# Path to SSH Key
64-
65-
variable "ssh_keypath" {
66-
default = "/home/opc/.ssh/id_rsa"
67-
}
68-
6961
# ---------------------------------------------------------------------------------------------------------------------
7062
# Constants
7163
# You probably don't need to change these.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

terraform/modules/utility/main.tf renamed to modules/utility/main.tf

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ resource "oci_core_instance" "Utility" {
2121
worker_shape = "${var.worker_shape}"
2222
block_volume_count = "${var.block_volume_count}"
2323
availability_domain = "${var.AD}"
24-
deployment_type = "${var.deployment_type}"
24+
secure_cluster = "${var.secure_cluster}"
25+
hdfs_ha = "${var.hdfs_ha}"
26+
cluster_name = "${var.cluster_name}"
2527
}
2628

2729
extended_metadata {
@@ -47,7 +49,6 @@ resource "oci_core_volume" "UtilLogVolume" {
4749
resource "oci_core_volume_attachment" "UtilLogAttachment" {
4850
count = "1"
4951
attachment_type = "iscsi"
50-
compartment_id = "${var.compartment_ocid}"
5152
instance_id = "${oci_core_instance.Utility.id}"
5253
volume_id = "${oci_core_volume.UtilLogVolume.id}"
5354
device = "/dev/oracleoci/oraclevdb"
@@ -65,7 +66,6 @@ resource "oci_core_volume" "UtilClouderaVolume" {
6566
resource "oci_core_volume_attachment" "UtilClouderaAttachment" {
6667
count = "1"
6768
attachment_type = "iscsi"
68-
compartment_id = "${var.compartment_ocid}"
6969
instance_id = "${oci_core_instance.Utility.id}"
7070
volume_id = "${oci_core_volume.UtilClouderaVolume.id}"
7171
device = "/dev/oracleoci/oraclevdc"
File renamed without changes.

0 commit comments

Comments
 (0)