Installing Znode Dependencies


TABLE OF CONTENTS

This quickstart guide provides instructions on installing Znode's dependencies to prepare for a Znode installation. The instructions are organized into the following parts:

  • Part 1: Installing Java Development Kit (JDK)

  • Part 2: Installing Elasticsearch

  • Part 3: Installing MongoDB

Znode's Dependencies

Znode depends on the following software to properly run. Other versions may work, but the following versions are most rigorously tested. For version requirements please refer to Znode System Requirements.

  • .NET Ecosystem:

    • .NET Framework 

    • Visual Studio 

    • IIS (or IIS Express with VS)

    • Microsoft SQL Server (Standard Edition at least, with SQL Server Agent installed)

  • Non-.NET Ecosystem:

    • Java Development Kit (JDK)

    • Elasticsearch 

    • MongoDB 

It is assumed that a proper .NET development environment is already set up. For that reason, Visual Studio, IIS, and SQL Server installation help is not provided in this guide. This guide covers the installation of the JDK, Elasticsearch, and MongoDB.

Part 1: Installing Java Development Kit (JDK)

To run Znode, the JDK must be installed. Note that Znode itself does not depend on Java, but Znode depends on Elasticsearch, which depends on Java.

Install JDK

Follow these steps to install the JDK. Znode uses Elasticsearch, so any JDK that is compatible with Elasticsearch will work. 

  1. Acquire a copy of the JDK 

  2. Run the JDK installer.

  3. Follow the steps built into the installer.

Configure 'JAVA_HOME' Environment Variable

Elasticsearch also assumes that a Windows Environment Variable will point to the JDK installation path. To set this, follow these steps:

  1. Open a command prompt as an administrator.

  2. Run (the version detailed below is only to be used as an example reference, ie jdk-17.0.1) 

    setx -m JAVA_HOME "C:\Program Files\Java\jdk-17.0.1"
    JavaScript

     at the command prompt. Update the path to match that of the local JDK installation if necessary.

  3. The variable can be verified by restarting the command prompt and running 

    echo %JAVA_HOME%
    JavaScript

Part 2: Installing Elasticsearch


Reference Article for Elasticsearch 8.8.1 for Znode versions (9.7.7 +): Installation Details of Elasticsearch 8.8.1 Version


Follow these steps to install Elasticsearch.

  1. Acquire a copy of Elasticsearch

  2. Copy the Elasticsearch folder to the root of the C: drive, or another desired location.

  3. Open a command prompt as an administrator and execute the following commands to install the Elasticsearch Windows Service and run it in the background:

    1. (the version detailed below is only to be used as an example reference) 

      cd C:\elasticsearch-7.16.2\bin
      HTML
    2. C:\elasticsearch-7.16.2\bin>elasticsearch-service.bat install
      HTML
    3. C:\elasticsearch-7.16.2\bin>elasticsearch-service.bat start
      HTML
    4. This will then register Elasticsearch as a service

Part 3: Installing MongoDB

Follow these steps to install MongoDB. Znode officially supports MongoDB

  1. Acquire a copy of MongoDB

  2. Run the MongoDB installer. Choose the Complete option.

  3. On the next page, keep the default options of Install MongoDB as a Service and Run service as a Network Service user. Click Next.

  4. The Install MongoDB Compass option can be deselected because it is not needed. Click Next.

  5. Click Install. Wait while the installation is performed.

  6. Click Finish to acknowledge the completion of the installation.

Part 4: Installing Python and Configuring LaunchPad Service in SQL Server

This guide walks you through the process of installing Python and configuring the LaunchPad service in SQL Server using Python scripts. Each step is explained clearly to ensure ease of understanding and execution.

Note: Machine Learning Services is not supported on a SQL Server Failover Cluster Instance (FCI). If you want high availability with Machine Learning Services, use Always On availability groups instead.

1. Install and Enable the SQL Server LaunchPad Service

