<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ameen Vazhayil</title>
    <description>The latest articles on DEV Community by Ameen Vazhayil (@vazra).</description>
    <link>https://dev.to/vazra</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F303873%2F4fb93184-3800-4c75-a79a-d35e4fdb4ace.jpeg</url>
      <title>DEV Community: Ameen Vazhayil</title>
      <link>https://dev.to/vazra</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vazra"/>
    <language>en</language>
    <item>
      <title>How to setup Datafi Edge Server in Debian 11 with Docker for MSSQL DB</title>
      <dc:creator>Ameen Vazhayil</dc:creator>
      <pubDate>Fri, 08 Jul 2022 19:58:14 +0000</pubDate>
      <link>https://dev.to/vazra/how-to-setup-datafi-edge-server-in-debian-11-with-docker-for-mssql-db-1975</link>
      <guid>https://dev.to/vazra/how-to-setup-datafi-edge-server-in-debian-11-with-docker-for-mssql-db-1975</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Datafi edge server is available as a container, so It can run anywhere a container can run. In this tutorial we are going to run the datafi edge server in a Debian 11 Server. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;A server/vm running Debian 11&lt;/li&gt;
&lt;li&gt;Basic understanding of Docker &lt;/li&gt;
&lt;li&gt;Basic understanding of SSH commands&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I've setup a Debian 11 Server in Azure, you can do the same anywhere including a onpremise machine. &lt;/p&gt;

&lt;h3&gt;
  
  
  1. SSH into the server.
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpcwwwbr0ocijzlhxoqas.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpcwwwbr0ocijzlhxoqas.png" alt="Debian 11 is running"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Install docker
&lt;/h3&gt;

&lt;p&gt;Detailed instruction to install docker in Debian is available &lt;a href="https://docs.docker.com/engine/install/debian/" rel="noopener noreferrer"&gt;here&lt;/a&gt;, we are using the convenience script provided in the docker documentation&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To make sure the docker is installed and running, run this command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo docker run hello-world
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;it should print out &lt;code&gt;Hello from Docker!&lt;/code&gt;. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F77uvgk39d69xkf6rigta.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F77uvgk39d69xkf6rigta.png" alt="Hello from Docker"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  3. Download Datafi-CLI tool
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;datafi-cli&lt;/code&gt; is a simple CLI tool to configure edge-server. It can be run either in your local machine or in the server. In this tutorial, we are running it in the same debian server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# download the cli
curl -fsSL https://github.com/datafilabs/datafi-cli/releases/download/v1.0.0/dfcli-linux -o dfcli
# allow executing the cli 
sudo chmod +x ./dfcli
# make sure the version is printed 
./dfcli --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6bbew93rhhlflggpspjh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6bbew93rhhlflggpspjh.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Run edge-server container.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo docker pull datafi/es:latest
sudo docker run --rm -p 50051:50051 -p 443:443 datafi/es:latest 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;when you run the container for the first time with the above command you will get a warning that says &lt;code&gt;E0706 05:22:13.617044       7 policy.go:112] error opening socket connection: token missing in policy&lt;/code&gt;. You can ignore this now, as we don't have the container configured yet.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Configure the edge-server with the datafi-cli
&lt;/h3&gt;

&lt;p&gt;In a new terminal, run datafi-cli &lt;code&gt;dataset add&lt;/code&gt; command with required parameters including the service level credentials to the MSSQL db.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# check if the credentials are valid, and the db is reachable. 
./dfcli dataset --type mssql --dbname WideWorldImporters --password "pass" --port 1433 --server datafi-mssql.database.windows.net --username user check
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will try to connect to the mssql database and make sure the given credentials are valid. If its able to connect, you will see &lt;code&gt;Connection successful&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# generate KEY to be used in the environment variable for the edge server container. 
./dfcli dataset --type mssql --dbname WideWorldImporters --password "pass" --port 1433 --server datafi-mssql.database.windows.net --username user --name "MSSQL" --endpoint "datafi.acme.com" --pointOfContact yourname@domain.com add
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this will generate the KEY and save it in &lt;code&gt;key.txt&lt;/code&gt;. You will also get a URL which you can use to add the edge-server to your Datafi workspace. &lt;/p&gt;

&lt;h3&gt;
  
  
  6. Add edge-server to your Datafi workspace.
&lt;/h3&gt;

&lt;p&gt;If you don't have a Datafi account, go to &lt;a href="https://home.datafi.us/register" rel="noopener noreferrer"&gt;https://home.datafi.us/register&lt;/a&gt; and create a new workspace&lt;/p&gt;

&lt;p&gt;The use the link you got in the previous step to add the newly added edge server to the workspace. Follow the instructions on the screen and save the dataset. &lt;/p&gt;

&lt;h3&gt;
  
  
  7. Restart the Edge Server container with &lt;code&gt;KEY&lt;/code&gt; environment variable
&lt;/h3&gt;

&lt;h3&gt;
  
  
  8. Go to &lt;a href="https://home.datafi.us/dataview" rel="noopener noreferrer"&gt;https://home.datafi.us/dataview&lt;/a&gt; to access the newly added dataset.
&lt;/h3&gt;

</description>
    </item>
  </channel>
</rss>
