Skip to content

Connect to your database

To use SDKs to connect to your database, you must complete the actions in this topic to configure network access.

Prerequisites

A database instance is created. For more information, see Create an instance.

Step 1. Configure network access

Required role: Project Admin

Access the database through public network

  1. In NebulaGraph Cloud, switch to the project you want to use, and click the name of the database to view the database details.

  2. In the left-side navigation pane, click Network access under Security.

  3. On the IP Allow List tab, click the toggle switch to enable accessing the database through public network.

  4. Click + Add IP Addresses to add custom IP addresses to the allow list.

  5. Create the database user. For more information, see Create a database user.

Access the database through private network

  1. In NebulaGraph Cloud, switch to the project you want to use, and click the name of the database to view the database details.

  2. In the left-side navigation pane, click Network access under Security.

  3. Click the Private Endpoint tab.

  4. In the Create Private Link Service pane, click Create to enable the private link service.

    Note

    The service name is automatically generated as part of the command in the Create Private Link Endpoint pane after you create the endpoint. You can copy this service name for later use. For example: --service-name com.amazonaws.vpce.us-west-2.vpce-svc-0e1234567890abcdef.

  5. In the Create Private Link Endpoint pane, specify your VPC ID and subnet ID.

    1. Click Learn more to navigate to the AWS console page.

    2. Click Endpoints in the left-side navigation pane and then click Create endpoint.

    3. In the Endpoint settings pane, select Endpoint services that use NLBs and GWLBs as the endpoint Type.

    4. In the Service settings pane, enter the pasted service name and click Verify service.

    5. When the service name is verified, complete network settings, subnet, security groups, and click Create endpoint.

    6. When the endpoint is successfully created, copy the VPC ID and subnet ID.

  6. Navigate back to the NebulaGraph Cloud and paste the VPC ID and subnet ID into the corresponding field in the Create Private Link Endpoint pane.

  7. Run the automatically generated command in your AWS CLI to create the private link endpoint.

  8. Create the database user. For more information, see Create a database user.

Step 2. Connect to your database using SDKs

Required role: Project Admin or Project Member

  1. In the left-side navigation pane, click Overview under Basic.

  2. In the upper-right corner of the Overview page, click Connect.

  3. In the Connect to your database dialog, specify the following items and click Confirm:

    • Choose a connection type: Select Public (Connect via public network) or Private (Connect via private endpoint).
    • Install the client: Select NebulaGraph Java, NebulaGraph Go, or NebulaGraph Python, and click Download installation package for installation.
    • Connect: Take note of the Host and Port information. Then click Database Users to obtain the Username and Password. For more information, see Manage database users.
  4. Set up the SDKs with the connection information obtained in the previous step.