LogoLogo
Release notesAPI docsDocs homeEphemeral CloudTonic.ai
  • Tonic Ephemeral guide
  • About Tonic Ephemeral
  • Getting started with the Ephemeral free trial
  • Managing your Ephemeral account
  • Managing Databases
    • Viewing the list of databases
    • Starting a database
    • Changing the database configuration
    • Database configuration settings
      • Setting the required resources for a database
      • Setting the database expiration
      • Providing a custom configuration file
    • Connecting to a database
    • Resetting a database
    • Deactivating and reactivating databases
    • Managing auto snapshots
    • Tracking database activity
    • Deleting a database
  • Managing user snapshots
    • About user snapshots
    • Viewing the user snapshot list
    • Creating a user snapshot from an Ephemeral database
    • Creating a user snapshot from imported data
    • Editing a user snapshot
    • Creating a database from a user snapshot
    • Deleting a user snapshot
  • Installing and configuring Ephemeral
    • Ephemeral architecture
    • Configuring an allowlist for Ephemeral Cloud database connections
    • Installing a self-hosted instance of Ephemeral
      • System requirements
      • Deploying Ephemeral with Helm
    • Configuring database access on a self-hosted instance
    • Configuring tolerations and node selectors
    • Managing access to Ephemeral
      • Managing Ephemeral users
      • Enabling SSO on a self-hosted instance
        • Google
        • Okta
    • Setting the registry location for data volumes
    • Managing custom images
      • Creating, editing, and deleting custom images
      • Oracle image configuration
    • Configuring automatic deletion of snapshots
  • Monitoring and data collection
    • Monitoring your Ephemeral billed usage
    • Monitoring your disk storage
    • Data that Tonic.ai collects
  • Using the Ephemeral API
    • About the Ephemeral API
    • Configuring Ephemeral
    • Getting information about Ephemeral databases
    • Starting a database
    • Managing databases
    • Managing snapshots
Powered by GitBook
On this page
  • Displaying the connection details
  • Connecting through an SSH tunnel (for older databases)
  • Creating an SSH tunnel to a database
  • Confirming and troubleshooting the SSH tunnel connection

Was this helpful?

Export as PDF
  1. Managing Databases

Connecting to a database

PreviousProviding a custom configuration fileNextResetting a database

Last updated 2 months ago

Was this helpful?

For each active database, Tonic Ephemeral provides access to the connection details for the database.

The connection information is on the Connection Details tab of the database details panel.

Displaying the connection details

From the Databases page, to display the connection details for the database:

  • Click the database icon for the database.

  • Click the options icon for the database, then click Connection Info.

On the Connection Details tab, each field includes a copy icon to allow you to copy the value to the clipboard.

Note that by default, databases on Ephemeral Cloud are publicly accessible. To limit database access to specific IP addresses, you can configure an allowlist. For more information, go to Configuring an allowlist for Ephemeral Cloud database connections.

Connecting through an SSH tunnel (for older databases)

For Ephemeral Cloud databases that were created before version 064, you connect to the database through an SSH tunnel.

For these databases, the connection details include the information for the SSH tunnel.

Creating an SSH tunnel to a database

To create an SSH tunnel to a database from a local machine:

ssh -N -L <localport>:<database-hostname>:<database-port> <bastion-username>@<bastion-host> -p <bastion-port>

For example:

ssh -N -L 9999:svc-bd391f5270d64defb63100cc1bdaa32b:5432 jumper@db.ephemeral.tonic.ai -p 9000

In the command:

  • -N tells SSH to not open a shell. Ephemeral does not allow shell access.

  • <localport> is the port the database will be accessible at on your local machine.

  • The other values (<database-hostname>, <database-port>, <bastion-username>, <bastion-host>, <bastion-port>) are available from the Connection Info panel.

If the private key file is not configured in your SSH agent, then you can optionally add -i to specify the private key file.

ssh -N -L <localport>:<database-hostname>:<database-port> <bastion-username>@<bastion-host> -p <bastion-port> -i <private-key-file>

For example:

ssh -N -L 9999:svc-bd391f5270d64defb63100cc1bdaa32b:5432 jumper@db.ephemeral.tonic.ai -p 9000 -i ephemeral-key.pem

Confirming and troubleshooting the SSH tunnel connection

If you are not sure that the connection is successful, or are unable to connect to the database, then here are a couple of troubleshooting steps to check that the tunnel is open and you can connect to the database.

Verifying that the tunnel is open

To verify that the tunnel is open, try to connect in a tool such as telnet or netcat. Test the connection from the same machine that you used when you ran the command to open the tunnel.

For example, to use netcat to try to connect from your local machine:

nc -zv localhost <localPort>

Or for telnet:

telnet localhost <localPort>

If the tool does not return an error, then the tunnel is open.

Verifying that you can connect to the database

After you verify that the tunnel is open, to verify that you can connect to the database, use a terminal client to issue a query against the database.

If the query from the terminal client is successful, but you are unable to connect from your database client, then there might be an issue with your database client.

Connection details icon for a database
Actions menu with the Connection Info option
Connection details for a database
Connection details for an Ephemeral database that requires a connection through an SSH tunnel