This topic describes how to enable or disable password-free access over a VPC for an ApsaraDB for MongoDB instance. This makes database connections easy and secure. After password-free access is enabled, the ECS instance that shares the same VPC with the ApsaraDB for MongoDB instance can connect to a database of this ApsaraDB for MongoDB instance without a password. You can still use a database username and its password to connect to this database.
Prerequisites
- A replica set or sharded cluster instance is used.
- The database engine version of the instance is 4.0 (with the minor version of mongodb_20190408_3.0.11
or later) or 4.2. If your database engine is earlier than the required version, upgrade
the instance. For more information, see Upgrade MongoDB versions and Upgrade the minor version of an ApsaraDB for MongoDB instance.
Note You can view the database engine version and the minor version on the Basic Information page in the ApsaraDB for MongoDB console.
- The network type of the instance must be VPC. If the network type is classic network, switch it to VPC. For more information, see Switch from classic network to VPC.
Procedure
References
API | Description |
---|---|
ModifyInstanceVpcAuthMode | Enables or disables password-free access over a VPC for an ApsaraDB for MongoDB instance. |