Download presentation
Presentation is loading. Please wait.
1
SQL Server 2017 on Containers
Chris Kramer SQL Server 2017 on Containers
2
Thank you Sponsors! Platinum Sponsor: Gold Sponsors:
Visit the Sponsor Booths Lots of Raffle Prizes! Get your parking paid via Sponsor Bingo Thank you Sponsors! Platinum Sponsor: Gold Sponsors:
3
PASSMN – News/Info Sponsors:
Thanks to all our sponsors of 2018! We need Sponsors for Nov/Dec 2018 and 2019! Special thanks to our annual sponsor: Board Member Elections in November/December: Your chance to help out the MN SQL community!
4
November 5th Through November 9th
Join the brightest data professionals focused on the Microsoft Data Platform! November 5th Through November 9th Pre-Conference Sessions – Monday/Tuesday Conference – Wednesday through Friday
5
SQLSaturday #796 – After Party
Location: 4th Floor of Mall of America Time: 6:30PM – 10PM There will be drinks and appetizers as well as free game cards and bowling! Hang out with some new friends you’ve made.
6
About Me Senior SQL Server DBA at Digi-Key Electronics Working with SQL Server since 2009 NDSU Bachelor of Science C.S. - (Go Bison!) Hobbies: Video Games, Golf, Motorcycles, Curling, Football Volunteering: PASSMN Board Member, FIRST Robotics team mentor LinkedIn:
7
Containers Who here has heard of containers?
How many of you are using containers with in your organizations?
8
Containers History/Background
March 2013 – Soloman Hykes announces what becomes known as the Docker open source project Containers provide new lightweight way of separating workloads avoiding the typical overhead of virtual machines. Developers begin leveraging this new technology into new software deployment processes
9
What are Containers? Lightweight, stand-alone, executable package of a piece of software that includes everything needed to run it: code, runtime, system tools, system libraries, & settings Available for both Linux and Windows based apps, containerized software will always run the same regardless of environment Containers isolate software from its surroundings So from this we can start to see that a Container, while similar to a virtual machine idea, builds upon the idea and makes a more profound impact on Application builds and deployments. Source:
10
Docker Growth Source: https://www.docker.com/what-container
The launch of Docker in 2013 jump started a revolution in app development - by bringing software containers to the masses. In just a few years, Docker has transformed the industry with a new lexicon, framework and standards in app development, packaging and management. Source:
11
Containers vs. Virtual Machines
Containers and virtual machines have similar resource isolation and allocation benefits, but function differently because containers virtualize the operating system instead of hardware, containers are more portable and efficient. Containers: Containers are an abstraction at the app layer that packages code and dependencies together. Multiple containers can run on the same machine and share the OS kernel with other containers, each running as isolated processes in user space. Containers take up less space than VMs (container images are typically tens of MBs in size), and start almost instantly. Virtual Machines: Virtual machines (VMs) are an abstraction of physical hardware turning one server into many servers. The hypervisor allows multiple VMs to run on a single machine. Each VM includes a full copy of an operating system, one or more apps, necessary binaries and libraries - taking up tens of GBs. VMs can also be slow to boot. Source:
12
Containers and VMs together
Containers and VMs used together provide a great deal of flexibility in deploying and managing apps. Source:
13
Comparison
14
Running SQL Server 2017 on Containers
Subject to Change
15
SQL Server 2017 Key features (for this talk )
It’s official, we have SQL Server on Linux supported! Docker Enterprise, Kubernetes, and OpenShift are officially supported container platforms for running SQL Server We can also run containers on Windows Server/Windows 10
16
Docker Commands (CMD line/PowerShell/BASH)
docker ps : List containers docker images : List images docker pull : Pull an image/repository from a registry docker push : Push an image/repository from a registry docker create : Create a new container docker build : Build an image from Dockerfile docker run : Run a command in a new container docker start : Start one or more stopped containers docker stop : Stop one or more running containers docker kill : Kill one or more running containers
17
Getting Started Prerequisites: Minimum 4GB disk space and 4GB RAM
Docker Engine 1.8+ on any supported Linux Distro for Mac/Windows Increase Docker memory to 4GB Gotchas: Watch out for Virus scan software blocking Docker Corporate Proxies Have to logout after initial Docker install and then restart to enable Hyper-V
18
Getting Started (continued)
Run Command: docker pull microsoft/mssql-server-linux:2017-latest
19
Getting Started (continued)
PowerShell/CMD: docker run -e "ACCEPT_EULA=Y“ -e "MSSQL_SA_PASSWORD=SQLSatMN2018" -e "MSSQL_PID=Developer" -p 1433:1433 --name sql2018 -d mcr.microsoft.com/mssql/server:2017-latest-ubuntu BASH: -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=SQLSatMN2018' -e 'MSSQL_PID=Developer' Difference is single quotes for Linux/Mac BASH versus double quotes for Windows Command/PowerShell
20
Parameters Explained Parameter -e ‘ACCEPT_EULA=Y’ -e -e 'MSSQL_PID=Developer‘ -p 1433: name sql2018 -d mcr.microsoft.com/mssql/server:2017-latest-ubuntu Description Lawyers Set SA password Specifies the edition/product key Maps Host TCP port to Container TCP port Specify custom container name (optional) Runs container in detached mode SQL Server Linux container image
21
Is it Running? Run Command: docker ps
22
Yay! Now what? Connect to your container SQLCMD SSMS
Now it’s just like the SQL Server you’re used to.
23
Using SSMS (use . or localhost for local container)
24
Are we really running a SQL Server Linux container on a Linux VM on Windows?
Sure are.
25
Aren’t containers meant to be disposable?
Yes they are. But we can map persistent storage into them to store the data we care about as DBAs. I’m still doing research in this area so I figured I would just scratch the surface
26
Demo Time
27
Docker Compose
28
Docker Compose 1. Define the app environment [Dockerfile] 2. Define the services that make up your app [docker-compose.yml] 3. Run ‘docker-compose up’ Using Compose is basically a three-step process: 1. Define your app’s environment with a Dockerfile so it can be reproduced anywhere. 2. Define the services that make up your app in docker-compose.yml so they can be run together in an isolated environment. 3. Run docker-compose up and Compose starts and runs your entire app.
29
Dockerfile Example Docker can build images automatically by reading the instructions from a Dockerfile. A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image. Using docker build users can create an automated build that executes several command-line instructions in succession. The docker build command builds an image from a Dockerfile and a context. The build’s context is the set of files at a specified location PATH or URL. The PATH is a directory on your local filesystem. The URL is a Git repository location. A context is processed recursively. So, a PATH includes any subdirectories and the URL includes the repository and its submodules. This example shows a build command that uses the current directory as context:
30
docker-compose.yml YAML: YAML Ain't Markup Language
.yml or .yaml file extension
31
Kubernetes
32
Kubernetes History Founded by engineers from google in mid 2014 Google partnered with the Linux Foundation to form the Cloud Native Computing Foundation (CNCF) and offered Kubernetes as a seed technology along with the 1.0 release on July 21, 2015
33
Kubernetes Architecture
Kubernetes Master Manages workload and communication in the cluster Kubernetes Nodes Worker Nodes where workloads are deployed.
34
Pods Definitely NOT the Tide Pod Challenge
A Pod is the basic building block of Kubernetes–the smallest and simplest unit in the Kubernetes object model that you create or deploy. A Pod represents a running process on your cluster.
35
Deployments A Deployment controller provides declarative updates for Pods and ReplicaSets.
37
Kubernetes
38
Demo Time
39
What have we gained? Faster Development/Testing Faster Patching Cycles
Repeatability Future Thinking…. Scalable/Elastic SQL Server similar to Azure SQL Database Fast Upgrades/Downgrades
40
Questions??? Thanks for Attending SQLSat 796! Reminder: Please fill out evals so I can improve plus you can win a raffle prize for event evals!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.