How to , and other stuff about linux, photo, php … A linux, photography blog. To remember some linux situation, and fix them quickly.

December 23, 2011

Using Domain Names With Elastic Load Balancing route53

Filed under: Linux — admin @ 12:33 pm

Well a few day’s ago I have to setup a domain to use loadbalancer from Amazon.  Well there are 2 posibilities

1. You may associate a subdomain  with CNAME to loadbalancer, however this is not a good solution because you may not use ex: matrafox.info you may use only www.matrafox.info

2.  Move the domain to amazon also use route53 and you may add alias to domain also. How you may do this.

elb-associate-route53-hosted-zone myLoadBalancer –rr-name example.com –hosted-zone-id Z123000000 –weight 100
elb-associate-route53-hosted-zone myLoadBalancer –rr-name www.example.com –hosted-zone-id Z123000000 –weight 100

And if you want to remvoe just use
elb-disassociate-route53-hosted-zone myLB –rr-name example.com –hosted-zone-id Z123000000 –weight 100

myLoadBalancer – is the name of your load balancer
example.com – name of your domain
Z123000000 – this you will get from route53 page. Each domain has a unique zone id
weight – is something from route53 that you need it.

However wehen I try this solution I have this error:
elb-associate-route53-hosted-zone: program error

It appear that this error was because the domain was not fully propagated.

However to use this second solution you have to know your credential, and have installed their api.

One other simple solution is to add directly into route53, how you do this ?
1. go to ec2/load balancer and copy dns name of your load balancer ex: MyLoadBalancer-0000000000.us-east-1.elb.amazonaws.com , and his name ( myloadbalancer )
2. go to route 53 and edit your domain.
3. Chose what you want to be on load balancer .
and the parameter are
A – IPV4 address
Alias : yes
alias target: ( name of your load balancer ) myloadbalancer ( this will be all with low letter )
Weighted Set: yes
Weight : 100
Set id: MyLoadBalancer-0000000000.us-east-1.elb.amazonaws.com. ( do not forget the dot from the end )
And save this is preaty easy because you don’t have to use a lot of commands.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress