Successfully reported this slideshow.
Your SlideShare is downloading. ×

Introduction to SQL Server on RHEL

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Loading in …3
×

Check these out next

1 of 25 Ad

More Related Content

Slideshows for you (20)

Similar to Introduction to SQL Server on RHEL (20)

Advertisement

More from Takayoshi Tanaka (20)

Recently uploaded (20)

Advertisement

Introduction to SQL Server on RHEL

  1. 1. Introduction to SQL Server on RHEL @TanakaTakayoshi 2018 July ver1
  2. 2. AGENDA Quick Start SQL Server Why SQL Server on RHEL? Quick Troubleshooting Monitoring Active Directory Authentication High Availability Basis
  3. 3. DEMO RUN SQL SERVER AS A CONTAINER & CONNECT FROM SQL SERVER OPS STUDIO
  4. 4. Why SQL Server on RHEL?
  5. 5. High Performance
  6. 6. Supported Platform Windows Server/Windows Desktop Red Hat Enterprise Linux 7.3+ SUSE Enterprise Linux SLES v12 SP2 Ubuntu 16.04 LTS Docker: ◦ Windows & Linux (Ubuntu) image ◦ RHEL base image is planning via Microsoft Container Catalog (MCR) https://docs.microsoft.com/en-us/sql/sql-server/install/hardware-and-software-requirements- for-installing-sql-server?view=sql-server-2017 https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup?view=sql-server-linux- 2017&viewFallbackFrom=sql-server-2017#system https://azure.microsoft.com/en-us/blog/microsoft-syndicates-container-catalog/
  7. 7. architecture Linux Kernel Linux Process Linux Host Extension SQL PAL Managed SQL OS v2 SQL OS Direct API Win 32 like APIs Software Isolated Process SQL Server Database Engine SSIS Linux OS call ABI call
  8. 8. Install & Update Fully managed by Linux package manager (yum, dnf, apt-get …) Install example Update example $ sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo $ sudo yum install -y mssql-server $ sudo /opt/mssql/bin/mssql-conf setup $ sudo yum update mssql-server
  9. 9. Container Available on DockerHub (Ubuntu based image) For RHEL based image, feel free to use my Docker file and build from scratch. https://github.com/tanaka-takayoshi/mssql-docker-rhel $ sudo docker pull microsoft/mssql-server-linux:2017-latest $ sudo docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=<YourStrong!Passw0rd>' -p 1433:1433 --name sql1 -d microsoft/mssql-server-linux:2017-latest $ sudo docker exec -it sql1 "bash" # /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P '<YourNewStrong!Passw0rd>'
  10. 10. Tools (Linux) sqlcmd: command line interface. Intended to execute automate script. ◦ https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-tools?view=sql-server- linux-2017 bcp: command line data import/export ◦ https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-migrate-bcp?view=sql-server- linux-2017 mssql-cli (preview): dialog query execute with CLI. ◦ https://github.com/dbcli/mssql-cli Visual Studio Code Extension: Query with auto completion & execution. ◦ https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-develop-use-vscode?view=sql- server-linux-2017 SQL Operation Studio: x-platform GUI management tool ◦ https://github.com/microsoft/sqlopsstudio/
  11. 11. Linux & Windows Linux Windows Linux Windows SQL Server SQL Server
  12. 12. Troubleshoot
  13. 13. Service, Process, Directory /opt/mssql: binary owner:root /var/opt/mssql: database file. Log file owner:mssql mssql-server service
  14. 14. Demo SOSREPORT
  15. 15. sosreport PR is merged to upstream. ◦ https://github.com/sosreport/sos/pull/1326 Collecting following information ◦ mssql.conf ◦ Logs ◦ keytab when AD authentication enabled
  16. 16. Security
  17. 17. AD Authentication Default authentication: password AD authentication: password-less authentication from the AD-joined computer/user ◦ Requires Active Directory rather than LDAP ◦ Administrator can centralize user identity management in to AD. https://docs.microsoft.com/ja-jp/sql/linux/sql-server-linux-active-directory- authentication?view=sql-server-linux-2017
  18. 18. Demo AD AUTHENTICATION
  19. 19. Troubleshooting SPN configuration (setspn) in Active Directory ◦ Check with “Get-ADUser” and “setspn –l mssql” command klist command with Keytab file in SQL Server on RHEL server ◦ klist -e -k /var/opt/mssql/secrets/mssql.keytab Kerberos (id, kinit) in client RHEL ◦ klist shows the user credential. SSSD logs ◦ Check sosreport Debug logging ◦ Add /var/opt/mssql/logger.ini [Output:File] Type = File Filename = /var/opt/mssql/log/trace.log [Output:SecFile] Type = File Filename = /var/opt/mssql/log/security.log [Logger] Level = Debug Outputs = File [Logger.security.kerberos] Level = Debug Outputs = SecFile
  20. 20. High Availability
  21. 21. Cluster/HA options Failover Cluster Instance (FCI) ◦ Active/Standby ◦ Shared Storage: iSCSI, NFS, SMB ◦ RHEL HA Addon AlwaysOn Availability Groups ◦ Primary/Secondary (and more). Read Replica can be included. ◦ Local Storage ◦ RHEL HA Addon High Availability on kubernetes/OpenShift ◦ Will be released. ◦ Kubernetes/OpenShift integrated HA service
  22. 22. FCI RHEL RHEL Shared Disk (iSCSI, NFS, SMB) HA add on (pacemaker, pcs) HA add on (pacemaker, pcs) SQL Server (Active) SQL Server (Standby)
  23. 23. AlwaysOn Availability Group RHEL RHEL Local Disk HA add on (pacemaker, pcs, fence) HA add on (pacemaker, pcs, fence) SQL Server (Primary) SQL Server (Secondary) Local Disk VIP
  24. 24. STONITH Shoot The Other Node In The Head (STONITH) RHEL HA add on SQL Server failover RHEL HA add-on now supports STONITH (fence operation) on Azure.
  25. 25. References de:code 2018 DA06 SQL Server 管理者におくる SQL Server on Linux Tips docs.microsoft.com SQL Server on Linux Technical support policy for Microsoft SQL Server Support Policies for RHEL High Availability Clusters mssql-server-ha GitHub repository Microsoft Build 2018 Enhancing DevOps with SQL Server on Linux + containers Microsoft Build 2018 Looking ahead with SQL Operations Studio SQL Server on Linux : Troubleshooting tips and tricks SQL Server on Linux Engineering Town Hall ◦ Please google and register. Then you can see videos on demand.

