Mongrel Cluster as a service on Solaris 10

I was excited to finally get Bibapp installed and running on a local Solaris 10 test server. The installation instructions for Bibapp are very good and certainly sufficient for testing if you’re a SSH user. However, as soon as you unleash it on your staff or development team you’ll find as I did that they’ll expect the application to be running even after you’ve left your shell session. Such lofty expectations! So, if you’ve followed the installation instructions then you’re now ready to turn Mongrel cluster into a service on your box.

Lucky for you and me there is very good help available. Here’s what I used:

  1. Jump to Step 4 of Rails Deployment and Installation at IT.Signals. You’ll need to customize your configuration with whatever ports and IP or server address you have. I also needed to create the tmp/pids directory inside my Bibapp installation directory. Replace [path to]/testapp with [path to]/[bibapp] as appropriate. Replace environment: production with environment: development if that’s how you roll.
  2. Save your new mongrel_cluster.yml to the Bibapp config directory. Start up mongrel_rails cluster to make sure its working on all the ports you expect. Stop when you get to Step 5. We need to setup the cluster so that it will be restarted when the server is rebooted. At this point, we’re going to deviate from these instructions, but you may want to return to them later if you want load balancing across your cluster. Refer to the Nginx section in Step #5.
  3. Copy the mongrel_cluster Recipe kindly provided by Joyent and paste it into a new XML document named mongrel_cluster.xml. As instructed, customize the <instance/> properties for your Bibapp install. Save this file to /var/svc/manifest/network/mongrel/ on your server. This file is known as a service manifest to SMF. Unix/Linux use etc/init.d and rc scripts for defining and administering services. Solaris 10 replaced this with a new framework known as SMF. SMF is well documented on Sun’s blog. The SMF Manifest Cheatsheet is another good reference to the manifest properties.
  4. Jump to Step 3.4 Create service manifest of Convert legacy_run service without reboot. Run
       1: svccfg import [path to mongrel_cluster service manifest]

  5. If successful cd to [bibapp] and proceed to Step 4 for enabling your newly installed mongrel_cluster service:
       1: svcadm enable mongrel/cluster:bibapp

As mentioned earlier, once you have your cluster running it makes sense to do some load balancing for your production environment.

Good luck!

This entry was posted in libraries, tools and tagged , , , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>