Installing Microsoft SQL Server on Red Hat Enterprise Linux 8 Beta
By: Date: 20/03/2019 Categories: azure

Most of my work involves collaborating with engineers and product managers to improve the performance, security, and manageability of workloads that are running on Red Hat Enterprise Linux (RHEL).  The vast majority of those I encounter in my work are built on databases that are used to store the structured data associated with those workloads.

Software architects will often explore the next generation of operating platforms in advance of their release since it can help them to understand how new technology may benefit the various application workloads in their organizations. Looking at commercial databases on a beta version of a major release of a platform like RHEL can be tricky because the software provider may still be working on changes required to fully support their software on the new platform.  Because of this, customers are sometimes unable to test a key application until the vendor has completed their certification process which can be months after a major new operating system platform becomes available.

Microsoft SQL Server 2017 has been available for production workloads on RHEL 7 since October 2 of  2017. For RHEL 8 Beta, we’ve worked closely with Microsoft to accelerate performance and provide a wider range of programming languages and application frameworks that can provide powerful choices as you look to build your next application.

One of the best ways to understand the impact of these changes is to try them out, but RHEL 8 is still beta software, and SQL Server 2017 is not supported on it for production use. If you’d like to try out SQL Server on RHEL 8 Beta, this post will help you get it running, but you should not use it in a production environment until Red Hat Enterprise Linux 8 becomes generally available and Microsoft provides their officially supported RHEL 8 package.  

One of the core goals for Red Hat Enterprise Linux is to provide a stable, consistent runtime environment for third-party applications. To support this, Red Hat preserves application compatibility for specific APIs and kernel interfaces. When we move to a new major release, there are typically some deliberate differences in package names, new versions of libraries and new utilities that may cause complications for existing applications that target a prior release. Software vendors can create binaries on Red Hat Enterprise Linux 7 if they follow Red Hat guidelines that will run on Red Hat Enterprise Linux 8, but the packaging is a different matter. Software packaged for Red Hat Enterprise Linux 7 will not be supported on Red Hat Enterprise Linux 8.

SQL Server 2017 on Red Hat Enterprise Linux 7 makes use of python2 and OpenSSL 1.0.  These steps should give you an environment which is compatible with those two components which have moved to more recent versions on RHEL 8 Beta. Their inclusion by Red Hat was a deliberate step to preserve backward compatibility.

​sudo  yum install python2
sudo  yum install compat-openssl10

We now need to deal with the defaults for python on the system.  As explained by Langdon White last November, Red Hat Enterprise Linux 8 can support both python2 and python3 binaries simultaneously, but by default, there is no /usr/bin/python command.   We need to make python2 the default interpreter so that SQL Server  2017 can see /usr/bin/python as it expects. We do this with:

sudo alternatives --config python

The command prompts me to select a Python version and will create a symlink that persists across upgrades.

There are 3 programs which provide python

 Selection    Command
*  1         /usr/libexec/no-python
+ 2           /usr/bin/python2
  3         /usr/bin/python3
​Enter to keep the current selection[+], or type selection number: 

Select option 2 and it will create a symlink from /usr/bin/python2 to /usr/bin/python.

We can now configure the system to use the Microsoft SQL Server 2017 software repository via the curl command:

sudo curl -o /etc/yum.repos.d/mssql-server.repo

At this point, we’re ready to download the SQL Server 2017 installation using the new download feature of yum.  We do this so that we can install it without trying to resolve dependencies:

sudo yum download mssql-server

And install it without resolving dependencies using rpm:

sudo rpm -Uvh --nodeps mssql-server*rpm

At this point you can proceed with a normal SQL Server installation as described in the Microsoft’s Quickstart: Install SQL Server and create a database on Red Hat starting with step 3:

Installing SQL Server on RHEL 8 Beta

Once installed, you can verify the installed version of SQL Server by running the command:

# yum list --installed | grep mssql-server

Containers Can Be Easier!

With the upcoming SQL Server 2019 this can get easier, because that version is planned to be available for RHEL as a container. SQL Server 2019 is already in Beta.  To try it out on RHEL 8 Beta takes three steps:

First, we create a persistent storage directory where we can keep our SQL data.  For this example, I’ll just use a /var/mssql directory.

sudo mkdir /var/mssql
sudo chmod 755 /var/mssql

Now we the SQL 2019 Beta container down from the Microsoft Container Repository with:

​sudo podman pull

Finally, we configure SQL.  In this case, we’ll set the SA account password for a database named sql1 running on ports 1401 through 1433.

sudo podman run -e 'ACCEPT_EULA=Y' -e \
'MSSQL_SA_PASSWORD=<YourStrong!Passw0rd>'  \ 
--name 'sql1' -p 1401:1433 -v /var/mssql:/var/opt/mssql:Z -d \

To learn more about podman and containers in Red Hat Enterprise Linux 8 Beta see the documentation here.

Either Way Works!

Using the steps in this post can try out RHEL 8 Beta and SQL Server 2017 with the traditional OS install or the container-based one.  Either way, you should now have a working SQL Server instance. From here, you can move on to creating database content and exploring the tools available in RHEL 8 Beta to create an application stack, automate setup and improve performance.  

Be sure to join me along with Microsoft’s Bob Ward, Principal Architect for the Microsoft Database Systems Group, for our talk, “Deploy a modern data platform with SQL Server 2019 on Red Hat Enterprise Linux 8 Beta” at Red Hat Summit 2019.