Category Archives: Linux

My Current Training Courses on Pluralsight!

Here’s a run down of the Linux training that I have available on Pluralsight!

Just getting started! 

Understanding and Using Essential Tools for Enterprise Linux 7 – If you heard what Linux is and want to get started this is the place to be. We’ll cover installation, command line basics, the file system, text editors and more! This is my most popular course.

SQL Server on Linux Administration Fundamentals – SQL Server is available for Linux and Docker! This course is targeted towards both the SQL Server DBA and the Linux professional to get you started using SQL Server on Linux. We cover architecture, administration basics, Tools and backup and recovery!

Provisioning Microsoft Azure Virtual Machines – Need to deploy a VM in the cloud, start here! We cover the basics of getting started and walk through how to deploy VMs both in the portal and at the command line. We also cover Azure Disk storage and building custom virtual machine images for consistent repeatable deployments. 

Deeper cuts!

Once you’ve mastered the basics let’s move you along in your Linux journey and get your ready to run your applications and servers in production! 

LFCE: Advanced Network and System Administration – If you’re going to run Linux in production, you should watch this course. We cover managing services, system performance, package management and sharing files with Samba and NFS. A must see. This is my second most popular course.

LFCE: Advanced Linux Networking – Tired of the network team saying “I can ping it” if so, watch this course. We’ll learn about the OSI model, addressing and subnets, ARP and DNS, how routing works, TCP internals and my network troubleshooting model!

LFCE: Network and Host Security – Speaking of production ready, this course is a must. We cover security concepts and architecture, Linux firewalls including iptables and firewalld, we also cover remote access with SSH and also cover how to reach applications behind firewalls wiht tunneling services through SSH.  

For the those with services on the internet!

LFCE: Linux Service Management – HTTP Services – Need to set up a web server, watch this course and learn how. We’ll cover Apache’s architecture, how DNS works, installation and configuration, implementing Apache security features and troubleshooting and logging.

LFCE: Linux Service Management – Advanced HTTP Services – Once you have that web server up an online, learn how to really build scalable internet architecture with this course! We cover proxy and caching techniques and also a deep dive into Apache Modules.

LFCE: Linux Service Management – Advanced Email Services – If you’re a consulting customer of mine and you ask me to build you an email server I’m going to tell you to give me your credit card because we’re going to buy a cloud based solution for that. But for those of you who need to know how to build SMTP based mail environments this is your course! We’ll cover installation and configuration of Postfix as a mail server, we cover relay services and how to access your mail server securely.

Installing minikube on CentOS

In this blog post, I’ll show you how to install Minikube on CentOS. Minikube is a platform you can use to test kubernetes clusters on your local machine or in a virtual machine.

Let’s start off with a fresh Install of CentoOS 7 on a virtual machine using a minimal install. If you need some help getting a Linux VM us, check out my Pluralsight course here to help you with that. You will want to ensure this virtual machine has the resource you want to run the container/pods scenarios you’d like to worth with. My configuration is dual vCPU with 10GB of RAM. 

Since we’re running a hypervisor inside a VM, you will need to enable nested virtualization in your virtual machine configuration. Cloud friends, this will not apply to you as most cloud providers do not have this enabled. 

Let’s get started with some prerequisites!

SSH into your virtual machine. I don’t have DNS internally…so I am using the IP address of the virtual machine

demo:~ aen$ ssh aen@192.168.1.69

 
First, install a hypervisor on CentOS, I’m going to use KVM. Installing KVM on RHEL based Linux distributions is most easily done by using a yum group install. This will install all of the packages included in that group for you in one command. Minikube will run inside your virtual machine as a KVM virtual machine. Minikube can use other hypervisors such as Virtual Box and VMware Fusion/Workstation.
 

sudo yum group install “Virtualization Host”

Once the installation is complete, confirm the KVM kernel module is loaded by listing the running kernel modules with lsmod then grepping for the string kvm.

lsmod | grep kvm

kvm_intel             183720  0 

kvm                   578558  1 kvm_intel

irqbypass              13503  1 kvm

Next we’ll install the KVM2 Driver Plugin for minikube

curl -Lo docker-machine-driver-kvm2 https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-kvm2 \

 && chmod +x docker-machine-driver-kvm2 \

 && sudo cp docker-machine-driver-kvm2 /usr/local/bin/ \

 && rm docker-machine-driver-kvm2

Now, that we have the prep work out of the way, let’s install kubectl. This is the command line utility you will use to interact with your Kubernetes cluster.

sudo yum install kubernetes-client

Next we’ll Install Minikube on our VM

sudo curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.29.0/minikube-linux-amd64 \

 && chmod +x minikube \

 && sudo cp minikube /usr/local/bin/ \

 && rm minikube

With everything installed, let’s launch minikube – this will download the Minicube ISO, which is a virtual machine containing the minikube cluster.

[aen@k8s1 ~]$ minikube start –vm-driver kvm2

Starting local Kubernetes v1.10.0 cluster…

Starting VM…

Downloading Minikube ISO

 171.87 MB / 171.87 MB [============================================] 100.00% 0s

Getting VM IP address…

Moving files into cluster…

Downloading kubeadm v1.10.0

Downloading kubelet v1.10.0

Finished Downloading kubelet v1.10.0

Finished Downloading kubeadm v1.10.0

Setting up certs…

Connecting to cluster…

Setting up kubeconfig…

Starting cluster components…

Kubectl is now configured to use the cluster.

Loading cached images from config file.

Finally lets check on your cluster configuration to ensure everything is online.

[aen@k8s1 ~]$ kubectl cluster-info

Kubernetes master is running at https://192.168.39.134:8443

CoreDNS is running at https://192.168.39.134:8443/api/v1/proxy/namespaces/kube-system/services/kube-dns

 

To further debug and diagnose cluster problems, use ‘kubectl cluster-info dump’.

With that, you have a functioning Kubernetes cluster inside your virtual machine which you can use for testing and development of your Kubernetes based solutions. 

My Experiences Tech Editing Pro SQL Server on Linux

The Opportunity

Earlier this year I received an email from Jonathan Gennick, an editor at Apress books. The subject of the email was “Tech edit a book” and he asked if I was familiar with SQL Server on Linux. I excitedly replied “yes…I think I’m your guy for this”. In 2017, I had the opportunity to tech edit another book on SQL Server on Linux and had to back out of that project and this was a fantastic second chance to still be able to work on a topic I really want to participate in and help move forward. I replied to Jonathan and asked who the author is…he replied…the author is Bob Ward.

The Author

If you’re active in the SQL Server community you know Bob. Ever present at the major conferences and Principal Architect for on the SQL Server Product Team. Bob has a unique combination of world-class engineering skills and the ability to communicate extremely complex technical details in simple, approachable terms. My first experience watching Bob speak was at SQL Intersection 2014 Fall edition in Las Vegas. At this conference, I saw one of his legendary 3-hour sessions on SQL Server internals. He delivered a session on SQL Server’s memory management system. I remember being amazed by how he took a very complex topic and made it very approachable and understandable to the audience, I even tweeted about it here

The Book

Knowing what an exceptional communicator Bob is and having the opportunity to tech edit a book written by him, this was a no-brainer. I wanted to do this project. We kicked off the project and the first chapter was delivered its title is “Why SQL Server on Linux”. This chapter alone makes the book worth every penny. In this chapter, you’ll learn about the journey of putting SQL Server on Linux. You get first-hand anecdotal stories straight from Bob’s experiences getting SQL Server working on Linux. I remember reading that first chapter and thinking, this is a stellar intro to the book, I literally don’t want to stop reading.

In each chapter, Bob brings his years of experience to help tell the reader what they really need to know about SQL Server on Linux, how it works and how to have a successful SQL Server on Linux deployment. And throughout the book, Bob brings historical anecdotes describing how the various facets of SQL Server got to where they are today. And he also calls out the work of the PMs and members of the product team for the features or innovations they’re responsible for as they’re discussed in the chapters of the book. Bob even takes time to give credit to various members of the SQL Server community and their contributions. This book is as much about the people and journey, as the technology being discussed. 

Getting the Book

The book is still in the final stages of the publishing process and it’s currently available for pre-order online at Apress’ site and also on Amazon. Oh, and at the time of me writing this post, the book is currently number 1 in the “Linux Servers” new releases category and number 18 in the overall “Linux” new releases category on Amazon! Congrats Bob on the book and the successful release!

Bob wrote a blog post about his experiences writing the book, check it out here!

Pro SQL Server on Linux

New Pluralsight Course – Provisioning Microsoft Azure Virtual Machines

My new course “Provisioning Microsoft Azure Virtual Machines” in now available on Pluralsight here! If you want to learn about the course, check out the trailer here or if you want to dive right in check it out here! This course offers practical tips from my experiences building Azure Virtual Machines for Centino Systems clients.

This course targets IT professionals that design and maintain Azure IaaS based solutions.The course can be used by both the IT pro learning new skills and the senior system administrator preparing for using IaaS Virtual Machine services in Microsoft Azure

