All Products
Search
Document Center

ApsaraDB RDS:Create a serverless ApsaraDB RDS for PostgreSQL instance

更新時間:Aug 23, 2024

To meet evolving business needs and use cost-effective database solutions, you can purchase serverless ApsaraDB RDS for PostgreSQL instances. Serverless RDS instances allow you to scale CPU and memory resources in real time and provide pay-as-you-go billing for computing resources. This reduces costs and improves business flexibility. This topic describes how to create a serverless ApsaraDB RDS for PostgreSQL instance.

Prerequisites

The AliyunRDSFullAccess policy is attached to the RAM user that you use to create an RDS instance. For more information, see Use RAM for resource authorization.

Billing rules

The fee for a serverless RDS instance consists of the fees that are generated for RDS Capacity Units (RCUs) and storage resources. For more information, see Pricing of serverless ApsaraDB RDS for PostgreSQL instances.

Procedure

  1. Go to the ApsaraDB RDS buy page.

  2. Set the Billing Method parameter to Serverless.

  3. Configure the Region parameter.

    Select the region in which you want to create the RDS instance.

    Note
    • If your application or client is deployed on an Elastic Compute Service (ECS) instance, we recommend that you set this parameter to the region in which the ECS instance resides. If the RDS instance and the ECS instance reside in different regions, you cannot connect these instances over an internal network. In this case, these instances cannot deliver optimal performance. You cannot change the region after the RDS instance is created.

    • If your application is deployed on an on-premises server or on-premises computer, we recommend that you select a region that is near your on-premises server or on-premises computer. This way, you can use the public endpoint of the RDS instance to connect to the RDS instance from your application.

  4. Configure the Database Engine parameter.

    In this topic, PostgreSQL is selected. The supported major engine versions are PostgreSQL 14 or later.

  5. Configure the Edition parameter.

    Basic Edition and High-availability Edition are supported.

  6. Configure the Storage Type parameter. Valid values: General ESSD and PL1 ESSD.

  7. Configure serverless-related parameters.

    Note

    The serverless-related parameters can be modified after the serverless RDS instance is created. For more information, see Change the scaling range of RCUs, Change the scaling policy of RCUs, and Configure the automatic start and stop feature.

    Parameter

    Description

    Example

    RDS Capacity Units (RCUs)

    The performance of an RCU is equivalent to the performance of an RDS instance that has 1 CPU core and 2 GB of memory. The minimum value of the Minimum parameter is 0.5. The maximum value of the Maximum parameter is 14. After you configure the Minimum and Maximum parameters, the serverless RDS instance automatically scales the RCUs within the range of the values based on the actual workload.

    Note

    The maximum number of connections that can be established to a serverless RDS instance is fixed as 2,400 and does not vary based on the number of RCUs.

    • Minimum: 0.5

    • Maximum: 14

    Scaling Policy

    The scaling policy for a serverless RDS instance. In most cases, the RCU scaling for the serverless RDS instance immediately takes effect and does not affect your workloads. In some special cases, transient connections may occur on the serverless RDS instance. You can specify whether to forcefully scale the RCUs when transient connections occur.

    Note

    Transient connections are countermeasures for emergency cases. The probability of transient connections is extremely low.

    Do Not Execute Forcefully

    Automatic Stop and Restart

    Specifies whether to enable the automatic start and stop feature. After the feature is enabled, if no connections are established to the RDS instance within 10 minutes, the instance is suspended.

    After a connection is established to the RDS instance, the instance automatically resumes.

    Disabled

  8. Select a zone for the primary node.

    Select a zone.

    • No significant differences exist between the zones in the same region.

    • If the RDS instance resides in the same region as the ECS instance that you want to connect, these instances can deliver optimal performance. If the RDS instance and the ECS instance reside in different zones in the same region, the performance of these instances slightly decreases.

      Note

      If Sold Out appears in the name of the zone that you selected, try another zone.

  9. If the Edition parameter is set to High-availability Edition, you must configure the Deployment Method and Zone of Secondary Node parameters.

    We recommend that you set the Deployment Method parameter to Multi-zone Deployment. In this deployment method, the primary RDS instance and the secondary RDS instance reside in different zones of a region to provide cross-zone disaster recovery.

  10. Configure the Storage Capacity parameter.

    Drag the slider to adjust the storage capacity. You are charged for the total storage capacity of your serverless RDS instance. For example, if you select 100 GB of storage capacity when you create a serverless RDS instance, you are charged based on 100 GB even if you use less than 100 GB of storage. If the storage usage exceeds 100 GB, the system automatically scales up the storage capacity of the serverless RDS instance, and you are charged based on the actual usage.

    Important

    By default, the automatic storage expansion feature is enabled for serverless RDS instances. You cannot disable this feature. After an automatic storage expansion, the storage capacity cannot be automatically reduced. This helps ensure data integrity. Pay attention to your bills. You can manually reduce the storage capacity of serverless RDS instances. For more information, see Reduce the storage capacity of an ApsaraDB RDS for PostgreSQL instance that uses cloud disks.

  11. Click Next: Instance Configuration.

  12. Configure the VPC and vSwitch of Primary Node parameters.

    If you want to connect an RDS instance to your ECS instance over an internal network, select the same VPC as the ECS instance for the RDS instance. If you select a different VPC for your RDS instance, you cannot connect your RDS instance and ECS instance over an internal network.

    Note
    • You can connect the RDS instance and the ECS instance over an internal network even if the instances use different vSwitches in the same VPC.

    • If the Edition parameter is set to High-availability Edition, you must configure the vSwitch of Secondary Node parameter.

  13. Configure the Add to Whitelist parameter to specify whether to add the CIDR block of the selected VPC to an IP address whitelist of the RDS instance. If you select Yes for the Add to Whitelist parameter, the ECS instances that reside in the selected VPC can access the RDS instance.

  14. Configure other custom parameters. If you do not have special business requirements, you can retain the default values of these parameters.

    Parameter

    Description

    Parameter Template

    You can create a custom template before you create an RDS instance. When you create an RDS instance, you can select the created custom template. If you do not create a custom template, use the default parameter template. For more information, see Use a parameter template to configure the parameters of ApsaraDB RDS for PostgreSQL instances.

    Release Protection

    You can select Release Protection to prevent the RDS instance from being released due to unintended operations. For more information, see Enable or disable the release protection feature for an ApsaraDB RDS for PostgreSQL instance.

    Resource Group

    You can use the default resource group or select a custom resource group based on your business requirements. This facilitates instance management.

    Time Zone

    You can specify a time zone for the RDS instance.

    SLR Authorization

    If this is the first time you create an RDS instance after October 10, 2022, you must create the AliyunServiceRoleForRdsPgsqlOnEcs and AliyunServiceRoleForRDSProxyOnEcs service-linked roles (SLRs) for ApsaraDB RDS for PostgreSQL. The roles are used to establish network connections by binding elastic network interfaces (ENIs) to the server on which your RDS instance resides.

    Note

    Instance Description (Optional)

    You can enter a description for the RDS instance. The value must be 2 to 255 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter.

    Privileged Account

    You can select Configure Now and configure the Database Account and Password parameters to create a privileged account when you create the RDS instance. You can also select Configure Later and create a privileged account after the RDS instance is created.

    For more information about privileged accounts, see Create an account.

  15. Click Next: Confirm Order.

  16. Confirm the configuration in the Parameter Configuration section, configure the Quantity parameter, read and select Terms of Service, and then click Pay Now to complete the payment.

  17. View the serverless RDS instance.

    Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance based on the Creation Time parameter.

