About Me

My photo
JHC Technology is a Service Disabled, Veteran-Owned, Small Business based in the Washington, DC Metro area. Our primary focus is to offer customized solutions and IT consulting to our Commercial and Government clients. Our experts have a broad experience delivering and managing Microsoft Enterprise applications and Cloud and Virtualization Solutions, as well as mobilizing Enterprise data.

Monday, September 22, 2014

High Availability (HA) for NAT Instances

While working with a project that utilized an Amazon Linux NAT (network address translation) instance for outbound connections in redundant availability zones, I realized that a single NAT making egress requests for two Availability Zones (AZs) introduces a single point of failure.

A whitepaper written by Jinesh Varia outlines the steps required to implement a two-way monitoring high-availability (HA) failover NAT solution. He provides a script with a guide on how to replace necessary variables to give each NAT instance visibility of each other.

However, I wanted to provide insight into an issue I faced while testing this configuration. I found that when I would stop a NAT instance, it would not restart. The next steps were to see if any intended routing failover was occurring, which in fact was. Using the script below I was able to see the logs of nat_monitor.sh :

tail /tmp/nat_monitor.log

Troubleshooting led me to find out that the active NAT instance was unable to see the downed instance’s state due to two reasons.

The first is that the instances only had public IPs, not Elastic IPs (EIPs). EIPs stick to the instance when the instances are turned off and are visible to the API, so when you are making calls to a box that is turned off, you are still able to communicate with it.

The second is specified in a notation Jinesh made in his whitepaper (in Step 7). He makes it clear that the script works with tools version 1.6.12.2 2013-10-15.  He points out that if NAT_STATE isn’t updating, then to change "print $4;" on line 77 to "print $5;". It's because different versions of the tools output the ec2-describe-instances differently. Here’s the original Line 77:

NAT_STATE=`/opt/aws/bin/ec2-describe-instances $NAT_ID -U $EC2_URL | grep INSTANCE | awk '{print $4;}'`

This article was written January 30, 2014, and the tools have since been upgraded. While opening up a ticket with AWS to assist in troubleshooting the script’s output, the support engineer recommended to change “print $5”; to “print $6”; and the change produced the outcome I’d been seeking.

The script uses the API to see if the NAT box is "stopped". If it is, then it will start it. If it's not stopped, it will try to stop it and then loop back to the previous attempt to start it.

You will be able to successfully test this functionality by stopping an instance within the console and observe it restarting automatically after the threshold in the nat_monitor.sh configuration is met.


Rory Vaughan is a Cloud Engineer with JHC Technology. He can be reached at rvaughan (at) jhctechnology.com or connect with him on LinkedIn.

40 comments:

  1. Thanks for your marvelous posting! I quite enjoyed reading it, you are a great author. I want to encourage that you continue your great job, have a nice day. You also visit this to get information...Security service provider in Chennai

    ReplyDelete
  2. This post is much helpful for us. This is really very massive value to all the readers and it will be the only reason for the post to get popular with great authority.
    Dotnet Training in Chennai

    ReplyDelete
  3. i saw your blog it is really good and very much interesting too, thus i like your information what you have posted so please update latest information too.


    Best Implant Clinic In Chennai | Best Laser Clinic In Chennai | Best Dental Clinic In Vellore

    ReplyDelete
  4. i like this kind of blog information really very nice and more new skills to develop after reading that post.


    Tooth Braces In Chennai

    ReplyDelete
  5. It’s really amazing that we can record what our visitors do on our site. Thanks for sharing this awesome guide. I’m happy that I came across with your site this article is on point,thanks again and have a great day. Keep update more information..

    Home Spa Services in Mumbai

    ReplyDelete
  6. well and nice tips about web culture. it really good for everything should know before to reach a target. keep update more updates about web info. thanks.
    SAT Training Centre in Chennai

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. This is an awesome post.Really very informative and creative contents.These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.

    Digital Marketing Company in Chennai

    ReplyDelete
  9. This information really worth saying, i think you are master of the content and thank you so much sharing that valuable information and get new skills after refer that post.
    Architectural Firms in Chennai
    Architects in Chennai

    ReplyDelete
  10. GREAT, your has given me the right testing functionalities by blocking the instances ,no other block has given this much clearance keep posting the updates ..

    SEO Company in Chennai

    ReplyDelete
  11. This is extremely helpful info!! Very good work. Everything is very interesting to learn and easy to understood. Thank you for giving information.
    Digital Marketing Company in India

    ReplyDelete

  12. very informative & different one....
    I would like to share the information


    SEO Company in India

    ReplyDelete
  13. Really, these quotes are the holistic approach towards mindfulness. In fact, all of your posts are. Proudly saying I’m getting fruitfulness out of it what you write and share. Thank you so much to both of you.
    Fleet Management Software
    Human Resources Management Software
    Logistics Software
    Manufacturing ERP

    ReplyDelete
  14. Omrdeals.in is an online platform that allows people to find offers and the greatest deals in and around OMR. It is the directory of the business in and around omr. It helps internet users to surf the required deals and offers.

    Offers in Chennai

    ReplyDelete
  15. Thanks for sharing the information.Impressive and i would like to share this with my friends
    Indian Cyber Army’s most awaited internship is live now. Summer Internship 2018 on “ Ethical hacking” and book your seats before it runs out.Candidates have to get themselves registered to be a part of this Internship program. Here internship will give you on-the-job experience, help you learn whether you and Cyber security industry are a good match and can provide you with valuable connections and references. Here interns are usually exposed to a wide variety of tasks and responsibilities which allows the intern to showcase their strengths by working on projects for various managers that work on different parts of Indian Cyber Army. Becoming a high performing intern is a fantastic way to improve your employment prospects. This internship can be a great way to get your foot in the door of success with a prestigious or desirable Organization.As career in ethical hacking is most in demand.

    ReplyDelete
  16. Get to know about career in Ethical Hacking. Career Overview, Salary, Key skills and Education needed. Get how to Become Ethical Hacker guidelines ...

    ReplyDelete
  17. Believe there are many more pleasurable opportunities ahead for individuals that looked at your site.
    erp software in chennai

    Education erp software in chennai


    ReplyDelete
  18. This is certainly a best blog ’s.I have never seen such a lot of information with a Step-By-Step guidining manner.I have never seen such a successful blog.
    apple service center chennai | Mac service center in chennai | ipod service center in chennai | apple iphone service center in chennai

    ReplyDelete

  19. بسم الله الرحمن الرحيم عميلنا العزيز نحن نقدم افضل خدمات تنظيف المجالس والشقق بافضل انواع التنظيفات المشهود لها عالميا
    شركة تنظيف مجالس بالطائف
    شركة تنظيف مجالس بجازان
    شركة تنظيف مجالس بحائل
    ونحن فى خماتكم 24 ساعة على مدار الشهر

    ReplyDelete
  20. Hey Nice Blog!! Thanks For Sharing!!!Wonderful blog & good post.Its really helpful for me, waiting for a more new post. Keep Blogging!
    SEO company in coimbatore
    SEO Service in Coimbatore
    web design company in coimbatore

    ReplyDelete

  21. Thanks for sharing this quality information with us. I really enjoyed reading. travel trekking tips
    see the link Tent Camping 101 Exploring Smithriver

    ReplyDelete
  22. Best devops online training institute.they are giving complete core subject of devops.and i am very thankfull for this institute.

    ReplyDelete
  23. Wow this article is very nice
    You are doing great job,keep it up!
    Interesting stuff to read it is really helpfull..
    top b.tech college in Bandipore

    ReplyDelete
  24. Mobile app development company in Qatar with best prices

    Mobile app development company in Qatar brings you a heavy bill for your work but there is a company that gives you the best prices for your work. Primetech solutions are the cheapest Mobile app development company in Qatar. Being affordable doesn’t mean that they give you average services, being affordable means, they value everyone and are ready to give you the services at a genuine price. They are not developing only to earn money. Mobile app development is their passion. The team is very skilled and there are many things to show that too, firstly their customer's feedback tells you everything about them and then their work. You just look at their work and you will fall in love with their work.



    Mobile App Development Company in Qatar ǀ Features and Benefits

    Primetech solutions bring you a lot of benefits like not exaggerating anything, they will tell you with genuine concern and not to have a client only. They might take time to complete your work but whatever they say to do they will complete it 100%. They use premium tools to develop mobile apps and have all the world-class coders. For android apps they use java and for ios, they use swift program. Both are premium languages that need super-fast computers. They manage to give you affordable services with such premium tools. So, we don’t think you should think twice even after reading this. Just call them now and starts your dream app developing with the best.
    These small efforts for client happiness make Primetech solutions the best mobile app development company in Qatar.

    Check out their portfolio here- Portfolio


    By comparing different companies, you could get the idea of prices but what about the quality of work? You should compare the quality too. It will give you a basic idea of how hood the prices are but if you are going for comparison the also check the quality of service the cheapest company provide.

    The major part of Primetech Solutions is mobile app development, they believe in becoming the best at what they do. And that is why we conclude that Primetech Solution is the best app development in Qatar.

    Some other very beneficial services from Primetech Solutions.

    WEBSITE DEVELOPMENT

    • Website Design

    WEB HOSTING

    • Cloud Hosting

    DIGITAL MARKETING

    • Social Media Marketing
    • Search Engine Marketing
    • Brand Promotion



    What about the completion time of this company?

    Many of you people are wondering that what about the time limit, did they complete the projects in time? Yes, they do they might ask you for too much time but they will deliver the project on time. They do so because they want your app to be perfect and that is why they take this much time.

    Primetech Solutions is the best mobile app development company in Qatar as it delivers you the project in time, provides you the best which could be possible and many other things make this company the best. They are punctual as they work with such dedication that they always completed the projects on time, if you find any difficulty with the app after the delivery, they will help you with that too.


    Conclusion

    If you are searching for a genuine company for your app then this is your best shot. This company has everything which you will need they perform some excellent tasks and only they can do that. As we all know that application development is risky the client likes the project sometimes, they don’t but this company always bounces back with a better update if the client doesn’t like the app.

    If you want changes in the app during the development you could ask them without any hesitation and you will defiantly love their work.
    Just reach out to them and tell them about your needs and they will fulfil them.

    ReplyDelete
  25. Nice Post. I was checking constantly this blog and I am impressed! Very useful info specifically the last part ?? I care for such information much. Thank you and good luck.
    Best Packers and Movers Services in Old City
    Best Packers and Movers in India
    best transportation sources in Hyderabad

    ReplyDelete
  26. Nice Post. I was checking constantly this blog and I am impressed! Very useful info specifically the last part ?? I care for such information much. Thank you and good luck.

    best relocation and shiftinig source in Adarsh Nagar Hyderabad

    Best Packers and Movers in India

    Hyderabad's best packers and movers

    ReplyDelete
  27. This comment has been removed by the author.

    ReplyDelete
  28. Great post! I've been looking for a blog like yours that covers this subject in-depth. Keep up the great work! Fire safety equipment plays a crucial role in safeguarding lives and property from the devastating effects of fire integral component is the BRANCH PIPE NOZZLE

    ReplyDelete