Let’s take your Azure administration skills to the next level and get you started now!

The modules of the course are:

  • Provisioning VMs with the Microsoft Azure Portal, Azure CLI, and PowerShell – Learn how to create Virtual Machines using Azure tools.
  • Building and Deploying a Custom Virtual Machine Image – Learn how to create a VM image, with your configuration and your apps to source additional VM deployments.
  • Managing Virtual Machine Disks – Learn common disk administrative operations such as adding, expanding, snapshotting and removing virtual hard disks.
  • Designing and Implementing Azure DevTest Labs – Learn how to quickly create a lab, test or classroom environment of virtual machines.

Pluralsight Redhat Linux

Check out the course at Pluralsight!

I’m Speaking at SQLSaturday Cambridge!

Speaking at SQLSaturday Cambridge!

I’m proud to announce that I will be speaking at SQL Saturday Cambridge on September 8th 2018! And wow, 748 SQL Saturdays! This one won’t let you down. Check out the amazing schedule of International Experts and Microsoft MVPs!

If you don’t know what SQLSaturday is, it’s a whole day of free SQL Server training available to you at no cost!

If you haven’t been to a SQLSaturday, what are you waiting for! Sign up now!

SQLSaturday #748 - Cambridge 2018

This year I have TWO sessions!

1. Monitoring Linux Performance for the SQL Server Admin

So you’re a SQL Server administrator and you just installed SQL Server on Linux. It’s a whole new world. Don’t fear, it’s just an operating system. It has all the same components Windows has and in this session we’ll show you that. We will look at the Linux operating system architecture and show you where to look for the performance data you’re used to! Further we’ll dive into SQLPAL and how it architecture and internals enables high performance for your SQL Server. By the end of this session you’ll be ready to go back to the office and have a solid understanding of performance monitoring Linux systems and SQL on Linux. We’ll look at the core system components of CPU, Disk, and Memory and monitoring techniques for each.

2. Containers – You Better Get on Board

Containers are taking over, changing the way systems are developed and deployed…and that’s NOT hyperbole. Just imagine if you could deploy SQL Server or even your whole application stack in just minutes. You can do that, leveraging containers! In this session, we’ll get your started on your container journey learning container fundamentals in Docker, then look at some common container scenarios and introduce deployment automation with Kubernetes. In this session we’ll look at Container Fundamentals with Docker Common Container Scenarios Automation with Kubernetes.

Questions from PASS Marathon Containers

Thanks to everyone who attended the PASS Marathon Containers edition and to PASS for the opportunity to present. I received the Questions from the session and wanted to provide answers to the attendees and the community.
 
If you want to see the session again, check it out on YouTube. The decks are available online at http://www.centinosystems.com/blog/talks/
 
