RHEL 8 Beta Workshop: Installing Microsoft SQL Server

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



    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 real-world applications. What to do?

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

    One of the main goals of Red Hat Enterprise Linux is to create a stable, consistent 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 on to a new big release, there are usually special differences in the names of packages, new versions of libraries, and new utilities that can cause difficulties when running existing applications built for the previous release. Software vendors can, following Red Hat recommendations, create binaries in Red Hat Enterprise Linux 7 that will run on Red Hat Enterprise Linux 8, but working with packages is a different matter. The 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 that have already migrated to more recent versions in RHEL 8 Beta. The inclusion of older versions was made by Red Hat specifically to maintain backward compatibility.

    sudo  yum install python2
    sudo  yum install compat-openssl10
    

    Now you need to understand the initial python settings on this system. Red Hat Enterprise Linux 8 can work simultaneously with python2 and python3 , but by default the system does not have / usr / bin / python. We need to make python2 the default interpreter so that SQL Server 2017 can see / 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 a version of Python, after which a symbolic link will be created, which will remain after the system update.

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

    Now you can continue to configure the 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 boot function in yum. You need to do this in such a way that you can perform the installation without having to resolve the 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 that, you can continue the normal installation of SQL Server, as described in the Microsoft Quick Start: Install SQL Server and Create a Database in Red Hat guide 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
    

    Will support 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 in 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 / var / mssql directory.

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

    Now you need to load the container with SQL 2019 Beta from the Microsoft Container Repository 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 an administrator password (SA) for the database called sql1, which works with 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
    

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

    Works for two


    You can try the RHEL 8 Beta and SQL Server 2017 bundle using either a traditional installation or installing a container application. In any case, you will now have a working instance of SQL Server at your disposal, and you can start populating the database or study the tools available in RHEL 8 Beta to create an application stack, automate the tuning process, or optimize performance.

    Be sure to listen to Bob Ward, senior architect at the Microsoft Database Systems Group, at the Red Hat Summit 2019 summit in early May to discuss the deployment of 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 up the use of SQL Server in real applications.

    Also popular now: