RHEL 8 Beta Practicum: Installing Microsoft SQL Server

Microsoft SQL Server 2017 has been fully available for use on RHEL 7 since October 2017. While working on RHEL 8 Beta, Red Hat collaborated closely with Microsoft to enhance performance and support a wider range of programming languages and application frameworks, providing developers with a broader selection of available tools for building their next application.

RHEL 8 Beta Practicum: Installing Microsoft SQL Server

The best way to understand the changes made and their impact on your work is to try them out, but RHEL 8 is still in beta, and Microsoft SQL Server 2017 is not supported for use in production applications. So what should you do?

If you want to test SQL Server on the beta version of RHEL 8, this post will help you get it up and running, but you should not use it in a production environment until the Red Hat Enterprise Linux 8 version is publicly released and Microsoft provides its officially supported installation package.

One of the primary objectives of Red Hat Enterprise Linux is to create a stable, uniform environment for running third-party applications.. To achieve this, RHEL implements application compatibility at the level of individual APIs and kernel interfaces. When we transition to a new major release, there are usually specific differences in package names, new library versions, and new utilities that can complicate the operation of existing applications built for the previous release. Software vendors may, following Red Hat's recommendations, create executables in Red Hat Enterprise Linux 7 that will work in Red Hat Enterprise Linux 8, but dealing with packages is a different matter. A software package built for Red Hat Enterprise Linux 7 will not be supported in Red Hat Enterprise Linux 8.

SQL Server 2017 on Red Hat Enterprise Linux 7 uses python2 and OpenSSL 1.0. The following steps will help you obtain a working environment that is compatible with these two components, which have already migrated to newer versions in RHEL 8 Beta. The inclusion of older versions was done by Red Hat specifically for maintaining backward compatibility.

sudo  yum install python2
sudo  yum install compat-openssl10

Now, you need to sort out the initial python settings on this system. Red Hat Enterprise Linux 8 can run both python2 and python3 simultaneously., but by default, the system lacks /usr/bin/python. We need to make python2 the default interpreter so that SQL Server 2017 can find /usr/bin/python where it expects to see it. To do this, run the following command:

sudo alternatives --config python

You will be prompted to select the version of Python, after which a symbolic link will be created that will persist even after a system update.

There are three different executable files for working with 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: 

Here, you need to choose the second option, after which a symbolic link from /usr/bin/python2 to /usr/bin/python will be created.

Now you can continue configuring the system to work with the Microsoft SQL Server 2017 repository using the curl command:

sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo

Next, download the installation files for SQL Server 2017 using the new download feature in yum. This should be done so that you can perform the installation without needing to resolve dependencies:

sudo yum download mssql-server

Now install the server without resolving dependencies using the rpm command:

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

After this, you can continue the standard installation of SQL Server as described in the Microsoft guide 'Quick Start: Install SQL Server and Create a Database on Red Hat' starting from step #3:

3. After completing the package installation, run the mssql-conf setup command and follow the prompts to set the system administrator (SA) password and select your version.
sudo /opt/mssql/bin/mssql-conf setup 

Once the installation is finished, you can check the version of the installed SQL Server using the command:

# yum list β€”installed | grep mssql-server

Supports containers

With the release of SQL Server 2019, the installation promises to be even easier, as this version is expected to be available in RHEL as a container. SQL Server 2019 is already available in beta. To try it on RHEL 8 Beta, you only need three steps:

First, create a database directory where all our SQL data will be stored. For this example, we will use the directory /var/mssql.

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

Now, you need to pull the SQL 2019 Beta container from the Microsoft Container Repository with the command:

sudo podman pull mcr.microsoft.com/mssql/rhel/server:2019-CTP2.2

Finally, you need to configure the SQL server. In this case, we will set the administrator (SA) password for the database named sql1, operating on ports 1401 β€” 1433.

sudo podman run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=' --name 'sql1' -p 1401:1433 -v /var/mssql:/var/opt/mssql:Z -d mcr.microsoft.com/mssql/rhel/server:2019-CTP2.2

You can find more detailed information about podman and containers in Red Hat Enterprise Linux 8 Beta here.

Works like a charm

You can try the combination of RHEL 8 Beta and SQL Server 2017 either through a traditional installation or using a container application. Either way, you will now have a working instance of SQL Server, and you can start populating the database or exploring the available tools in RHEL 8 Beta for creating application stacks, automating setup processes, or optimizing performance.

Make sure to tune in to Bob Ward's presentation on May 1st, a senior architect in Microsoft Database Systems Group, at the Red Hat Summit 2019, where the deployment of a modern data platform based on SQL Server 2019 and Red Hat Enterprise Linux 8 Beta will be discussed.

And on May 8th, an official release is expected, opening up the use of SQL Server in real applications.

Source: habr.com

Buy reliable website hosting with DDoS protection, VPS VDS servers πŸ”₯ Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster