Configuring High Availability of Web Server and Database Server on Amazon EC2

June 22nd, 2011 by bhumish.shah § 0

Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. Amazon Cloud Computing is a good choice if you want to deploy very large scale network on the cloud which requires high availability, auto scaling and load balancing features.

In this article I will explain how you can configure High Availability for Microsoft Sql Server 2005/2008 & Web server (IIS) in Amazon EC2. I am assuming that you have basic idea and knowledge of how Amazon EC2 works.

First of all let’s start with Amazon Load Balancing for Web Server.

Assuming that you have created 2 instances for your web server in Different Availability Zones and deployed your web application on IIS.

Just go to Load Balancer tab in EC2 menu,and then click on Create a New Load Balancer

Select Ping Protocol http, Ping Port 80, ping file name: iisstart.htm

Note: Ping Path file should be there to work load balancer, load balancer will check iisstart.htm file at 0.5 minutes interval.

On next page just select your 2 web server’s instances

Just click on create button in next screen.

Make sure that you’re both web servers instances are on different Availability Zone. For example 1 web Server on US-East-1a and other web server’s instances on US-East-1d as shown in above screenshot.

Different Availability Zones means different data centers of Amazon in same Region.

You can check your Load Balancer’s status on below link . Make sure that your both instances are In Service mode.

That’s it your web server is now configured with load balancer URL which Amazon provides.

Now you can access your web Server from Load Balancer’s URL.

For Sql Server’s High Availability we can’t use load balancer but we have different options like Database Replication, Database Mirroring.

Now let’s see how to configure database mirroring in Sql Server 2005/2008.

For Database mirroring just take full database backup of primary database and restore it on secondary server with no recovery option. You also have to install Sql Server in witness server to have automatic fail over of the database.

Sql Server’s Database mirroring uses port 5222 port number so make sure that you have open 5222 port number in your security group (firewall).

After restoring database on secondary server go to primary server, just right click on your database then click on database mirror wizard and follow the instruction as below

Click yes on do you want to configure security to include witness server roles wizard.


Select primary database instances on below screen.

Select your mirror server instances

Select the Witness Server’s Sql Instances

Click finish button to start the database mirroring .

That’s it. Your Sql server’s high availability setup is completed. If your primary server goes down it will automatically switch connection to mirror server and your mirror server becomes active now. So your clients or you will not have any problems at all to access your application!

Qmail send conflict with google apps SMTP

June 10th, 2011 by sonal.shah § 3

Recently I have faced one issue during server transfer.we needed to transfer server from shared to dedicated.this dedicated server was having parallel plesk control panel,which has by default qmail-send program enabled for mail sending. we choose google apps SMTP server for mail send.

Now Issue we encountered was as below :
In Our Site,Two e-mails are sent when filling out our “Contact Us” form.
(1) One E-mail sent to the person who filled out the form
(2) A copy of the inquiry is sent to [email protected]
1st was working fine,but 2nd was not working..we were not receiving any mails on [email protected]

every time we were getting failure notice,while sending mail to [email protected]

It was like below :

‘Hi. This is the qmail-send program at mysite.com.
I’m afraid I wasn’t able to deliver your message to the following addresses.
This is a permanent error; I’ve given up.
Sorry it didn’t work out. : This address no longer accepts mail. ‘

Solution of this issue is as below :-

For Mail Purpose, we were using google apps SMTP server which means external MX-record was enabled,
while parallel plesk control panel has by default internal MX-record service was enabled.

we can not have 2 MX-records enabled at the same time.
so we need to disable internal MX-record.so we disabled mail service from PPP(parallel plesk panel) and all started to work properly!!!.

Where am I?

You are currently viewing the archives for June, 2011 at Digicorp.