RHEL 8 Beta Workshop: Installing Microsoft SQL Server

Microsoft SQL Server 2017 has been available for full use on RHEL 7 since October 2017, and Red Hat worked closely with Microsoft on RHEL 8 Beta to improve performance and provide support for more programming languages ​​and application frameworks, and offer developers more choice. available tools to work on their next application.

RHEL 8 Beta Workshop: Installing Microsoft SQL Server

The best way to understand the changes 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 real applications. What to do?

If you want to try out SQL Server on RHEL 8 beta, this post will help you get it up and running, but you should not use it in a production environment until Red Hat Enterprise Linux 8 is publicly available and Microsoft makes their officially supported package available for installation.

One of the main objectives of Red Hat Enterprise Linux is to create a stable, homogeneous environment for running third-party applications. To do this, RHEL implements application compatibility at the level of individual APIs and kernel interfaces. When we move to a new major release, there are usually ad hoc differences in package names, new library versions, and new utilities that can cause problems when running existing applications built for the previous release. Software vendors can, following Red Hat's guidelines, create Red Hat Enterprise Linux 7 executables that will run on Red Hat Enterprise Linux 8, but packaging is a different matter. A software package created 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 uses python2 and OpenSSL 1.0. The following steps will provide a working environment that is compatible with these two components, which have already been migrated to more recent versions in RHEL 8 Beta. The inclusion of older versions was done by Red Hat specifically to maintain backward compatibility.

sudo  yum install python2
sudo  yum install compat-openssl10

Now you need to deal with the original python settings on this system. Red Hat Enterprise Linux 8 can run both python2 and python3 at the same time, but /usr/bin/python is missing from the system by default. We need to make python2 the default interpreter so that SQL Server 2017 can see /usr/bin/python where it expects it to. To do this, you need to run the following command:

sudo alternatives β€”config python

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

There are three different executables 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 select the second option, after which a symbolic link will be created from /usr/bin/python2 to /usr/bin/python.

You can now continue configuring your system to work with the Microsoft SQL Server 2017 Software 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 SQL Server 2017 installation files using the new download feature in yum. You need to do this in such a way that you can install without having to resolve dependencies:

sudo yum download mssql-server

Now let's install the server without resolving dependencies using the rpm command:

sudo rpm -Uvh β€”nodeps mssql-server*rpm

After that, you can continue with the normal installation of SQL Server, as described in the Microsoft Quick Start: Installing SQL Server and Creating a Database in Red Hat from step #3:

3. ПослС Π·Π°Π²Π΅Ρ€ΡˆΠ΅Π½ΠΈΡ установки ΠΏΠ°ΠΊΠ΅Ρ‚Π° Π²Ρ‹ΠΏΠΎΠ»Π½ΠΈΡ‚Π΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρƒ mssql-conf setup ΠΈ слСдуйтС подсказкам для установки пароля систСмного администратора (SA) ΠΈ Π²Ρ‹Π±ΠΎΡ€Π° вашСй вСрсии.
sudo /opt/mssql/bin/mssql-conf setup 

After the installation is complete, you can check the version of the installed SQL server using the command:

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

Support containers

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

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

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

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

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

Finally, the SQL server needs to be configured. In this case, we will set an administrator (SA) password for a database called sql1 running on ports 1401 - 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  
mcr.microsoft.com/mssql/rhel/server:2019-CTP2.2

More information about podman and containers in Red Hat Enterprise Linux 8 Beta can be found here.

Works for two

You can try a bunch of RHEL 8 Beta and SQL Server 2017 both using a traditional installation and using a container application installation. In any case, you now have a running instance of SQL Server at your disposal, and you can start seeding the database or explore the tools available in RHEL 8 Beta to create an application stack, automate the tuning process, or optimize performance.

In early May, be sure to listen to Bob Ward, Senior Architect at the Microsoft Database Systems Group, at the Summit Red Hat Summit 2019, which will discuss deploying a modern data platform based on SQL Server 2019 and Red Hat Enterprise Linux 8 Beta.

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

Source: habr.com

Add a comment