Editor's Notes

  • [TODO] Run docker

    opsstudio-2018-06-18_16.52.57.mp4
    https://1drv.ms/v/s!AqwIyH6ypmaykOEuEVJe5cIOQXOZ1g


    Let’s start with a quick demo, I’m running SQL Server container and connect with Operation Studio.
  • Why SQL Server is being used by so many users?
  • SQL Server shows the highest performance in TPC-H.
    Linux shows slightly higher performance than Windows, but the difference is expected to be reduved in the future release.
  • The latest SQL Server supports Windows Server and various Linux distribution. It also supports docker image. Right now the image is based on Windows Server and Ubuntu Server. RHEL based image will be released.
  • Red Hat users can get benefits when using SQL Server on Linux.
    RHEL is a supported OS and records the 2nd highest performance.
    Red Hat and Microsoft provide the Integrated Support.
    SQL Server features depend on Red Hat packages. For example, SQL Server HA depends on Red Hat HA add on. Active Directory authentication depends on ldaps client.
  • This diagram shows how SQL Server process works on Linux.
    SQL Server binaries are same as Windows. They run as a software isolated process.
    To run on multiple platform, SQL Server team decided to introduce an platform abstraction layer, called SQL PAL.
    SQL PAL is created with SQL Operating System and Drawbridge.
    SQL Operation system is an existing layer on SQL Server on Windows for performance.
    Drawbridge is a research project for new type of application virtualization.

    SQL PAL is launched by Linux Host Extension, which is the groups of Linux native binary.
  • It’s fully managed by Linux package manager to install and update SQL Server on Linux.
    For RHEL, add a package repository and run yum command.

    For the initial configuration, you can run mssql-conf command.
  • As I demonstrated in the beginning, SQL Server can run as a container.
    The official image is available on Docker Hub and based on Ubuntu.
    Microsoft and Red Hat will provide the RHEL based image in the future. If you want to run right now, I have created a docker file.
  • Regarding the client tools on Linux, SQLCMD is the basic CLI tool.
    However, it’s not easy to use for executing SQL manually, mssql-cli is now developing.
    For the GUI tool, Visual Studio Code extension is available for developers.
    SQL Operation studio is a GUI based management tool.
  • These client tools on Linux are available for SQL Server running on Windows.
    Or, client tools on Windows such as SQL Server Data Tools are available for SQL Server running on Linux.
  • We ‘re sometimes asked about “Azure SQL Database”. Azure SQL Database is a “SQL Server” as a Service on Azure.
    Microsoft says near 100% compatibility, but not ensured. We sometimes see “Managed Instance”, which is an optional service for more on-premised like service.
    Microsoft also provides MySQL and PostgreSQL as a Service, called Azure Databse for MySQL or PostgreSQL,
  • The binaries are located at /opt/mssql directory. Root has an ownership.
    Database files and log files are located at /var/opt/mssql. Mssql user has an ownership.
    MSSQL user is created during install and configuration process. You don’t have to create or modify it and not recommended to do so.
    The service name is mssql-server.
  • I’ll show how to collect information with sosreport.
  • This plugin is not available at the current stable release.
    Since the pull request has been merged into the upstream master, it will be available at the next release.
  • https://1drv.ms/u/s!AqwIyH6ypmaykOI-lhmJ9YWHHc_nIQ
    SQLServeronRHEL-ADAuth.mp4

×