I’ve used Dynamic DNS with my Windows instances on Amazon EC2 for a while.
With the introduction of the HANA Development Edition, I was keen to also be able to use one common DNS name for any IP of my HANA instance on startup. Especially when creating demo clustered environments of 2-3 EC2 instances (HANA, BusinessObjects BI4, and Data Services), if all the instances can talk to each other straight away on startup (and your client tools on your laptop as well), it cuts down config time whether you presenting to a customer or wanting to start developing straight away.
Some of you may use Elastic IPs, I have found these to be a little tedious in creation and application, and apparently you are also charged for them when your instances aren’t running (which is most of the time for most devs). The solution presented in the video is an alternative to this approach. Please also note that this solution really applies to any Linux system, not just Amazon EC2 and/or HANA.
The detail presented in the video (available in HD so you can see the command line!) below will follow. Enjoy:
Here is the complete script:
#!/bin/sh ### BEGIN INIT INFO # Provides: dyndns # Required-Start: $network $remote_fs $syslog # Required-Stop: $null # Default-Start: 3 4 5 # Default-Stop: 0 1 6 # Description: Update Dyndns # Short-Description: Update Dyndns ### END INIT INFO . /etc/rc.status rc_reset USER="<USER>" PASS="<SECRET PASSWORD>" DOMAIN="<DYNAMIC DNS NAME>" case "$1" in start) wget -O /dev/null http://$USER:$PASS@members.dyndns.org/nic/update?hostname=$DOMAIN rc_status -v ;; esac rc_exit
The commands I executed in the video above:
- cd /etc/init.d/
- vi dyndns (paste script in here)
- chmod u+x dyndns
- chkconfig -a dyndns
- service dyndns start
- sudo ln -s /etc/init.d/dyndns /etc/init.d/rc5.d/S99dyndns
Lastly, if you aren’t familiar with opening an SSH connection to your HANA Development Edition, the steps to do so are posted in this SCN post (refer to Step 5).
I hope you enjoy this video, and welcome any feedback or questions.
UPDATE 1 – fix two code issues (15/08/2013)