Skip to main content

Setup Local Edge Server

This guide will help you to setup an Edge Server on you host computer. You can use the same information to host the edge server locally in your private network, On-premises, or in your cloud provider.

Step 1: Run Edge Server Container

Datafi self hosted Edge Servers are containerized, they can be run anywhere a Docker container can run. If you don't have a Docker environment, you can start by installing Docker on your host computer.

Complete the following steps to setup a local Edge Server.

These step-by-step instructions will show you how to setup an Edge Server on your host computer and connect a MySQL database. You can use the same steps to connect other supported data sources by using the specific Datafi CLI dfcli parameters.

  1. Install Docker Desktop and complete the setup steps (ref: https://www.docker.com/products/docker-desktop )

  2. Verify Docker has been installed by running the following command and confirm the Hello from Docker! reply:

    docker run hello-world
  3. Open the Terminal and run the following commands to pull and then run the latest dfcli container image:

    docker pull datafi/cli:latest
    docker run --rm -ti -v ~/temp:/es/out datafi/cli:latest

    The CLI container will export to the /es/out folder and connects a local directory (~/temp). Instead of ~/temp you can use any local directory.

  4. The previous step runs the CLI container and installs dfcli. Use dfcli to generate the environment variable used while running the Edge Server. Run the following command in the bash shell from the previous step.

    dfcli dataset --endpoint <IP address or host name where the Edge Server will run> --type mysql --name <name of your dataset> --pointOfContact <your email address>  --address <IPP address of host name of your mysql server> --dbname <database name>  --username <database user> --password <user password> add

    The above command adds a MySQL database. The parameters will be different for each data source. Run dfcli dataset to see the parameters for the available data sources.

    This step will connect to the data source with the provided credentials. It will generate a key.txt file in the es/out folder. The key.txt file will be used in Setp 5 when running the container. Before continuing, copy the unique URL for the dataset which will be used in setp 6.

    Enter exit to quite the CLI.

  5. Run the Edge Server container with the key.txt file as an environment variable.

    docker pull datafi/es:latest
    docker run --rm -p 443:443 -e KEY=$(cat ~/temp/key.txt)  datafi/es:latest

    Once started, you should see Edge Server started in the logs

  6. Use the URL copied from step 4 to connect the Edge Server and add the dataset to your Datafi workspace. Note: Log into your workspace before opening the link from your browser. Signed up for a free Datafi account here.

Step 2: Configure your Dataset

After completing Step 1, you should see the Edit Dataset dialog which will allow you to configure and edit the details for the dataset. Once this is saved, you will be redirected to the Catalog

(The dialog can be accessed again any time by clicking the Edit icon of the dataset you are currently active on, in case you close it before you are finished or want to make a change.)

Overview

In the dataset Overview you can update the name, description, and tags for your dataset. This information is used to help other users find this dataset and it’s contents.

Rules

The rules sections allows you to create security access and data privacy rules that can mask specific fields in your dataset's tables. Rules control how data is seen by users.

Step 3: Viewing your data

Data can be viewed in your workspace and shared with other users. More details can be found here