The LaunchPad service is used to run external scripts (like Python) within SQL Server.

  1. Open SQL Server Installation Center.
  2. Select “Add Features to an Existing Instance”.
  3. Enable the Machine Learning Services and Language Extensions feature.
  4. Finish the installation and restart the SQL Server instance if required.

2. Install Python (3.10.0)

Required Version: Python 3.10.0(Implementation is done with this version.)

Note:  Python must be installed on the same machine where SQL Server is installed.

  1. Download Python 3.10.0 from the official Python Site.
  2. Run the installer as an administrator.
  3. Ensure you select “Add Python to PATH” during installation.
  4. Install Python to: C:\Program Files\Python310\
  5. Ensure Python is installed in the specified path (C:\Program Files\Python310\) because all the next steps depend on this step.

3. Install Required Python Libraries

Use the command prompt to install the necessary libraries into the correct Python directory.

Open Command Prompt as Administrator and Run:

1. cd "C:\Program Files\Python310\"
python -m pip install -t "C:\Program Files\Python310\Lib\site-packages" dill numpy==1.22.0 pandas patsy python-dateutil
Generic

2. python -m pip install -t "C:\Program Files\Python310\Lib\site-packages" https://aka.ms/sqlml/python3.10/windows/revoscalepy-10.0.1-py3-none-any.whl
Generic

4. Install Required Libraries for ElasticSearch (v8.8.1)

Run in Command Prompt:

python -m pip install elasticsearch==8.13.0
Generic

5. Add the znodeelastic.py file to the directory where Python is installed

  1. Copy znodeelastic.py from your Znode SDK folder Path:  ( {Your SDK folder}/ZnodePythonElasticConfiguration/znodeelastic.py).
    1. Example: C:\znode-9.9.2_support\ZnodePythonElasticConfiguration    
  2. Paste the file into the C:\Program Files\Python310\Lib\site-packages directory to make it accessible in the Python environment.

Note: Please update the path accordingly if Python is installed in a different location on your machine.

6. Grant Permissions to LaunchPad and Application Packages

To allow SQL Server to use the installed Python libraries, grant access to the necessary services.

To get the SQL LaunchPad service name, follow these steps:

  1. Press Windows Key + R to open the Run dialog.

  2. Type services.msc and press Enter.

  3. In the Services window, locate SQL Server LaunchPad.

  4. Right-click on SQL Server LaunchPad and select Properties.

  5. In the Properties window, the Service name will be displayed at the top.


Note: If the SQL Server instance (service name) is different, update the service name accordingly in the command below.

Run in Command Prompt:

1. icacls "C:\Program Files\Python310\Lib\site-packages" /grant "NT Service\MSSQLLaunchpad$SQL2022":(OI)(CI)RX /T
2. icacls "C:\Program Files\Python310\Lib\site-packages" /grant *S-1-15-2-1:(OI)(CI)RX /T
Generic

7. Register Python with SQL Server

To configure the Python runtime with your SQL Server instance, open Command Prompt as  Administrator mode.    

Note: Before executing the command make sure to replace your SQL instance if the instance name is  different.

To find the instance name use the below steps:

Press Windows Key + R, type services.msc, and press Enter → Look for services named like SQL Server (MSSQLSERVER) → The name in parentheses is the instance name.

Run in Command Prompt:

cd "C:\Program Files\Python310\Lib\site-packages\revoscalepy\rxLibs"
.\RegisterRext.exe /configure /pythonhome:"C:\Program Files\Python310" /instance:"SQL2022"
Generic

8. Enable External Script Execution in SQL Server

Note:  Make sure the SQL user has sufficient privileges to execute the script below on the master database.

Run in Command Prompt:

EXEC sp_configure 'external scripts enabled', 1;
RECONFIGURE WITH OVERRIDE;

-- Test the Python script execution
EXEC sp_execute_external_script 
  @script = N'import sys; print(sys.version)', 
  @language = N'Python';
Generic

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.