Presentation is loading. Please wait.

Presentation is loading. Please wait.

Welcome to… An Introduction to SQL Server & Containers

Similar presentations


Presentation on theme: "Welcome to… An Introduction to SQL Server & Containers"— Presentation transcript:

1 Welcome to… An Introduction to SQL Server & Containers

2 SAY THANK YOU TO OUR SPONSORS!

3 Sponsor Raffle!!! Each sponsor stamp will opt you into their raffle prize and mailings Collect 9+ sponsor stamps on your Badge to be eligible for the Xbox Hand entire Badge/ ribbon back into registration desk at end of day We will draw Badges for prizes at 5pm in Cromwell (if you are drawn and do not have the pre-requisite stamp/s….. You lose!) SQLCloud: XBox One-S with Forza Horizon 3 Bundle; Amazon Fire TV with 4K Ultra HD; Raspberry Pi 3 Starter Kit; dbWatch: Apple iPad Mini; Skybow: Marshall Speaker; Coeo: A free place on any Coeo training course, RRP £600; Edison365: Helicopter ride (lunchtime session prize) and a Fire TV Stick; Pyramid Analytics: Amazon Echo; Quest: Samsung Gear S2 Smartwatch; DBPro/ SQLGovernor: Splash-proof JBL bluetooth speaker; Redgate: SQL Monitor License - with 12 months support and upgrades; Axioworks: Amazon Echo Dot; Idera: $100 Amazon card; Lightning Tools: Lego Technics Race Car; SQL Sentry: SQL Sentry license and 1 year of support (worth $2994); Locke Data: R for Data Science: Import, Tidy, Transform, Visualize, and Model Data; SharePoint Unite /BMM Media: A free pass to SharePoint Unite 2017 conference in Haarlem, Netherlands, on the 25th & 26th October. worth €699. travel and hotel not included; PASS: Recording (download) of all sessions from PASS Summit 2016

4 Social Make sure you tweet on #spscambridge or #sqlsatcambridge
During the event we have Giant Jenga, Sack races and Conker Fights! After event, join us for a post event SharePint/ SQLPint from our bar Don’t forget to thank Sponsors, Volunteers and Speakers! The event will close at 6.30pm

5 Andrew Pruski @DBAFromTheCold dbafromthecold@gmail.com
SQL Server DBA for 6 years Working with RDBMS for ~10 years Working with containers for about two years now Originally from Wales, now living in Dublin

6 Session Aim To give you a base of knowledge to be able to start to experimenting with containers

7 Docker & Microsoft Announced partnership in 2014
Containers supported in Windows Server 2016 & Windows 10 Anniversary Edition

8 Agenda Container theory Setup of Windows Server 2016 for containers Building your first container Creating a custom container image Exporting a custom image Pushing custom image to the Docker Hub Implementing containers – case study

9 Container Definition Containers wrap a piece of software in a complete filesystem that contains everything needed to run: code, runtime, system tools, system libraries – anything that can be installed on a server. This guarantees that the software will always run the same, regardless of its environment.

10 Container fundamentals
Container Host Container Engine Container Registry Container Images

11 Container Types Windows Server Containers Hyper-V containers
Isolation provided through namespace, resource & process isolation Share kernel with host and other containers Hyper-V containers Expand on isolation from windows server containers Run inside of a specialised virtual machine Does not share a kernel with host Specified at runtime with --isolation=hyperv switch

12 Virtual Machines vs Containers

13 Container Networking

14 Pros Simple and fast setup New containers can be spun up in seconds
Relatively low footprint compared to VMs Ability to customise images Access to Docker repository (hundreds of images available) Portability, images can be saved to the Docker Hub

15 Cons Only the database engine is supported
Only supported on Windows Server 2016 / Windows 10 Anniversary Edition Official SQL Server images for 2016 & 2017 only SQL images aren't the smallest (~13GB) Suitability for production?

16 Getting started

