Install PolyBase on Linux
Applies to:
SQL Server 2019 (15.x) - Linux
The following steps install PolyBase (mssql-server-polybase and mssql-server-polybase-hadoop) on Linux. PolyBase enables you to run external queries against remote data sources.
Note
Before installing PolyBase, first install SQL Server 2019. This configures the keys and repositories that you use when installing the mssql-server-polybase and mssql-server-polybase-hadoop package.
Note
- PolyBase is not supported on SQL Server 2017 for Linux.
- Scale-out for PolyBase on Linux is currently unavailable.
Install PolyBase for your operating system:
Install on RHEL
Download the Microsoft Red Hat repository configuration file.
For RHEL7:
sudo curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/7/prod.repoFor RHEL8:
sudo curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/8/prod.repoUse the following command to install the
mssql-server-polybaseon Red Hat Enterprise Linux.sudo yum install -y mssql-server-polybaseYou will be prompted to restart the SQL Server instance. Use the following command to do so.
sudo systemctl restart mssql-serverNote
After installation, you must enable the PolyBase feature.
Use the following command to install the
mssql-server-polybase-hadoop.-
sudo yum install -y mssql-server-polybase-hadoopThe PolyBase Hadoop package has dependencies on the following packages:
mssql-servermssql-server-polybasemssql-server-extensibilitymssql-zulu-jre-11.
Installation prompts to restart
launchpadd. Use the following command to do so.sudo systemctl restart mssql-launchpadd
Note
After installation, you must set the Hadoop connectivity level.
If you need an offline installation, locate the PolyBase package download in the Release notes. Then use the same offline installation steps described in the article Install SQL Server.
Install on Ubuntu
Register the Microsoft Ubuntu repository.
For Ubuntu 16.04:
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.listFor Ubuntu 18.04:
curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.listFor Ubuntu 20.04:
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.listUse the following command to install the
mssql-server-polybaseon Ubuntu.sudo apt-get install mssql-server-polybaseWhen prompted, restart the SQL Server instance.
sudo systemctl restart mssql-serverNote
After installation, you must enable the PolyBase feature.
If you need an offline installation, locate the PolyBase package download in the Release notes. Then use the same offline installation steps described in the article Install SQL Server.
Use the following command to install the
mssql-server-polybase-hadoop.sudo apt-get install mssql-server-polybase-hadoopThe PolyBase Hadoop package has dependencies on the following packages:
mssql-servermssql-server-polybasemssql-server-extensibilitymssql-zulu-jre-11
Installation prompts to restart
launchpadd. Use the following command to do so.sudo systemctl restart mssql-launchpadd
Note
After installation, you must set the Hadoop connectivity level.
Install on SLES
Add the Microsoft SQL Server repository to Zypper.
sudo zypper addrepo -fc https://packages.microsoft.com/config/sles/12/prod.repo sudo zypper --gpg-auto-import-keys refreshUse the following commands to install the
mssql-server-polybaseon SUSE Linux Enterprise Server.sudo zypper install mssql-server-polybaseYou will be prompted to restart the SQL Server instance. Use the following command to do so.
-
sudo systemctl restart mssql-server
Note
After installation, you must enable the PolyBase feature.
If you need an offline installation, locate the PolyBase package download in the Release notes. Then use the same offline installation steps described in the article Install SQL Server.
Enable PolyBase
After installation, PolyBase must be enabled to access its features. Connect to the installed SQL Server instance and use the following Transact-SQL command to enable.
exec sp_configure @configname = 'polybase enabled', @configvalue = 1;
RECONFIGURE WITH OVERRIDE;
Update PolyBase
If you already have mssql-server-polybase installed, you can update to the latest version with the following commands:
RHEL
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
You will be prompted to restart the SQL Server instance. Use the following command to do so.
sudo systemctl restart mssql-server
Ubuntu
sudo apt-get remove mssql-server-polybase-hadoop
sudo apt-get remove mssql-server-polybase
sudo apt-get update
sudo apt-get install mssql-server-polybase
sudo apt-get install mssql-server-polybase-hadoop
You will be prompted to restart the SQL Server instance. Use the following command to do so.
sudo systemctl restart mssql-server
SLES
sudo zypper remove mssql-server-polybase
sudo zypper refresh
sudo zypper install mssql-server-polybase
You will be prompted to restart the SQL Server instance. Use the following command to do so.
sudo systemctl restart mssql-server
Note
After installation, you must enable the PolyBase feature.
Next steps
PolyBase on Linux can access the following data sources. Follow the provided links for more information on how to create an external table from these sources on PolyBase is enabled.
- SQL Server, SQL Database, Azure Synapse Analytics)
- Hadoop
- Azure Blob Storage
- Oracle
- Teradata
- MongoDB (& Cosmos DB)
For more information on how this is used, see Transact-SQL reference article for CREATE EXTERNAL TABLE.