Skip to content

Connect to your database

BYOC connections

For a database in a BYOC organization, use Connect to a BYOC database for its prerequisites, network setup, and database credentials.

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.

    • Add Current IP Address: Click this button to automatically add your current IP address to the allow list.
    • Allow Access From Anywhere: Click this button to allow access from any IP address. This option is not recommended for security reasons.
  5. Obtain the database user credentials. When a database is created, three built-in users are created by default: db_root (ADMIN), db_writer (SCHEMA_DESIGNER, GRAPH_READ_WRITE), and db_reader (GRAPH_READ_ONLY). The password of db_root is displayed only once upon database creation. Make sure to save it securely. To reset the password later, see Reset password. You can also create additional database users. 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. Obtain the database user credentials. When a database is created, three built-in users are created by default: db_root (ADMIN), db_writer (SCHEMA_DESIGNER, GRAPH_READ_WRITE), and db_reader (GRAPH_READ_ONLY). The password of db_root is displayed only once upon database creation. Make sure to save it securely. To reset the password later, see Reset password. You can also create additional database users. 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: From the Choose a client drop-down list, select a client (such as NebulaGraph Java, NebulaGraph Go, or NebulaGraph Python). Click the client documentation link to view the installation guide.
    • Connect: Copy the Host and Port information. 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.