Part 3: Troubleshooting
This is the third post in a series about deploying ASP.NET applications to the Amazon cloud.
In Part 1 we created an Amazon RDS instance of SQL Server to act as the database for the deployment.
In Part 2 we published the DevExpress MainDemo.Web to the Amazon Elastic Beanstalk.
In this part we will look at troubleshooting methods and in particular how to connect to an EC2 instance in order to troubleshoot installations.
The Beanstalk Events tab
When there is a problem with the deployment, the first place to look is in the Elastic Beanstalk events tab. You will find warnings and error messages which frequently point to the source of any problem.
Sometimes, the events window point to a log file which is automatically generated in an S3 bucket. By opening S3 in the AWS Explorer, you can find and download the log file which usually has excellent error information in it, for instance:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
Connecting via Remote Desktop
If you’re still in the dark, you can use Windows Remote Desktop to connect to the EC2 machine to troubleshoot.
In the AWS Explorer, go to Amazon EC2/Instances.
There are two ways of connecting. You can Get Windows Passwords, but this takes about an hour for the password to be decrypted.
Alternatively, you can Open Remote Desktop and then Use EC2 keypair to logon. You should have the .pem private key file associated with the EC2 key pair that was used to launch the instance (it was created when you created your AWS account or when you launched your first EC2 instance). Whenever an EC2 instance is provisioned, it is launched with an EC2 key pair (you selected a keypair to use in the wizard above). You can open the .pem file and cut and paste the key into the remote desktop window.
You will then be logged in as an Administrator on the EC2 Instance running Windows 2008 R2. You can perform whatever operations you see fit - install software, change Control Panel options, restart IIS, etc. The changes will last until you terminate the instance (by deleting the Elastic Beanstalk stack for example).
Note that it is easy to create new key pairs if you can’t find the .pem file, but you cannot change the key pair of a running instance. (You should terminate and launch again with the new key pair). One nice feature of the AWS Toolkit, is that if you create a new key pair within Visual Studio, you can choose to store the private key in the Toolkit.
Next up
The next post will cover incremental deployment options.