Updated on 2024-08-08 GMT+08:00

Getting Started

(Optional) Modifying Security Group Rules

A security group is a collection of access control rules for cloud resources, such as cloud servers, containers, and databases, to control inbound and outbound traffic. Cloud resources associated with the same security group have the same security requirements and are mutually trusted within a VPC.

You can modify your security group policy based on service requirements, for example, by adding, modifying, or deleting a TCP port, as follows:

  • Adding a security group rule: Add an inbound rule and enable a TCP port if needed.
  • Modifying a security group rule: Inappropriate security group settings can be a serious security risk. You can modify security group rules to ensure the network security of your instances.
  • Deleting a security group rule: If the source or destination IP address of an inbound or outbound security group rule changes, or a port does not need to be enabled, you can delete the security group rule.

(Optional) Changing the Password of the MongoDB Database

  1. Log in to the ECS console, select the created instance whose suffix is primary, and click Remote Login.

    Figure 1 Logging in to the ECS console

  2. Enter the username and password and press Enter.

    Figure 2 Logging in to Linux cloud servers

  3. Run mongo -uroot -pPassword --authenticationDatabase "admin" to log in to the database.

    Figure 3 Logging in to the MongoDB database

  4. Switch to the admin database, enter db.changeUserPassword("root","new password"), and press Enter. After the password is changed, enter exit to exit the MongoDB database.

    Figure 4 Switching to the admin database and changing the password of user root

Verifying the MongoDB Database

  1. On the ECS console, select the created instance whose suffix is primary, and click Remote Login to log in to the Linux instance.

    Figure 5 Logging in to the ECS console

  1. Run mongo -uroot -pPassword --authenticationDatabase "admin" to log in to the MongoDB database. If the output contains PRIMARY, the MongoDB database is deployed successfully.

    Figure 6 Database connection