A few years back I remember reading an article about Microsoft making SQL server available for Linux. At the conclusion the author pointed out it was April 1st and the article was a gag - Microsoft would never put a flagship product like SQL server on open source. Yet here we stand today about to perform an install on Redhat EC2 instance - what a dramatic turn of events.

We'll start off the demo by provisioning our EC2 instance on AWS. If you don't have an AWS account go sign up first - it just takes a credit card and internet connection. After logging in expand options under "All Services" and select EC2 under the Compute services.

Login

Click Launch instance and you will be presented with an option of available operating systems. Select Red Hat.

Rdhat

The next decision is what specs to make the VM. It's important to pick a machine that will perform well but isn't over provisioned. Costing models vary but often they are pegged to how many hours the machine runs at a particular service level. For more guidance on estimating costs view the AWS simple calculator here : http://calculator.s3.amazonaws.com/index.html

We're almost ready to launch the machine. We need to configure the security group. You can use the one created by the wizard or select a pre-existing. I'll use the newly created one changing only the allowable IP address to my own.

LaunchWizard

Now things start to get a little fun. Before launching the instance we need to configure the key pair. Select 'Create a new key pair', name the pair, download, launch, and go grab a coffee while your machine spins up.

Keypair

Once finished provisioning we can login using a SSH client. I'm going to download and use PuTTY. If you decide to use PuTTY you will also need to download PuTTYgen to convert the format of our key from .pem to the .ppk putty format.

Load the .pem key into PuTTy Gen and then save as private key. We'll skip the warning about creating without a passphrase for now by clicking "Yes".

PuttyGen

Next open PuTTy and load the key to our client under SSH > Auth.

PuttyAuth

We can now create a SSH session. Grab the Public DNS of our EC2 and place it into the host name. Click connect, and login as ec2-user.

login1

We now can begin installing Sql server. Here's the steps we need to take:

Here's how it's done via our SSH session:


cd /etc/yum.repos.d/

yum-config-manager --add-repo https://packages.microsoft.com/config/rhel/7/mssql-server.repo

yum install mssql-server

cd /opt/mssql/bin

sudo ./sqlservr-setup

yum install firewalld
systemctl unmask firewalld
systemctl enable firewalld
systemctl start firewalld

firewall-cmd --add-port=1433/tcp


The server is ready. I want to interact with the server via SQL server managment studio so I will need to perform one more step. Open port 1433 in the AWS security group.

port

And beautiful.. We're connected to our Red Hat Linux SQL Server through SSMS-

final