Accessing Your Scalingo for OpenSearch® Addon

Remotely accessing your Scalingo for OpenSearch® database can sometimes be useful, for example, to conduct investigations, to check or compute data locally, to dump the database content, etc.

We provide several ways to access your database remotely. Chosing one mostly depends on your needs and preferences.

Using a One-Off

  1. Start a one-off container
  2. From the command line, use curl (or any other tool able to communicate through HTTP) to query the database. For example:
    curl $SCALINGO_OPENSEARCH_URL
    

    The output should look like this:

    {
      "name" : "3ed4f8a8-a7b8-4bd6-a2a5-e139befaf20d.my-app-4553.opensearch.a.osc-fr1.scalingo-dbs.com",
      "cluster_name" : "my-app-4553",
      "cluster_uuid" : "F22ZsuhSTp6boW-HlMWuqB",
      "version" : {
        "distribution" : "opensearch",
        "number" : "2.19.1",
        "build_type" : "tar",
        "build_hash" : "2e4741fb45d1b150aaeeadf66d41445b23ff5982",
        "build_date" : "2025-02-27T01:16:47.726162386Z",
        "build_snapshot" : false,
        "lucene_version" : "9.12.1",
        "minimum_wire_compatibility_version" : "7.10.0",
        "minimum_index_compatibility_version" : "7.0.0"
      },
      "tagline" : "The OpenSearch Project: https://opensearch.org/"
    }
    

Using Third Party Tools

By default, and for security reasons, your OpenSearch® database is not directly accessible from the Internet and therefore not directly usable with your third-party tool of choice.

To access your database remotely you first need to make it reachable over the Internet:

Once a secured connection has been established, you should be able to connect to your database with your preferred tool. If you don’t have one yet, we suggest you to take a look at Postman or curl.

Making the Database Reachable Over Internet

Using Our Command Line Tool

Our command line tool provides a db-tunnel command that creates an SSH encrypted tunnel between the computer running the command and our platform, allowing remote secured access to your OpenSearch® addon.

  1. Make sure you have correctly setup the Scalingo command line tool
  2. Make sure you have correctly setup SSH authentication on your Scalingo account
  3. From the command line, open the tunnel using this command:
    scalingo --app my-app db-tunnel SCALINGO_OPENSEARCH_URL
    

    The output should look like this:

    Building tunnel to my-app-4553.opensearch.a.osc-fr1.scalingo-dbs.com:33712
    You can access your database on:
    127.0.0.1:10000
    
  4. The database is now reachable from 127.0.0.1 on port 10000
  5. To specify the port number to bind to (default is 10000), use the --port option:
    scalingo --app my-app db-tunnel SCALINGO_OPENSEARCH_URL --port 12345
    
  6. To close the tunnel, use the keyboard shortcut CTRL+C:
    ^Cinterrupt catched, aborting…
    

Using OpenSSH

Our command line tool handles it in a single command, but you might want to create a tunnel without it. With the standard OpenSSH client, the way to build the tunnel is:

  1. Identify the connection URI for your database
  2. Make sure to understand how the connection URI is built
  3. From the command line, run the following command to create the tunnel:
    ssh -L <local_port>:<db_url>:<db_port> git@<ssh_hostname> -p 22 -N
    

    With:

    • local_port: local port number you want to bind to
    • db_url: URL of your database, from the environment variable
    • db_port: port
    • ssh_hostname: depends on your region:
      • For osc-fr1: ssh.osc-fr1.scalingo.com
      • For osc-secnum-fr1: ssh.osc-secnum-fr1.scalingo.com
    • (the SSH user is always git and the SSH port is always 22)

    The output should stay blank

  4. The database is now reachable from 127.0.0.1 on local_port

Enabling Direct Access Over Internet

  1. Make sure you have TLS enforced
  2. From your web browser, open your database dashboard
  3. Select the Settings tab
  4. In the Settings submenu, select Internet Access
  5. Locate the Internet Accessibility block
  6. Click the Enable button
  7. The database is now available using the corresponding connection URI

Suggest edits

Accessing Your Scalingo for OpenSearch® Addon

©2025 Scalingo