You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/connections/storage/data-lakes/data-lakes-manual-setup.md
+45-28Lines changed: 45 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,90 +5,83 @@ title: Configure the Data Lakes AWS Environment
5
5
{% include content/plan-grid.md name="data-lakes" %}
6
6
7
7
8
-
The instructions below will guide you through the process required to configure the environment required to begin loading data into your Segment Data Lake. For a more automated process, see [Set Up Segment Data Lakes](/src/connections/storage/catalog/data-lakes/index.md).
8
+
The instructions below will guide you through the process required to configure the environment required to begin loading data into your Segment Data Lake. For a more automated process, see [Set Up Segment Data Lakes](/docs/connections/storage/catalog/data-lakes/index).
9
9
10
10
As a best practice, Segment recommends that you consult with your network and security teams before you configure your EMR cluster.
11
11
12
12
## Step 1 - Create a VPC and an S3 bucket
13
13
14
14
In this step, you'll create a Virtual Private Cloud (VPC) to securely launch your AWS resources into and an S3 bucket that will store both the intermediate and final data.
15
15
16
-
To create a VPC, follow the instructions outlined in Amazon's documentation, [Create and configure your VPC](https://docs.aws.amazon.com/directoryservice/latest/admin-guide/gsg_create_vpc.html).
16
+
To create a VPC, follow the instructions outlined in Amazon's documentation, [Create and configure your VPC](https://docs.aws.amazon.com/directoryservice/latest/admin-guide/gsg_create_vpc.html){:target="_blank"}.
17
17
18
-
To create an S3 bucket, see Amazon's [Create your first S3 bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-bucket.html) instructions.
18
+
To create an S3 bucket, see Amazon's [Create your first S3 bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-bucket.html){:target="_blank"} instructions.
19
19
20
20
> info ""
21
21
> Take note of the S3 bucket name you set in this step, as the rest of the set up flow requires it.
22
-
<!--- In these instructions, the name is `segment-data-lake`. --->
23
22
24
-
After creating an S3 bucket, configure a lifecycle rule for the bucket and set it to expire staging data after **14 days**. For instructions on configuring lifecycle rules, see Amazon's documentation, [Setting lifecycle configuration on a bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/how-to-set-lifecycle-configuration-intro.html).
23
+
After you create an S3 bucket, configure a lifecycle rule for the bucket and set it to expire staging data after **14 days**. For instructions on configuring lifecycle rules, see Amazon's documentation, [Setting lifecycle configuration on a bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/how-to-set-lifecycle-configuration-intro.html){:target="_blank"}.
25
24
26
-
The following lifecycle settings should be applied to your staging data:
25
+
Apply the following lifecycle settings to your staging data:
27
26
***Expire after:** 14 days
28
27
***Permanently delete after:** 14 days
29
28
***Clean up incomplete multipart uploads:** after 14 days
30
29
31
-
<!---  --->
32
-
33
30
## Step 2 - Configure an EMR cluster
34
31
35
32
Segment requires access to an EMR cluster to perform necessary data processing. For best results, start with a small cluster and add more compute resources as required.
36
33
37
34
### Configure the hardware and networking configuration
38
35
39
-
1.Select EMR from the AWS console by navigating to Services > Analytics > EMR.
40
-
2. Click **Create Cluster**, and select**Go to advanced options**.
36
+
1.In the AWS console, navigate to **Services > Analytics > EMR**.
37
+
2. Click **Create Cluster**. On the Create Cluster - Quick Options page, click**Go to advanced options**.
41
38
3. In Advanced Options, on Step 1: Software and Steps, select both the `emr-5.33.0` release and the following applications:
42
39
- Hadoop 2.10.1
43
40
- Hive 2.3.7
44
41
- Hue 4.9.0
45
42
- Spark 2.4.7
46
43
- Pig 0.17.0
47
-
4.Under the AWS Glue Data Catalog settings, select the following options:
44
+
4.In the AWS Glue Data Catalog settings, select the following options:
48
45
- Use for Hive table metadata
49
46
- Use for Spark table metadata
50
-
<!---  --->
51
47
5. Select **Next** to proceed to Step 2: Hardware.
52
-
6. Under the Networking section, select a Network (the VPC you created in [Step 1](#step-1---create-a-vpc-and-an-s3-bucket)) and EC2 Subnet for your EMR instance. Creating the cluster in a private subnet is more secure, but requires additional configuration, while creating a cluster in a public subnet leaves it accessible from the Internet. Users who create clusters in public subnets can configure strict security groups to prevent unauthorized inbound EMR cluster access. See Amazon's document, [Amazon VPC Options - Amazon EMR](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-clusters-in-a-vpc.html) for more information.
48
+
6.In the Networking section, select a Network (the VPC you created in [Step 1](#step-1---create-a-vpc-and-an-s3-bucket)) and EC2 Subnet for your EMR instance.
49
+
50
+
Creating the cluster in a private subnet is more secure, but requires additional configuration. Creating the cluster in a public subnet leaves it accessible from the Internet, but requires less up front configuration.
51
+
52
+
If you create clusters in public subnets, you can configure strict security groups to prevent unauthorized inbound EMR cluster access. See Amazon's document, [Amazon VPC Options - Amazon EMR](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-clusters-in-a-vpc.html){:target="_blank"} for more information.
53
53
54
54
7. In the Cluster Nodes and Instances section, create a cluster that includes the following on-demand nodes:
55
55
-**1** master node
56
56
-**2** core nodes
57
57
-**2** task nodes
58
-
<!--- .
66
66
67
-
8.Select**Next** to proceed to Step 3: General Cluster Settings.
67
+
8.Click**Next** to proceed to Step 3: General Cluster Settings.
68
68
69
69
### Configure logging
70
70
71
71
9. On Step 3: General Cluster Settings, configure logging to use the same S3 bucket you configured as the destination for the final data. Once configured, logs are assigned a new prefix and separated from the final processed data.
72
-
<!--- (`segment-data-lakes` in this case) --->
73
-
74
-
10. Add a new key-value pair to the Tags section, a **vendor** key with a value of **segment**. The IAM policy uses this to provide Segment access to submit jobs in the EMR cluster.
75
72
76
-
11. Select **Next**to proceed to Step 4: Security.
73
+
10. Add a new key-value pair to the Tags section, a `vendor` key with a value of `segment`. The IAM policy uses this tag to provide Segment access to submit jobs in the EMR cluster.
11. Click **Next** to proceed to Step 4: Security.
79
76
80
77
### Secure the cluster
81
78
12. On Step 4: Security, in the Security Options section, create or select an **EC2 key pair**.
82
79
13. Choose the appropriate roles in the **EC2 instance profile**.
83
80
14. Expand the EC2 security groups section and select the appropriate security groups for the Master and Core & Task types.
84
81
15. Select **Create cluster**.
85
82
86
-
<!--- 
87
-
88
-
The image uses the default settings. You can make these settings more restrictive, if required. --->
89
-
90
83
> note ""
91
-
> **NOTE:**If you are updating the EMR cluster for an existing Data Lakes instance, note the EMR cluster ID on the confirmation page.
84
+
> If you update the EMR cluster of existing Data Lakes instance, take note of the EMR cluster ID on the confirmation page.
92
85
93
86
## Step 3 - Create an Access Management role and policy
94
87
@@ -126,7 +119,7 @@ Create a `segment-data-lake-role` role for Segment to assume. Attach the followi
126
119
```
127
120
128
121
> note ""
129
-
> **NOTE:**Replace the `ExternalID` list with the Segment `WorkspaceID` that contains the sources to sync to the Data Lake.
122
+
> Replace the `ExternalID` list with the Segment `WorkspaceID` that contains the sources to sync to the Data Lake.
130
123
131
124
### IAM Policy
132
125
@@ -216,7 +209,7 @@ Add a policy to the role created above to give Segment access to the relevant Gl
216
209
```
217
210
218
211
> note ""
219
-
> **NOTE:**The policy above grants full access to Athena, but the individual Glue and S3 policies determine which table will be queried. Segment queries for debugging purposes, and will notify you before running any queries.
212
+
> The policy above grants full access to Athena, but the individual Glue and S3 policies determine which table is queried. Segment queries for debugging purposes, and notifies you before running any queries.
220
213
221
214
## Debugging
222
215
@@ -226,3 +219,27 @@ Segment requires access to the data and schema for debugging data quality issues
226
219
- Ensure Athena uses Glue as the data catalog. Older accounts may not have this configuration, and may require some additional steps to complete the upgrade. The Glue console typically displays a warning and provides a link to instructions on how to complete the upgrade.
227
220

228
221
- An easier alternative is to create a new account that has Athena backed by Glue as the default.
222
+
223
+
## Updating EMR Clusters
224
+
You can update your existing Data Lake destination to EMR version 5.33.0 by creating a new v5.33.0 cluster in AWS and associating it with your existing Data Lake. After you update the EMR cluster, your Segment Data Lake continues to use the Glue data catalog you initially configured.
225
+
226
+
When you update an EMR cluster to 5.33.0, you can participate in [AWS Lake Formation](https://aws.amazon.com/lake-formation/?whats-new-cards.sort-by=item.additionalFields.postDateTime&whats-new-cards.sort-order=desc){:target="_blank"}, use dynamic auto-scaling, and experience faster Parquet jobs.
227
+
228
+
> info""
229
+
> Your Segment Data Lake does not need to be disabled during the update process, and any ongoing syncs will complete on the old cluster. Any syncs that fail while you are updating the cluster ID field will be restarted on the new cluster.
230
+
231
+
## Prerequisites
232
+
* An EMR v5.33.0 cluster
233
+
* An existing Segment Data Lakes destination
234
+
235
+
## Procedure
236
+
1. Open your Segment app workspace and select the Data Lakes destination.
237
+
2. On the Settings tab, select the EMR Cluster ID field and replace the existing ID with the ID of your v5.33.0 EMR cluster. For help finding the cluster ID in AWS, see Amazon's [View cluster status and details](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-manage-view-clusters.html). You don't need to update the Glue Catalog ID, IAM Role ARN, or S3 Bucket name fields.
238
+
3. Click **Save**.
239
+
4. In the AWS EMR console, view the Events tab for your cluster to verify it is receiving data.
240
+
241
+
You can delete the old EMR cluster from AWS after the following conditions have been met:
242
+
* You have updated all Data Lakes to use the EMR cluster
243
+
* A sync has successfully completed in the new cluster
0 commit comments