Currently, security groups created in the EMR console are required for creating an EMR cluster.
When creating an E-MapReduce cluster, you can open port 22 of the security group where the cluster resides (It is closed by default, open in EMR security group. user security group is an existing security group that you have created. Instances of each security group are configured to open different ports based on the IP addresses allowed to access the instances.).We recommend that you add ECS instances to security groups based on their functions. For example, the security group for an EMR cluster is
Add an EMR cluster to an existing security group
- You need to add instances in a classic network to a classic network security group of the same region.
- You need to add instances in a VPC to a VPC security group of the same region.
- Log on to the Alibaba Cloud E-MapReduce console.
- Click the Cluster Management tab.
- In the cluster list, locate the cluster that you want to add to the security group. Click View Details in the Actions column for the cluster to go to the Cluster Overview page.
- On the Cluster Overview page, click the security group ID in the Network area.
- In the left-side navigation pane, click Instances in Security Group to view the IDs and names of all instances.
- Go to the Alibaba Cloud ECS console. In the left-side navigation pane, click Instances.
- The ECS instances listed on the Instances page, whose names start with emr-xxx, are instances in an EMR cluster. Locate the instance that you want to add to a security group, click Manage in the Actions column for the instance.
- Click Security Groups.
- Click Add to Security Group.
- Select the security group to which you want to add the instance. Click Join multiple security groups. From the Security Group drop-down list, select the security groups as needed. The security groups are displayed in the dotted box below.
- Click OK.
Add an existing cluster to an EMR security group
You can refer to the operations described in the Add an EMR cluster to an existing security group section. The full process starts with locating the security group of the existing cluster and ends with adding the instances to the EMR security group. For instances that do not belong to any security groups, select the instances and choose More > Network and security > Add to Security Group to add multiple instances to the EMR security group at a time.
Security group rules
If an ECS instance belongs to multiple security groups, the instance follows the union of all security group rules. For example, the security group rule of the EMR security group is configured to open port 22 and the security group rules of the user security group are configured to open all ports. After you add the EMR cluster to the user security group, the instances of the EMR cluster open all ports. We recommend that you use security groups carefully.