views:

172

answers:

2

I'm creating a server management interface for a few of my servers (which host virtual servers) and I wanted to know the best way to implement a master-slave configuration for said interface.

The master server should connect to all the slave servers in order to retrieve information (provide a high level overview) and send them commands (keeps management centralized). However, the master server itself may also have virtual servers on it, which is why I was planning to deploy the same application across all the physical nodes and figure out whether the node is a master or a slave.

//Side Note: almost seems like recursion in a way haha

A few ideas I had in mind:

  • Separate database schemas for a master and a slave, the app checks the schema to determine the server type.
  • A field in the server listing table that designates a server in the table as a master or slave
+1  A: 

While you could roll your own solution, your best bet is some sort of server automation framework / app like Puppet or Chef. Personally, I prefer chef, but there's a lot of support for both. At the very least, you could probably get some insight into how to achieve this yourself from them :)

Rather than go into a big explanation of what they do, I'd suggest you check out the sites for each:

However, here are the intro blurbs from each site...


Chef is a systems integration framework, built to bring the benefits of configuration management to your entire infrastructure. With Chef, you can:

  • Manage your servers by writing code, not by running commands. (via Cookbooks)
  • Integrate tightly with your applications, databases, LDAP directories, and more. (via Libraries)
  • Easily configure applications that require knowledge about your entire infrastructure ("What systems are running my application?" "What is the current master database server?")


Puppet is a declarative language for expressing system configuration, a client and server for distributing it, and a library for realizing the configuration.

Rather than approaching server management by automating current techniques, Puppet reframes the problem by providing a language to express the relationships between servers, the services they provide, and the primitive objects that compose those services. Rather than handling the detail of how to achieve a certain configuration or provide a given service, Puppet users can simply express their desired configuration using the abstractions they're used to handling, like service and node, and Puppet is responsible for either achieving the configuration or providing the user enough information to fix any encountered problems.

Ian Selby
Thanks for that, never heard of those. Not quite the problem I was trying to solve, but definitely good knowledge to carry forward!
rnavarro
No problem, happy to share :)
Ian Selby
A: 

I came up with a simple solution to my problem. I just added a SLAVE file to the installation of a slave, and the program checks to see if that file is there. If it is, it designates that server as a slave.....totally over thought this...

rnavarro