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

Binding a Container-Deployed Component to a Cloud Database

To store application data permanently, you need to use Relational Database Service (RDS). Based on the cloud computing platform, ServiceStage provides RDS for MySQL which is reliable, scalable, easy to manage, and ready for use. RDS for MySQL enables you to easily set and scale relational databases on the cloud. Using the RDS service, you can perform nearly all necessary tasks without programming. This service simplifies operation procedures and reduces routine O&M workloads, so that you can focus on application and service development.

You can bind a cloud database when configuring Cloud Service Settings. After binding, you can read environment variables upon application running to obtain MySQL information. For details, see Common Environment Variables.

Prerequisites

An RDS MySQL DB instance has been created. For details, see Buying an RDS for MySQL DB Instance.

Binding a Cloud Database

  1. Choose Cloud Service Settings > Relational Database Service.
  2. Click Bind Cloud Database.
  3. Select a cloud database instance that has been bound in the environment and click OK.

    If no cloud database instance is bound to the environment, click Add one and add a cloud database instance to the environment. For details, see Managing Basic Resources.

  4. Set the parameters by referring to the following table. Parameters marked with an asterisk (*) are mandatory.

    Parameter

    Description

    *Connection Type

    Select a connection type.

    • JNDI: standard Java connection mode. You need to enter the JNDI name.
    • Spring Cloud Connector: Spring connection mode.

    *Database Name

    Enter a database name.

    *Database Account

    Enter a database account.

    *Database Password

    Enter the database password.

  5. Click OK.

    Move the cursor to a bound cloud database and perform the following operations:

    • Rebind a cloud database: Click and select the target cloud database again.
    • Delete a bound cloud database: Click .