Skip to main content
The Connect Gateway is an on-premises gateway, which is installed as a Docker container. This on-premises gateway acts as a secure reverse tunnel between the data behind your company’s firewall, private network, or Virtual Private Cloud (VPC) and the Connect AI cloud-based services. It allows Connect AI to access your data without exposing your data directly to the internet.
Connect Gateway Architecture
You then register each gateway in the Connect AI user interface, within the individual connection setup. You can have gateways in multiple locations. You must register a gateway in Connect AI for each location. The Connect Gateway provides high availability by supporting multiple Docker containers pointing to the same location and account ID. If one container goes down, requests are automatically routed to the remaining gateway instances. The following diagram shows how Connect Gateway supports multiple locations and multiple data sources.
Connect Gateway Architecture Advanced
Currently, Connect AI supports the following connectors with the Connect Gateway:
  • Databricks
  • PostgreSQL
  • MySQL
  • SAP Gateway
  • Snowflake
  • SQL Server
Contact CData Support if you need a different connector with the Connect Gateway. Installing the Connect Gateway involves two main steps:
2
Install and run the on-premises gateway from the Docker container image. Run the Docker gateway in each location where your on-premises data is located. See Install the On-Premises Gateway for more information.

Register the Connect Gateway in Connect AI

To register the Connect Gateway in Connect AI:
1
Go to Sources and click Add Connection for a new connection, or edit an existing connection.
2
Click the Gateways tab in the Add/Edit Connection page.
3
In Gateways, click Add. The Add Gateway dialog appears.
Add Gateway
4
Enter a descriptive location name to identify where the gateway is installed, and click Confirm.Your location appears in the Gateways list, along with a key and a Pending status. Click the eye icon to view the key.
Gateways List
You need to copy the following values for the on-premises gateway (click the copy icons):
  • Account Id–this is the ACCOUNT_ID environment variable for the on-premises gateway.
  • Location Id–this is the AGENT_LOCATION_ID environment variable for the on-premises gateway.
  • Key–this is the AGENT_API_KEY environment variable for the on-premises gateway.

Install the On-Premises Gateway

The on-premises gateway is a lightweight service that runs inside your network and acts as a secure reverse tunnel between Connect AI and your local data sources. The gateway registers itself with Connect AI on startup. It then listens for incoming connections, via Azure Relay technology, without ever exposing them to the public internet. The gateway is protocol-agnostic: it forwards raw bytes without any knowledge of the database protocol (such as MySQL, PostgreSQL, or SQL Server), making it compatible with any TCP-based data source.

Prerequisites

To install the on-premises gateway at your location, you must have the following:
  • Docker installed on the host machine.
  • Network access to cloud.cdata.com.
  • The gateway created in Connect AI.

Environment Variables

The following environment variables are required to run the gateway:
VariableDescription
AGENT_LOCATION_IDThe unique identifier for this gateway instance. Copy the value under the user-defined Location Name in the Gateways list in Connect AI.
AGENT_API_KEYThe secret API key used to authenticate this gateway with Connect AI. Copy the value under Key in the Gateways list in Connect AI.
ACCOUNT_IDYour CData Connect AI account identifier. This is specific to your organization. Copy Account Id in the Gateways list in Connect AI.

Run the Gateway in Docker

Run the gateway as follows:
docker run \
    --name my-onprem-agent \
    -e AGENT_LOCATION_ID=<agent_location_id> \
    -e AGENT_API_KEY=<agent_api_key> \
    -e ACCOUNT_ID=<account_id> \
    connectaipublic.azurecr.io/cloudagent:latest
docker run will pull the Docker image from the registry if it is not already present on the host..

View Docker Logs

docker logs -f my-onprem-agent

Stop the Gateway

docker stop my-onprem-agent
docker rm my-onprem-agent

Docker Compose

Copy the following and save as docker-compose.yml:
version: "3.8"

services:
  onprem-agent:
    image: connectaipublic.azurecr.io/cloudagent:latest
    container_name: my-onprem-agent
    restart: unless-stopped
    environment:
      AGENT_LOCATION_ID: <agent_location_id>
      AGENT_API_KEY: <agent_api_key>
      ACCOUNT_ID: <account_id>

Start the Gateway

docker compose up
docker compose up will pull the Docker image from the registry if it is not already present on the host.

View Logs

docker compose logs -f

Stop the Gateway

docker compose down

Finish Connect Gateway Setup

Return to Connect AI and finish the Connect Gateway setup.
1
When you complete the steps in Install the On-Premises Gateway, you can then test the gateways you added to Gateways. Click the Connect Gateway tab of the Add/Edit Connection page. Click Test Gateways. The Status turns to Success if all gateway setup is complete.
You still need to click Save & Test to test the entire connection.
2
Return to the Basic Settings tab of your connection. Under Connection Type, select Connect Gateway.
3
Select the Connect Gateway location to use from the drop-down list.
Basic Settings
4
Enter the Authentication instructions for the connector according to the connector’s Documentation pane.
5
Click Save & Test to authenticate your connector.