Edit

Share via


Install PolyBase on Linux

Applies to: SQL Server 2019 (15.x) on Linux

The following steps install PolyBase (mssql-server-polybase and mssql-server-polybase-hadoop) on Linux. With PolyBase, you can run external queries against remote data sources.

Prerequisites

Before you install PolyBase, first install SQL Server. This step configures the keys and repositories that you use when installing the mssql-server-polybase and mssql-server-polybase-hadoop package.

Support for ODBC data sources

Applies to: SQL Server 2025 (17.x)

Starting in SQL Server 2025 (17.x), PolyBase supports ODBC data sources on Linux. ODBC data source support for Linux requires the .NET runtime, which is automatically downloaded and installed during PolyBase setup. Internet access is required during the installation.

Limitations

The hostname where SQL Server is installed has a maximum length of 15 characters.

PolyBase isn't supported on SQL Server 2017 (14.x) for Linux.

Scale-out for PolyBase on Linux is currently unavailable.

Hadoop isn't supported on SQL Server 2022 (16.x) and later versions.

Install PolyBase

Install PolyBase for your operating system:

  • Red Hat Enterprise Linux (RHEL)
  • Ubuntu
  • SUSE Linux Enterprise Server (SLES)

Install on RHEL

Applies to: SQL Server 2019 (15.x) and later versions.

  1. Download the Microsoft Red Hat repository configuration file.

    For RHEL 10:

    sudo curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/10/prod.repo
    

    For RHEL 9:

    sudo curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/9/prod.repo
    

    For RHEL 8:

    sudo curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/8/prod.repo
    

    For RHEL 7:

    sudo curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/7/prod.repo
    
  2. Use the following command to install the mssql-server-polybase on Red Hat Enterprise Linux:

    sudo yum install -y mssql-server-polybase
    
  3. Restart the SQL Server instance when prompted:

    sudo systemctl restart mssql-server
    

Note

After installation, enable the PolyBase feature.

Install Hadoop on RHEL

Applies to: SQL Server 2019 (15.x) only.

  1. Use the following command to install the mssql-server-polybase-hadoop package:

    sudo yum install -y mssql-server-polybase-hadoop
    

    The PolyBase Hadoop package depends on the following packages:

    • mssql-server
    • mssql-server-polybase
    • mssql-server-extensibility
    • mssql-zulu-jre-11
  2. Restart launchpadd when prompted:

    sudo systemctl restart mssql-launchpadd
    

Note

After installation, you must set the Hadoop connectivity level.

If you need an offline installation, find the PolyBase package download in the Release notes for SQL Server 2019 on Linux. Then use the same offline installation steps described in the article Install SQL Server.

Enable PolyBase

After installation, enable PolyBase to access its features. Connect to the installed SQL Server instance and run the following Transact-SQL command:

EXECUTE sp_configure
    @configname = 'polybase enabled',
    @configvalue = 1;

RECONFIGURE WITH OVERRIDE;

Trace flag

Applies to: SQL Server 2022 (16.x)

To use PolyBase capabilities on Linux, you must enable trace flag 13702 during SQL Server start up. For more information, see Configure SQL Server on Linux with the mssql-conf tool.

Update PolyBase

If you already have mssql-server-polybase installed, you can update to the latest version with the following commands:

RHEL with Hadoop

Applies to: SQL Server 2019 (15.x) only.

sudo yum remove -y mssql-server-polybase-hadoop
sudo yum remove -y mssql-server-polybase
sudo yum check-update
sudo yum install -y mssql-server-polybase
sudo yum install -y mssql-server-polybase-hadoop

RHEL without Hadoop

sudo yum remove -y mssql-server-polybase
sudo yum check-update
sudo yum install -y mssql-server-polybase

Restart the SQL Server instance when prompted:

sudo systemctl restart mssql-server

Note

After installation, enable the PolyBase feature.

Known issues

Offline installation isn't available for SQL Server 2025

Applies to: SQL Server 2025 (17.x)

Currently, installing PolyBase on Linux for SQL Server 2025 (17.x) requires internet access because the setup downloads the .NET runtime. An offline installation method will be provided in a future update.

PolyBase on Linux can access the following data sources. Use these links for information on how to create an external table when PolyBase is enabled: