Articles related to real life scenarios involving java, frameworks and libraries configurations and salt-stack. The topics includes Core Java, Hibernate, Spring MySQL, Multithreading, Java NIO, jQuery, c3p0, Connection pooling, salt state, pillar, grain etc.

Thursday, August 13, 2015

Salt-stack connect minion to a different master

9:24 AM Posted by Unknown 32 comments
This is a guide if you want to connect a minion from one master to a different master.
Scenario:
You have a minion ex. minion1 and it is currently connected to master1. Now for some reason you want to connect to a different master ex master2. I had this requirement when I had to create a clone of a live ec2 instances minions which is already connected to live-master and I had to connect it to a master which we use for development i.e. dev-master.
NOTE: I am assuming the OS to be Ubuntu
The following are the steps.
  • SSH into minion and Shutdown salt-minion on the minion instance using sudo service salt-minion stop (Optional)
  • Restart master2 in open mode(This is temporary, This will make it easier) by doing the following
    • In master2 (/etc/salt/master) configuration set open_mode: True
    • Restart salt-master using sudo service salt-master restart
  • Change ID(Optional), master IP/HOST and master_finder of minion by doing the following
    • ssh to minion
    • do sudo vim /etc/salt/minion
    • search for id: and change it if needed.
    • search for master: IP/HOST, change the IP or HOST for the master2
    • search for master_finger: and delete the property. This is newly added so It may not be there in configuration.
    • Remove key for old master(master1) server rm /etc/salt/pki/minion/minion_master.pub
    • Restart minion sudo service salt-minion restart
  • Change open_mode to False or remove the property(by default is False) and restart master2.
This should allow the minion to connect to the master2. Now there are things which you would need to change depending on the requirement. Like I was creating a different environment by cloning liveand we have a grain named circle set for the environments like devstaging or live. So had to change the grain to livetest.
salt '*.livetest.example.com' grains.setval circle livetest
Hope it helps.
Any suggestions or questions are welcome.

