This is one of the simplest but the coolest work I tried using Amazon EC2.During the implementation process, the major challenge I had to face was to communicate between instances. For this to work, 1st i had to make sure that my application has the capability to recall "[b]ssh[/b]" and "[b]scp[/b]"among the nodes, which in most scenarios do happen automatically. This was fun but was hard as I mentioned at the beginning itself, because in EC2 if you want to connect to an instance you have to define the key-pair, which is not possible for my application. So I had to follow an alternative method and these are the steps of how I got it fixed:
- First step is to run an instance with the your operating system (in my case I was using Fedora 8 and selected it)
- Once it is done and ready to run the application, you have to select the key-pair and the security group.
- Next step is to generate the SSH key, you can do that by using the following command (Remember : Do not enter a passphrase)
- ssh-keygen -t rsa
- Next is to go and edit the [b]~/.ssh/authorized_keys[/b]. For that copy and paste the content of [b].ssh/id_rsa.pub[/b]
- Now open the [b]~/.ssh/authorized_keys[/b], and change the tail as "[b]root@domU[/b]" , (Basically to remove root@ec2-.. with the new one)
- Next step is to edit the "[b]~/.ssh/know_hosts[/b]" file and add the following command to it.
- *.amazon.com ssh-rsa Asasdas...
- (Asasdas.... = content of rsa.pub)
- Next step is to bundle the image and register it with EC2 and S3.
- After doing that, try running more than one instances.
- Now if you try to do "[b]ssh[/b]" among these you will figure out that you do not need to enter the password or even you do not need to specify the key-pairs for it.