Here’s the list of questions from the session and my answers.
  • What do you mean it is not for production environment in Windows?
    • It’s my understanding that only Linux based SQL Server containers are supported and that Windows based containers are not. I’m looking to find an official statement, like a web site link) from Microsoft on this but I am having troubles doing so. Here is the official statement on running SQL Server on Linux in a Container – https://bit.ly/2LYPeKh

  • When you say App1 on a container, is it just 1 executable/service or can be multiple of those on the same container?
    • Generally speaking you’ll want only one process in a container. A primary reason for using containers is agility and a core way of achieving that is breaking dependencies by reducing what’s included inside the container.. Technically speaking, you can have more than one process inside a container. If fact SQL Server on Linux does. There’s the Watchdog process, then the actual SQL Server process. The output below is a process listing from inside a running SQL Server on Linux container. You can see PID 1 and 7 are processes inside the container.

      root 1   /opt/mssql/bin/sqlservr

      root 7   /opt/mssql/bin/sqlservr

       
      For the internals geeks out there, let’s look a a process listing on the host OS that’s running our container. From there we can see that the sqlservr process is a child process of containerd which is managed by dockerd. This is the same SQL Server process inside the container. But in the first example you here can see the impact of namespaces…the process IDs are rebased and start at 1 and the second SQL Server PID is 9. In the output below you can see the PIDs are 2172 and 2213.
       

      root 1034 /usr/bin/dockerd

      root 1245 \_ docker-containerd 

      root 2154     \_ docker-containerd-shim -namespace moby -workdir 

      root 2172         \_ /opt/mssql/bin/sqlservr

      root 2213             \_ /opt/mssql/bin/sqlservr

       
  • Maybe I missed this part, how do I know what kind of image I could pull down?
    • In the demos I show how to use docker search to find images that are available from the Docker Hub. If you prefer a web browser experience, check out the Docker Hub to see what containers are available to you. Here’s the code to find the mysql-server images available in Docker Hub.
      • docker search mssql-server | sort
         
  • Does SQL Container fit into production environment?
    • Here is a link to the official word from Microsoft on running containers in production – https://bit.ly/2LYPeKh
    • What I want you to leave this session with is an introduction to containers, starting your journey on what’s next when using containers. To that end here are some of the things you’ll need to consider before using containers in production
      • Is your organization ready – Do the operational skills and technologies exist to support using containers in production.
      • Backup and recovery – Does the organization have a strong backup and recovery environment. How are you going to protect the data running in a SQL Server container. Luckily, it’s just SQL Server on Linux so you can use the traditional technologies and techniques to backup your data. 
      • Data persistency – Understanding the underlying physical infrastructure and how to persistent data in ways that it’s protected and well performing.
      • Orchestration – Is there technologies in place to manage the state of your containers, things like workload placement, starting, stopping and also data persistency.
         
  • How do SQL Containers work with High Availability and Disaster Recovery?
    • Backups and data persistency are primary concerns here. You still need to care and feed for your SQL Server databases just as if they were platformed on a full operating system. For HA, Microsoft has some guidance on how to use Kubernetes to provide HA services to your SQL Server containers here. What I want you to think about when using containers for SQL Server is deploying a new container is VERY fast. We want to be able to persist the data and be able to stand up a new container and mount our data inside that container. Using this technique we can restore SQL Services very quickly with low RTO. That itself is an interesting way to provide HA services without any additional technologies.
       
  • Is there a way to have persistent storage for the system databases (e.g. master database for logins and what not)?
    • In the demos during the session I defined a Docker Data Volume when we started the container where we mounted that as /var/opt/mssql/ inside the container.  When SQL Server on Linux starts for the first time it will copy the system databases from its package directories into /var/opt/mssql/data. Since this data is stored in the persistent data volume if we stop and delete this container and start a new container pointing at that same docker data volume when SQL Server starts up it will use those system databases.

      Starting a SQL Server Container with a Docker Data Volume. The -v parameter names the volume sqldata1 and /var/opt/mssql is where it will be mounted inside the container.

  • How about the backup of a container? can it be like VM’s snapshot? 
    • You can snapshot the state of a container with docker commit. This will create a new image from the container and that image can be used to create additional containers. But recall, containers are intended to be ephemeral, we really want to define the state of the container OUTSIDE of the container in code. The things inside the container that require data persistency, like databases should be taken care of using  techniques like Docker Data Volume, backups and other high availability scenarios.

 

Speaking at SQLSaturday Sacramento – 757!

Speaking at SQLSaturday Sacramento!

I’m proud to announce that I will be speaking at SQL Saturday Sacramento on July 28th 2018! And wow, 757 SQL Saturdays! This one won’t let you down. Check out the amazing schedule!

If you don’t know what SQLSaturday is, it’s a whole day of free SQL Server training available to you at no cost!

If you haven’t been to a SQLSaturday, what are you waiting for! Sign up now!

SQLSaturday #757 - Sacramento 2018

This year I have TWO sessions!

1. Monitoring Linux Performance for the SQL Server Admin

So you’re a SQL Server administrator and you just installed SQL Server on Linux. It’s a whole new world. Don’t fear, it’s just an operating system. It has all the same components Windows has and in this session we’ll show you that. We will look at the Linux operating system architecture and show you where to look for the performance data you’re used to! Further we’ll dive into SQLPAL and how it architecture and internals enables high performance for your SQL Server. By the end of this session you’ll be ready to go back to the office and have a solid understanding of performance monitoring Linux systems and SQL on Linux. We’ll look at the core system components of CPU, Disk, Memory and Networking monitoring techniques for each and look some of the new tools available.

2. Containers – You Better Get on Board

Containers are taking over, changing the way systems are developed and deployed…and that’s NOT hyperbole. Just imagine if you could deploy SQL Server or even your whole application stack in just minutes. You can do that, leveraging containers! In this session, we’ll get your started on your container journey learning container fundamentals in Docker, then look at some common container scenarios and introduce deployment automation with Kubernetes. In this session we’ll look at Container Fundamentals with Docker Common, Container Scenarios and Orchestration with Kubernetes

Linux LFCE Learning Path Available at Pluralsight

I’m proud to announce the completion of my first Pluralsight Learning Path. This learning path is built to advance your Linux knowledge to the system administrator or system engineer level. In this series of courses you’ll learn the theory behind how things work and also practice demonstrations and tips to really nail home the things you need to know to run production Linux systems. 