32 comments:

  1. Thanks for sharing informative article on java application development. Your post helped to understand the career in Java. JAVA Training in Chennai

    ReplyDelete
  2. Thanks for this informative blog please keep posting more often as it might help someone who is looking ti gain more knowledge.
    Php training in Chennai||Php course in Chennai

    ReplyDelete
  3. The expansion of internet and other business intelligence leads to large volume of data. Industries are looking for talented professionals to maintain and process huge volume of data with latest tools available in the market. Taking Hadoop Training in Chennai | Big Data Training in Chennai will ensure better career prospects for talented professionals.

    ReplyDelete
  4. Learning new technolgoy would help oneself at hard part of their career. And staying updated is the only way to survive in current position. Your content tells the same. Thanks for sharing this information in here. Keep blogging like this.

    JAVA Training in Chennai | JAVA Training Institutes in Chennai | hadoop course in chennai

    ReplyDelete
  5. Hi, actually I'am new to angularJs and infact I'am learning angularjs with online training. I'am having doubt, if you could solve the doubt for me that would be very helpful. The doubt is, how can I reset a “$timeout”, and disable a “$watch()”?
    Regards,
    angularjs training in Chennai|angularjs course in Chennai|angularjs training institute in Chennai

    ReplyDelete
  6. Many mistake HTML as a programming language but rather its a markup language and not progaramming language. HtML5 is the latest and technically most advanced version of HTML. To know more
    html5 training in chennai|html5 training chennai|html5 course in chennai

    ReplyDelete
  7. The main thing which i like about web designing is that itneeds creativity and we need to work differently acccording to our clients need this needs a creativity and innovation.
    web designing course in chennai|web designing training in chennai|web designing courses in chennai

    ReplyDelete
  8. After the website s completed it is very impoprtant to market it. Be it a brand or a website, if you want to reach a large audiece then effective marketive should done and this can be achieved by SEO.
    Seo training in chennai|Seo training|Seo courses in chennai|Seo training chennai

    ReplyDelete
  9. Hi author I actually teach web designing, and after I read this article I was able to clarify a doubt and this helped me understanding a certain concept better and so I could teach my students well. Thank you.
    web designing course in chennai|web designing training in chennai

    ReplyDelete
  10. Hi Admin, I went through your article and it’s totally awesome. You can consider including RSS feed for easy content sharing, So that you can drive huge traffic to your blog. Hadoop Training in Chennai | Big Data Training in Chennai

    ReplyDelete
  11. Hi admin the article was very much easy to understand and useful for all the people who want to set their career in Java Domain. I love the blog very much thanks for such a awesome post. Cool blog expecting many more blog regard to salt stack.

    iOS Training in Chennai | Multimedia Training in Chennai | | Informatica Training in Chennai | CCNA Training in Chennai | Java Training in Chennai | Oracle Training in Chennai | Android Training in Chennai

    ReplyDelete
  12. The best thing about HTML5 is that it allows the developers to embed the video files, audio files, and high quality graphics without any third party applications.
    html5 training in chennai | html5 training institutes in chennai | Fita Chennai reviews

    ReplyDelete
  13. If you are willing to develop a website but you dont know web development or coding then relax wordpress CMS platform is just for you. Where you can create website all by yourself.
    wordpress training in chennai | Wordpress course in chennai | FITA Academy reviews

    ReplyDelete
  14. AngularJs is an open source framework which is used to add details to the website. AngularJs is supported by google which a major advantage to the developers.
    Regards,
    angularjs training in Chennai | angularjs training | FITA Academy reviews

    ReplyDelete
  15. The main thing which i like about web designing is that it needs creativity and we need to work differently acccording to our clients need this needs a creativity and innovation.
    web designing course in chennai|web designing training in chennai|web designing courses in chennai

    ReplyDelete
  16. Hii author nice post! AngularJs is the best framework which is supported by google! I have personally used angularJs for my previous web app developement project and I'am quite satisfied by the output.
    Angulars training | Angularjs training in Chennai | AngularJs training institute in Chennai

    ReplyDelete
  17. too good piece of information, I had come to know about your site from my friend sajid, bangalore,i have read atleast 7 posts of yours by now, and let me tell you, your web-page gives the best and the most interesting information. This is just the kind of information that i had been looking for, i'm already your rss reader now and i would regularly watch out for the new post, once again hats off to you! Thanks a lot once again, Regards, informatica mdm training in hyderabad,informatica training in hyderabad

    ReplyDelete
  18. Excellent article.It has a lot of important information with creative concept.I will read this information and is good using the concept.


    hadoop training in chennai

    ReplyDelete
  19. I am following your blog from the beginning, it was so distinct & I had a chance to collect conglomeration of information that helps me a lot to improvise myself.
    Regards,
    CCNA Training in Chennai | CCNA Training Institute in Chennai | Best CCNA Training in Chennai

    ReplyDelete
  20. Java is programing language which is used in almost all the applications and games which are on the web. Java is being used extensively and it will be used extensively in near future. So getting trained in Java will surely be helpful.
    Java training in Chennai | Java training institute in Chennai | Java course in Chennai

    ReplyDelete
  21. WP EasyCart eCommerce module is a straightforward shopping basket module that introduces into new or existing WordPress online journals and sites. Get a full WordPress eCommerce Shopping Cart framework inside minutes! Offer retail items, advanced downloadable merchandise, blessing cards and that's only the tip of the iceberg! What's more, now with WordPress, the capable components are still simple to administrate!
    Wordpress Cart Shop

    ReplyDelete
  22. PHP is the best language to develop data driven websites. PHP is used by majority of the ecommerce websites. Learning PHP can give you a great future for sure.
    PHP training in Chennai | PHP course in Chennai | PHP training institute in Chennai

    ReplyDelete
  23. Dot net is a Microsoft product so it is the best language to develop applications for windows and it is supported well on the windows platform. Dot net is prefferd globally and a renowned platform with lots of job opportunities.
    Dot net training in Chennai | .NET training in Chennai | Dot net course in Chennai

    ReplyDelete

  24. I have completely read your post and the content is crisp and clear.Thank you for posting such an informative article, I have decided to follow your blog so that I can myself updated.
    Android training in Chennai | Android course in Chennai | Android training institute in Chennai

    ReplyDelete
  25. Most comments are SPAM, would be nice to clean them up.

    Followed the instructions and all looks sane to me but my minion keeps connecting to the previous master. :-(

    ReplyDelete
    Replies
    1. Found it, it's aswell in /etc/salt/minion as in /etc/salt/minon.d/minion.conf :-(

      Delete
  26. stal connection is good..
    Best SEO training in hyderabad all modules are clearly solved and practice with guide.seo training in hyderabadAnd clearly getting knowledge of seo.

    ReplyDelete
  27. The war between humans, orcs and elves continues earn to die . Lead your race through a series of epic battles, using your crossbow to fend off foes and sending out units to destroy castleshappy wheels . Researching and upgrading wisely will be crucial to your success! There are 5 ages total and each one will bring you new units to train to fight in the war for you cause.
    earn to die 2
    Whatever you do, don’t neglect your home base because you cannot repair it and once it is destroyed, you lose! Age of War is the first game of the series and really sets the tone for the Age of War games . Also try out the Age of Defense series as it is pretty similar.
    In this game, you start at the cavern men’s age, then evolvetank trouble ! There is a total of 5 ages, each with its units and turrets. Take control of 16 different units and 15 different turrets to defend your base and destroy your enemy.
    The goal of the game also differs depending on the level. In most levels the goal is to reach a finish line or to collect tokens. Many levels feature alternate or nonexistent goals for the player.

    ReplyDelete