What to do next

Create a database and an account on an ApsaraDB RDS for PostgreSQL instance

FAQ

After I submit an order to create an RDS instance, I cannot find the serverless RDS instance that is in the Creating state. Why?

Possible cause

Description

Suggestion

Incorrect region

The region that you selected is not the region where the RDS instance resides.

In the top navigation bar, select the region in which the RDS instance resides. Then, you can find the RDS instance.

Insufficient resources

The zone that you selected cannot provide sufficient resources.

You can go to the Orders page to view the refund.

Select a different zone and try again.

References

  • For more information about how to change the scaling range of RCUs for a serverless RDS instance, see Change the scaling range of RCUs.

  • For more information about how to configure the automatic start and stop feature for a serverless RDS instance, see Configure the automatic start and stop feature.

  • For more information about how to change the scaling policy of a serverless RDS instance, see Change the scaling policy of RCUs.

  • For more information about how to release a serverless RDS instance, see Release or unsubscribe from an ApsaraDB RDS for PostgreSQL instance.

  • For more information about how to create a serverless RDS instance by calling an operation, see Create an instance.

    Parameters required to create a serverless ApsaraDB RDS for PostgreSQL instance by calling an operation

    Parameter

    Description

    Example

    RegionId

    The ID of the region. You can call the DescribeRegions operation to query the most recent region list.

    cn-hangzhou

    Engine

    The database engine of the serverless instance.

    PostgreSQL

    EngineVersion

    The database engine version of the serverless instance.

    PostgreSQL 14 and later are supported.

    14.0

    DBInstanceClass

    The instance type of the instance.

    • If you want to create a serverless instance that runs RDS Basic Edition, set the value to pg.n2.serverless.1c.

    • If you want to create a serverless instance that runs RDS High-availability Edition, set the value to pg.n2.serverless.2c.

    pg.n2.serverless.1c

    DBInstanceStorage

    The storage capacity.

    Valid values of this parameter range from 20 to 32000 because only the PL1 ESSD storage type is supported. Unit: GB.

    20

    DBInstanceNetType

    The network connection type of the instance. Set the value to Intranet, which indicates an internal network.

    Intranet

    SecurityIPList

    The IP address whitelist of the instance. For more information, see Use a database client or the CLI to connect to an ApsaraDB RDS for PostgreSQL instance. You can configure an IP address whitelist to allow access from specified IP addresses.

    If you want to add more than one entry to the IP address whitelist, separate the entries with commas (,). Each entry must be unique. You can add up to 1,000 entries.

    10.10.XX.XX

    PayType

    The billing method of the serverless instance.

    Set the value to Serverless.

    Serverless

    ZoneId

    The ID of the zone in which the primary instance resides.

    cn-hangzhou-i

    ZoneIdSlave1

    If you want to create a serverless instance that runs RDS High-availability Edition, you must also specify the ID of zone in which the secondary serverless instance resides.

    cn-hangzhou-h

    InstanceNetworkType

    The network type of the instance. Set the value to VPC.

    VPC

    VPCId

    The VPC ID of the instance.

    vpc-bp****

    VSwitchId

    The ID of the vSwitch. If you specify the ZoneSlaveId1 parameter, you must enter two the IDs of two vSwitches and separate them with a comma (,).

    vsw-bp****

    DBInstanceStorageType

    The storage type of the serverless instance.

    Set the value to cloud_essd.

    cloud_essd

    Category

    The RDS edition of the instance.

    • If you want to create a serverless instance that runs RDS Basic Edition, set the value to serverless_basic.

    • If you want to create a serverless instance that runs RDS High-availability Edition, set the value to serverless_standard.

    serverless_basic

    ServerlessConfig

    The settings of the instance.

    MaxCapacity

    The maximum number of RCUs.

    Valid values: 1 to 14.

    12

    MinCapacity

    The minimum number of RCUs.

    Valid values: 0.5 to 14

    0.5

    AutoPause

    Specifies whether to enable the automatic start and stop feature for the serverless RDS instance. Valid values:

    • true: enables the feature.

    • false: disables the feature. This is the default value.

    true

    SwitchForce

    Specifies whether to enable the forceful scaling feature for the instance. Valid values:

    • true: enables the feature.

    • false: disables the feature. This is the default value.

    true