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. 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. 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. 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. 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/
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
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
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. 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. 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. 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. 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.