The learning objectives of this series align with the Linux Foundation Certified Engineer (LFCE) certification “Domains and Competencies” however these courses will be very valuable to your development as a Linux professional even if you’re not interested in certification.

Thanks and good luck with your studies! 

Check out the path here – Linux Foundation Certified Engineer (LFCE)

  • LFCE: Advanced Linux Networking – this course is the network primer for the Linux professional, covering the OSI model, IP addressing, ARP and DNS, IP routing, routing on Linux, TCP internals and what to look for with things go wrong.
     
  • LFCE: Advanced Network and System Administration – in this course you’ll dive into managing network services with systemd, monitoring system performance, advanced package management and sharing data with NFS and Samba.
     
  • LFCE: Network and Host Security – here, you’ll look at security concepts, using iptables and TCP wrappers, firewalld, using OpenSSH and remote access tools and techniques.
     
  • LFCE: Linux Service Management HTTP Services – This course is all about Internet architecture and HTTP services. Installing, securing, SSL certificates and troubleshooting Apache.
     
  • LFCE: Linux Service Management Advanced HTTP Services – In this course you’ll learn how to build scalable Internet architectures with techniques like proxying and caching with Squid, we’ll also cover implementing advanced Apache features with modules.
     
  • LFCE: Linux Service Management Advanced Email Services – In this course, you will learn common email architectures, and you will explore installing Postfix. After that, you will look at common SMTP scenarios and learn how to secure email relay services and provide clients access to email with IMAP.

    Pluralsight logo vrt color 2

Installing OpenSSH Server on Windows 10

So in yesterday’s post we learned that the OpenSSH client is included with the Windows 10, Update 1803!  Guess, what else is included in this server, an OpenSSH Server! Yes, that’s right…you can now run an OpenSSH server on your Windows 10 system and get a remote terminal! So in this post, let’s check out what we need to do to get OpenSSH Server up and running.

First, we’ll need to ensure we update the system to Windows 10, Update 1803. Do that using your normal update mechanisms.

With that installed, let’s check out the new Windows Capabilities (Features) available in this Update, we can use PowerShell to search through them.

Now to install OpenSSH server, we can use the Add-WindowsCapability cmdlet

To confirm it’s installation we can use the Get-WindowsCapability cmdlet again, and this time it’s state is “Installed”

With that installed, let’s take a look at where sshd lives on our Windows system and that’s in C:\Windows\System32\OpenSSH\

On Windows systems, network daemons run as “Services”. We can see with the Get-Service cmdlet, the installer added ssd and also ssh-agent!

As you can see the state is stopped, so let’s start the Services and also set them to start on boot

We can use netstat to see if we’re up and running

So now that it’s up and running, you should know that the configuration files and host keys live in ProgramData\ssh\ so if you need to change the behavior of SSH you’ll head for the sshd_config file and when finished, restart your service with Restart-Service -Name sshd 

You’ll likely need to open your Windows firewall, which can be done with the following cmdlet on PowerShell 5.1

So let’s test it out, I’m going to ssh from my Mac into my Windows 10 laptop

And that’s it, you can now install OpenSSH server on your Windows 10 system. I can only imagine it’s a matter of time before this hits the server side of things! Bravo PowerShell Team, bravo!

OpenSSH is now Part of Windows!

Today is a big day! The OpenSSH client version 7.6p1 is now part of the Windows 10 operating system! Microsoft released Windows 10 Update 1803 and included in that release is the OpenSSH client, which is installed as part of the update.

That’s right an SSH client as part of the Windows operating system by default! Also included with this update is the OpenSSH Server which is included as an Windows Feature on Demand.

Let’s take a look at what this is all made of!

Start off by updating your system to Windows 10, version 1803. You can do this via your normal Windows Update mechanism.

Here you see I have installed Windows 10, version 1803.

Screen Shot 2018 05 16 at 8 07 53 PM

With that, let’s look at what we got in the update! We’ll search our Windows Capabilities (Features)

Cool, so we know OpenSSH is installed, but where? Let’s check out C:\Windows\System32\OpenSSH\

Let’s look a littler closer at the ssh.exe

So this looks like all of the usual suspects in an OpenSSH installation. But it does look like sshd.exe and ssh_config_default came along for the ride during the update even though we didn’t install the OpenSSH.Server Feature!  More on that in my next blog post…

A big shoutout goes out to the PowerShell team for making this happen, check out the project on GitHub. The code is here and the issues and releases are here!