This topic describes how to log on to the new E-MapReduce (EMR) console by using your Alibaba Cloud account, create a DataLake cluster, and then create and run a job in the cluster.
An Alibaba Cloud account is created, and real-name verification is complete.
The permissions of the default EMR and Elastic Compute Service (ECS) roles are granted to the EMR service. For more information, see Assign roles.
Create a DataLake cluster in the new EMR console.
Create and run a Spark job in the DataLake cluster.
View the details of the job on the YARN web UI.
If you no longer need to use the cluster, release the cluster to reduce costs.
Step 1: Create a cluster
Go to the cluster creation page.
Log on to the EMR console. In the left-side navigation pane, click EMR on ECS.
In the top navigation bar, select the region where you want to create a cluster and select a resource group based on your business requirements.
You cannot change the region of a cluster after the cluster is created.
By default, all resource groups in your account are displayed.
On the EMR on ECS page, click Create Cluster.
On the page that appears, configure the parameters. The following table describes the parameters.
The geographic location where the ECS instances of the cluster reside.Important
You cannot change the region after the cluster is created. Select a region based on your business requirements.
New Data Lake
The business scenario of the cluster. Default value: New Data Lake.
The version of EMR. Select the latest version.
High Service Availability
Specifies whether to enable high availability for the EMR cluster. If you turn on the High Service Availability switch, EMR distributes master nodes across different underlying hardware devices to reduce the risk of failures. By default, the High Service Availability switch is turned off.
Optional Services (Select One At Least)
Hadoop-Common, HDFS, YARN, Hive, Spark3, Tez, Knox, and OpenLDAP
The services that can be selected for the cluster. You can select services based on your business requirements. The processes that are related to the selected services are automatically started.Note
In addition to the default services of the cluster, you must also select the Knox and OpenLDAP services.
Use DLF for unified metadata storage
If you select DLF Unified Metadata for Metadata, the system selects the default DLF catalog for you to store metadata in Data Lake Formation (DLF). If you want different clusters to be associated with different DLF catalogs, you can click Create Catalog to create DLF catalogs based on your business requirements.Note
To configure this parameter, make sure that Alibaba Cloud DLF is activated.
The billing method of the cluster. If you want to perform a test, we recommend that you use the pay-as-you-go billing method. After the test is complete, you can release the cluster and create a subscription cluster in the production environment.
The zone where the cluster resides. You cannot change the zone after the cluster is created. Select a zone based on your business requirements.
The virtual private cloud (VPC) in which the cluster is deployed. Select a VPC in the current region. If no VPC is available, click create a VPC to create a VPC. After the VPC is created, click the Refresh icon and select the created VPC.
The vSwitch of the cluster. Select a vSwitch in the specified zone. If no vSwitch is available in the zone, create a vSwitch.
Default Security Group
Do not use an advanced security group that is created in the ECS console.
The security group to which you want to add the cluster. If you have created security groups in EMR, you can select a security group based on your business requirements. You can also create a security group.
Turn on the Assign Public Network IP switch for the master node and use default settings of other parameters
The instances in the cluster. Configure the master node, core nodes, and task nodes based on your business requirements. For more information, see Select configurations.
The name of the cluster. The name must be 1 to 64 characters in length and can contain only letters, digits, hyphens (-), and underscores (_).
The identity credentials that you want to use to remotely access the master node of the cluster.
Password and Confirm Password
The password that you want to use to access the cluster. Record this password for subsequent operations.
Click Next: Confirm. In the Confirm step, read the terms of service, select the check box, and then click Confirm.
The cluster is successfully created if the cluster is in the Running state.
Step 2: Create and run a job
After the cluster is created, you can create and run a job in the cluster.
Log on to your cluster in SSH mode. For more information, see Log on to a cluster.
Run a command in the CLI to submit and run a job.
In this example, Spark 3.1.1 is used and the following command is used to submit and run a job:
spark-submit --class org.apache.spark.examples.SparkPi --master yarn --deploy-mode client --driver-memory 512m --num-executors 1 --executor-memory 1g --executor-cores 2 /opt/apps/SPARK3/spark-current/examples/jars/spark-examples_2.12-3.1.1.jar 10Note
spark-examples_2.12-3.1.1.jaris the JAR package in your cluster. You can log on to the cluster and obtain the package in the
Step 3: View the details of the job
View the details of the job on the YARN web UI.
Enable port 8443. For more information, see Manage security groups.
Add a user. For more information, see Manage user accounts.
To access the YARN web UI by using your Knox account, you must obtain the username and password of the Knox account.
On the EMR on ECS page, find your cluster and click Services in the Actions column.
On the page that appears, click Access Links and Ports.
On the Access Links and Ports tab, click the link in the Native UI Address column for YARN UI.
Use the added user for logon authentication and access the YARN web UI.
On the All Applications page, click the ID of the job to view the details of the job.
Step 4: (Optional) Release the cluster
If you no longer need to use the cluster, you can release it to reduce costs. After you confirm the release of a cluster, the system performs the following operations on the cluster:
Forcibly terminate all jobs in the cluster.
Terminate and release all ECS instances that are created for the cluster.
The time required to release a cluster is based on the size of the cluster. Most clusters can be released in seconds. It does not require more than 5 minutes to release a large cluster.
A pay-as-you-go cluster can be released at any time. A subscription cluster can be released only after the cluster expires.
Before you release a cluster, make sure that the cluster is in the Initializing, Running, or Idle state.
On the EMR on ECS page, find your cluster, move the pointer over the icon, and then select Release.
You can also release the cluster by performing the following operations: Click the name of the cluster. In the upper-right corner of the Basic Information tab, choose.
In the Release Cluster message, click OK.
For more information about how to log on to a cluster, see Log on to a cluster.
For more information about the paths of files that are frequently used in EMR, see Paths of frequently used files.
For more information about the API operations that are available for cluster management and cluster service management, see List of operations by function.
Learn FAQ about Alibaba Cloud EMR. For more information, see FAQ.