17 Installing the Docker engine
Install-PackageProvider -Name NuGet -MinimumVersion –Force Install-Module -Name DockerMsftProvider –Force Install-Package -Name docker -ProviderName DockerMsftProvider –Force Restart-Computer -Force

18 Containers server feature enabled

19 Docker Engine Service Get-Service docker docker version

20 Azure Custom image available with container role enabled and docker engine installed

21 Windows 10 Download .msi

22 Linux - Ubuntu using-the-repository git clone  cd InstallDockerOnUbuntu chmod +x installdocker.sh ./installdocker.sh

23 Demo

24 Creating your first container

25 Search the Docker repository
docker search microsoft/mssql

26 Pull an image docker pull microsoft/mssql-server-windows

27 Verify the image docker images

28 Create container from image
docker run –d –p 15789: env ACCEPT_EULA=Y --env --name MyFirstContainer microsoft/mssql-server-windows

29 Verify container is running
docker ps [-a]

30 Connecting to your container - locally
docker inspect MyFirstContainer

31 Connecting to your container - remotely

32 Demo

33 Using DockerFiles

34 DockerFiles A file on the docker host that contains commands that create a custom image

35 Dockerfile code FROM microsoft/mssql-server-windows RUN powershell -Command (mkdir C:\\SQLServer) COPY DatabaseA.mdf C:\\SQLServer COPY DatabaseA_log.ldf C:\\SQLServer ENV ENV ACCEPT_EULA=Y ENV attach_dbs="[{'dbName':'DatabaseA','dbFiles':['C:\\SQLServer\\DatabaseA.mdf','C:\\SQLServer\\DatabaseA_log.ldf']}]"

36 Building image from a Dockerfile
docker build –t myfirstimage .

37 Verify new custom image
docker images

38 Creating container from custom image
docker run –d –p 15777: name MyCustomContainer myfirstimage

39 Database within custom container

40 Demo

41 Sharing images

42 Sharing images locally
docker save –o myexportedimage.tar myfirstimage

43 Importing images docker load -i myexportedimage.tar

44 The Docker Hub

45 Creating your repository

46 Tagging an image docker tag myfirstimage dbafromthecold/testsqlrepository:v1

47 Log in to Docker hub docker login

48 Pushing to the Docker Hub
docker push dbafromthecold/testsqlrepository:v1

49 Viewing pushed image in Docker Hub

50 Demo

51 Case Study

52 Problem QA/Dev departments repeatedly creating new VMs
All VMs require a local instance of SQL Server SQL installed from chocolately 30+ databases then restored from baselines via PoSH scripts SQL install taking ~40 minutes from start to finish

53 Solution Containers! Implement containers running SQL Server for new VMs SQL containers built from custom image No longer need to install SQL No longer need to restore databases Resources freed up on VMs

54 WinDocks www.windocks.com
A port of the open source project from Docker Inc. Software supports the creation of containers running earlier versions of SQL Server (2008+) on Windows Server 2012 Free Community Edition available

55 Architecture

56 Benefits New VMs deployed in a fraction of the previous time
No longer need to run PoSH scripts to restore databases Base image can be used to keep containers at production SQL instance’s patch level More VMs can be provisioned on host due to each VM requiring less resources

57 Issues Apps using DNS entries to reference local SQL instance
Update to existing test applications Trial and error to integrate with Octopus deploy New ways of thinking

58 Other Resources

59 Other SQL Images https://github.com/dbafromthecold/ On the Docker Hub
docker search dbafromthecold/sqlserver2012dev docker search dbafromthecold/sqlserver2014dev Code on GitHub

60 Portainer Open source UI Available on Docker Hub

61 Further Information Summary of Container Series
Case Study on SQLServerCentral.com Podcast with SQL Data Partners Docker on Windows Server Core

62 Questions?


Download ppt "Welcome to… An Introduction to SQL Server & Containers"

Similar presentations


Ads by Google