A geek's geek-log My not-so-secret diary

Friday Jun 26, 2009

The Sun Code For Freedom contest results are finally out and my pet project, HA-Cron, has been declared the first prize winner. :)

My old HP Compaq 6515b laptop had served me well for 2 years and now, it's got zero battery life, no sound (it's always been like that) and a touchpad that goes crazy after 5 minutes of usage. Now, with the new Dell laptop I'll be getting, I can actually setup a proper cluster! Good thing Open HA Cluster 2009.06 allows you to setup a cluster with just one NIC (cheers to Crossbow). Can't wait to give this a spin!

Congratulations to all the other winners as well!

Saturday May 23, 2009

The Jaipur Linux Users Group (LUG-J) organised it's second event, FOSJAM 2009, on the 16th and 17th of this month at JECRC, Jaipur. Being one of the proud members myself, I knew I just had to be a part of it! The event had a participation of around 280 students from a multitude of colleges in Jaipur. The event also featured talks by familiar names from the Indian FOSS community which included Vivek Khurana (no_mind), Shakthi Kannan (mbuf), Atul Jha (koolhead17) and Varad Gupta. Although it was decided that I'd give only one talk (on Open HA Cluster of course!), I ended up giving two. On the 17th, the event got a little delayed and hence, I decided to take up the task of keeping all the participants busy. So after gathering them all into a hall, I had a long and informal session on FOSS, why it is the best thing in the world for students, how to go about contributing and the whole idea of community driven contributions. The students were quite enthusiastic and I also ended up answering technical questions from all kinds of corners like MINIX versus Linux, using Makefiles, python, the quicksort algorithm and a lot lot more! The event then continued as per plan and I really enjoyed meeting more and more students. I was also surprised at the number of students who recognized me from the previous workshops I'd conducted including Helios and Fotia. :)

The Open HA Cluster talk started at 3:30 PM, and went on perfectly. I also got a good set of doubts from the students including what would happen if the cluster was partitioned such that there N/2 nodes in each partition (this was asked while I was explaining the split brain condition). There was another reasonably good doubt that I just can't manage to recall right now. :|

The event was quite an experience all in all, you can check out the pics over here. By the way, my college (Malaviya National Institute of Technology, Jaipur) is now the official host for all LUG-J meetings, the next of which will happen on the 26th of this month itself. Looking forward to meeting ya'll again!

Thursday Apr 30, 2009

Assume that you’re running a two interface firewall setup using Shorewall for your institute LAN. Suppose you have an internal webserver that you want to be made visible externally as well. To achieve this, you’d normally do a port forward using DNAT. Although this method gets a FAIL when it comes to security, it’s usually the easiest thing to do. The suggested alternative would obviously be to get an extra NIC and setup a DMZ but anyways I’ll be talking about a two interface setup here. Now this port forwarding thing works fine but what happens when a host in the internal network tries to access this website through the URL? The request will go out of the network, come back in and the response would follow the reverse route and this will take ridiculously long! There are two workarounds for this. The recommended method would be to configure your internal DNS to respond with the internal IP when a DNS query for the webserver’s URL is received. The other method would be to have your gateway masquerade as the internal webserver, which is nothing short of a quick hack and note that this is also rather poor when it comes to security. As per the shorewall website, for a transparent proxy, you’ll need to add the following rules.

Example IP addresses:

Gateway’s external interface (eth0): 210.45.21.55

Gateway’s internal interface (eth1) : 192.168.1.1

Internal Webserver: 192.168.1.10

So here come the rules:

In/etc/shorewall/rules:

REDIRECT        loc     3128    tcp     www     -       !210.45.21.55

DNAT              loc     loc:192.168.1.10      tcp     www     -       210.45.21.55

In/etc/shorewall/masq:

eth1:192.168.1.10        eth1           192.168.1.1      tcp     www

In /etc/shorewall/interfaces, make sure you have the ‘routeback’ option enabled for eth1.

Now here’s the part that you won’t find in the shoerwall documentation. In case you’re migrating to a non-transparent proxy, add the following rule after the above mentioned DNAT.

DNAT    $FW     loc:192.168.1.10:80      tcp     80      -       210.45.21.55

Wednesday Apr 29, 2009

I can't believe it took me so long to blog about this project of mine, considering the fact that I'm almost done with it's development and I also gave a talk on it at Sun Tech Days 2009. This was originally proposed by the Solaris Cluster team for a workout at FOSS.IN 2008 but wasn't selected, so I thought I'd take it up as my Sun Code For Freedom Contest project. This is one out of two proposals of mine for the contest, the other being HA-Zabbix which I haven't started working on. :P

Now that I've bored you with the history, I'll move on to telling you all about what HA-Cron is and it's relevance.

Those of you familiar with what high availability clustering is would have easily guessed by now as to what HA-Cron does. Anyways, one problem with an HA cluster is that when a failover happens, the failed node's cron jobs remain there itself and do not carry over to the new node. This naturally implies that the system administrator will have to manually intervene every time a failover occurs which goes against the whole idea of high availability clustering itself, where the key is to keep the recovery from a failure smooth and automated. So HA-Cron is an agent for Open HA Cluster which keeps Cron highly available.

Developed over the GDS template, HA-Cron accomplishes it's task by a set of simple procedures which are as follows:

1) Upon turning an RG (resource group) online on a node, a backup is made of the original root crontab. Next, the cron jobs for that particular RG which are specified by the user in a file are added to the root crontab entry, and a test job is added to ensure that Cron itself is working properly.
2) Upon stopping an RG on a node, the cron jobs that belong to that RG are removed from the root crontab.

You can check out the project's homepage here. Please feel free to pool in your suggestions. :)

Cheers!

Friday Feb 27, 2009

The whole of last week, I was at Hyderabad and I really can't express in words as to how great it felt to be away from college for a full, solid seven days! Me, Sarguru, Nitin and Lakshminarayan left for Delhi on the evening of the 14th. Our train was from Delhi Nizamuddin station at 7 in the morning. The journey went rather smoothly with me spending most of my time sleeping.

Day 1:

On Monday morning, we arrived at Secunderabad station and we were quick to book a room in a nearby lodge for Rs 135 per person per day! :P

We had a good south Indian meal for brunch and we were all set for our sight seeing spree. The first place we visited was Golconda fort. Inspite of having been in Rajasthan (more specifically speaking, Jaipur) for close to three years, I had not been to a single fort there! So the Golconda trip was quite a first for me as we explored the citadel, the gardens, the prison and so on.

day_1-0101day_1-043day_1-014

We then went back to the city to check out the Charminar, which really didn't have anything great about it. Or maybe I just can't appreciate things that are beautiful.

day_1-060day_1-064day_1-067

Anyways, we decided to catch a movie at the famous Imax theatre complex, and after a good long walk around the Hussein Sagar lake, we were finally there. McDonald's helped rejuvenate our strength as we mowed down on burgers and mexican wraps and went on to get tickets for the 3-D version of Polar Express. :) We had a good half hour left till the show started, so we decided to fool around with some fun stuff in the complex namely, the Haunted House, the Mirror Maze and the Crazy Hotel. The mirror maze would have been interesting had I not known the 'only-left' algorithm to navigate out of mazes. :)

day_1-085day_1-099day_1-087

Watching the Polar Express in 3-D was certainly something else, since you actually felt like you were 'there', with the snow falling around you, the train nearly hitting you and you looking out of windows. We then called it a day, and hit the beds in the luxury of our lodge. :)

day_1-093

Day 2:

Day two was rather boring in comparison to day one. We set out to the Birla Art exhibition first and uhm... saw some paintings, most of which I couldn't comprehend. Modern art is shitty I tell you. I'm sure I can do patterns that are more coherent than those. And not surprisingly, most of the paintings were titled 'Untitled'. Like duh? Ideally, most of them could have been named something like, 'Random-instances-of-paint-strewn-over-a-sheet', or 'When-my-dog-messed-with-my-paint' and so on. Heck, maybe they just aren't creative enough. :D

What followed in our itinerary was the Salar Jung museum. We had a jolly good time looking at Salar Jung III's pictures and paintings and tagging him 'gay'. Trust me, the pictures did make him look so but I'm sure he was a great chap! The only exhibits that interested us were the arms and weapons collection where all kinds of guns, swords including Indian/Persian simitars and armour were up on display. Once we were done with the museum, we proceeded back to the Birla Planetorium to catch the English Show which took us through a journey through space and explained a lot of interesting components about the mystery we call, the universe.

Day 3-5: Sun Tech Days 2009:

This has certainly been the coolest developers' conference I've ever attended! The Hyderabad International Convention Center itself took my breath away with it's magnificence. And the whole idea of giving a talk here was simply exciting! The inaugural ceremony was brilliant, with a 11 year old percussion sensation drumming away to cheers and applauds from us, the mesmerized audience. What followed were demonstrations of some of Sun's technologies which included JavaFX by Chuk Munn Lee and JavaTV by Srinidhi. Then came the moment we've all waited for, the opening key note by James Gosling, the father of Java himself!

100_3697100_3753100_3706

After the ceremony, I went over to my stall, where I helped carry out OSUM registrations and conduct demonstrations of OHAC and HA-Cron all day. I interacted with a lot of people from different companies and institutes, discussed code and projects with some and made plans for workshops with a handful. :)

JB had his Project Kenai stall right next to mine and he took me through the whole project. I really didn't know what Kenai was all about until this so I'm kind of intrigued by the idea behind it. It also has a lot of relevance considering the fact that the world is moving towards an era of cloud computing. I was kind of picturising the whole concept of project management with the social computing paradigm and a bit of cloud computing and it sounded amazing! A couple of hours after that, I met Mayuresh from the OpenSolaris team who asked me the details of my talk which was scheduled on the 19th. Later that day in the evening, I went over to the hall to test my laptop with the projector and it worked like a charm.

Day three ended with a dinner treat by Ganesh to the entire Sun CA gang and we digged in to Hyderabadi Biriyani and a sweet dish which had a really weird name that I can't remember now.

100_3770100_3768100_3799

Day four was just as exciting with me conducting even more demos, meeting even more people and finally giving my talk! Jay Mahadeokar, the CA from SRKNEC, Nagpur gave a talk on Project Canopee which made use of SunSPOTS, his pet technology. :) After that I talked about HA-Cron and the GDS methodology for agent development on OHAC. My talk was well perceived and I managed to create a bit of hype around OHAC itself, as was told to me by some systems engineers from De Shaw, who'd attended my talk. And wow! Did that feel great!

img_3119img_3120img_3123

At 3:00 PM, Ganesh N Ram A.K.A GNR, gave the talk on OHAC itself and explained in great detail SMF, FMA, failover and scalable clusters and gave a superb demonstration which was followed by a grand applause from our audience. Both of us together answered a flurry of doubts that were thrown from the audience and I went on to get acquainted with even more people after that. :)

img_3134img_3118img_3138

I lazed around for the rest of the day at the stall and continued demonstrating OHAC to all passersby. I'm surprised at all the OHAC evangelism I did! We were again treated to dinner by Ganesh sir himself. :)

University day was rather boring as a lot of the talks were being repeated over and over again. Abhishek gave an amazing talk on 'Enterprising Open Source' and with his panache, kept the crowd entertained. In the evening, we CAs stayed back to meet Joe Hartley, Vice President, Global Government, Education & Healthcare, Sun Microsystems and we gave him our feedback about the programme in general. A photo shoot followed after which we all left to catch our trains and so on.

img_1744

After quite a sick journey from Hyderabad to Warangal, a six hour wait for the train to Jaipur and a Jaipur-Coimbatore train filled with brats, we finally got back to our good ol' college. Damn.

Monday Feb 23, 2009

At 9.30 AM in the New Junior Lecture Hall of MNIT Jaipur, Fotia kicked off to a start. Ajay Ahuja, General Manager (Systems Engineering), Sun Microsystems talked about OpenSolaris and it’s awesome features, using quite an interesting flash based demo. I followed up with a talk on my favourite project, Open HA Cluster :) . But sadly enough, Murphy decided to make things difficult and halfway through my talk the power went off in the whole institute! But I managed to keep the crowd occupied by asking students to come forward and give lightning talks on open source technologies that they’ve worked on. We gave away OpenSolaris t-shirts to these students and all those who were able to answer questions that followed Ajay’s talk. We then conducted the much awaited FOSS quiz, and after a tie breaker for the first prize, we gave away an iPOD Shuffle to Himanshu Agarwal from Jaipur. Two second prizes (4GB pen drives) and three third prizes (Frontec headphones) were given away as well. All our participants received OpenSolaris and Netbeans DVDs, pens, keychains and participation certificates. Thanks to all the attendees and the organisers who made it all possible!

Thursday Feb 05, 2009

mosum1


Fotia, a workshop on some of the coolest open source technologies, is happening at MNIT-Jaipur on the 7th of February, 2009 during our techno-cultural fest, Blitzschlag '09! The agenda for the day is as follows:T


1) 0800-0900 Hours: Registration

2) 0900-1000 Hours: 'OpenSolaris and it's exciting features' by Ajay Ahuja, General Manager (Systems Engineering)

3) 1000-1100 Hours: 'Open High Availability Cluster' by Lalith Suresh, Sun Campus Ambassador, MNIT-Jaipur

4) 1100-1200 Hours: FOSS Quiz; prizes include one iPOD Shuffle, two 4GB Pendrives and three Headphones!


Apart from this, we're distributing OpenSolaris Starter Kits, Netbeans DVDs and we're giving away OpenSolaris t-shirts to the sharper among the audience members!

So what are you waiting for? Come on over!

Monday Jan 26, 2009

Well, going by what actually happened at the National Internet Backbone’s nodal center in Jaipur, a more apt title would have been something like:

“Attempt at Setting up MRTG for BSNL, Jaipur, Swiftly Denied by a Network Problem”

Like I mentioned before, we had some serious network related issues when we were trying to configure the (really old) server they’d given us to setup MRTG on. We were to configure the network interface settings on the Red Hat server according to a hand book they’d given me. After setting the IP and the subnet mask, I went on to add the default gateway route. And heck, the gateway wasn’t visible from the LAN! I thought that perhaps, the hand book had older details and they’d probably reconfigured their routers in the server room we were in. But when Mr S.C Gupta, the head of the nodal office, told me that all other hosts in the same network are using the gateway that was specified in the manual (which was Rajasthan’s gateway to the internet backbone), I was taken aback. Not once in my system administration experience had I encountered a situation where a router was visible to all hosts but one within the same VLAN (assuming no one went through the trouble of setting a port block in the switch)! Furthermore, I was able to ping all these hosts from the server in question and vice versa, but the router still stood defiant (when I get my hands on it…grrr). My suspicion about the router having disabled incoming pings were also put to waste when I saw that it’s working with the other devices on the same LAN. Just to be sure, I checked and double checked the configuration of all other systems on the network, and they all seemed green. How queer. To make matters worse, no one really knew how these devices were networked. After tackling the problem for about 4 hours, me and my junior Nithin, decided to leave and come back some other time because the station was to go on a power maintenance shutdown. Man was I glad I left that place!

Monday Jan 19, 2009

At last, I've managed to contribute code to open source! Although they're just two very trivial and super easy oss-bite-sized bugs, something's better than nothing right? What say? One bug fix was in the GDS coding template where I corrected a minor mistake with the local_zone_zsh() function. I stumbled upon it while developing HA-Cron, one of my Code For Freedom projects. The other bug involved me correcting some improper cluster boot messages.

Both this fixes are coming out with the next release of OHAC. w00t! ^^


Saturday Jan 10, 2009

Sun Tech Days 2009 is a wonderful opportunity to interact with technology experts from around the world, and a cool place to meet up with developers working on your favourite projects! So what're you waiting for? Sign up already!

I'll be there for sure, and will be attending as many OpenSolairs and OHAC sessions as I can . See you all at Hyderabad!

Thursday Oct 09, 2008

After long last, I sit down to put up a post on the Software Freedom Week celebrations we at MOSUM conducted in our institute. The plans were made, the weapons sharpened and we were all set to make this a successful event. The main focus of SFW in our institute was to reach out to the first and second years students which I think I succeeded in doing. Starting from the 16th of September,2008, we conducted one session per day on FOSS, GNU/Linux, OpenSolaris and finally, on Network and System Administration. At the end of each session, we conducted a quiz based on the discussion and we gave away headphones as daily prizes and 2 GB USB sticks to the grand winners. Day 5 was a lab session where we conducted a Debian GNU/Linux and OpenSolaris 2008.05 install fest which was finally followed by a Netbeans hands on session. Luckily, the goodies from Sun arrived on an hour before our lab session was to begin. :) I also gave talks on FOSS in Subodh Public School and MGD Girls Higher Secondary School where I was surprised to find attendances of 200+ on each occasion!


The highly awaited day 6 went a little more smoothly than was expected. We had decided to go over to BITS-Pilani with whom we were to collaborate to conduct the Rajasthan Wide Software Freedom Day celebrations. 54 of us left on a fine Sunday morning in a Volvo bus and we stopped for breakfast at a store named Rawat which is famous for it's onion kachoris (a must have if you come to Jaipur) and made quick work of the 60 pieces we'd ordered in advance. The rest of the journey was fun filled and as we all pushed our vocal chords to their limits with our singing (read braying, considering our banshee like singing capabilities).


We reached an hour before schedule, to Saurabh's (CA, BITS-Pilani) surprise. We took a stroll through their brilliant campus and into the place they called SAC (Student Activities Center). The BITS people have acronyms for every damn thing and it takes quite a while to get used to having a conversation with them about their institute. Their hospitality was par excellence as we were all lead to the SAC cafeteria where we relaxed, freshened up and later on, dug into some amazing food. I myself went medieval on the rotis. :)

Saurabh then introduced me to Nandan Kumar, a Sun Cluster Engineer and a former BITSian who had come all the way from Bangalore to give a talk. We met again at 3 o'clock at one helluva lecture hall where we setup Nandan's laptop for the presentations. Once the crowd poured in, we decided to kick off the show. Nandan gave an insight to open source and Sun's involvement in the same. He also gave an overview of all of Sun's open source technologies. Next, I talked about OHAC and explained the basic concepts behind high availability clustering. Nandan then gave a demo on the same, by failing Apache over three zones. Saurabh and I then conducted a quiz where we handed out some CDs to the quicker (and sharper) ones among the lot :).



Then came the programming/debugging contest where my team (and Ankit's team who were next to us :P) had a lot of fun trying to crack the four problems that were given to us. Apart from all the fun I had, I was also reminded of how bad I am at this :(. Anyways, once that was done, we then spent some time lazing around in the SAC and waited for dinner and we were treated with some pretty neat dishes again. The shahi paneer was simply superb. Yet again, I put up a good demonstration of my hogging skills. Darn I'm cheap, but food is food right? :)


We left BITS at 10 PM on the dot and I took some feedback from my fellow students on the week as a whole. And I must say, it felt really great to hear all that positive feedback :). We reached Jaipur at 1:30 in the morning after another interesting trip where all the 2nd years were actually working on an assignment they had to submit at 8 in the morning! Anyways, I fell asleep as soon as I hit my bed. I dreamt about Dota that night. :)

The moment I'd replaced one of my two 512MB RAM cards with a 2GB one, I was elated because this was the first thing I'd bought with my stipend :). It's kind of a different feeling when you buy it out of your own pocket isn't it? Anyways, I was even more delighted when I booted my SXCE build 98 and had the system monitor tell me that I had 2.4 Gigs of RAM. Alright! Time for some OHAC action! There I was in the server room, downloading the tools necessary to build OHAC on my laptop, and checking my mails in the process, when my old nemesis, Murphy, decided not to let me rejoice because some 20 minutes into my session, in spite of having only a Firefox window with some tabs open, I was shocked to see that my RAM utilisation was not 40%, not 50%, but a whopping 96% !!!

I'd installed Windows XP that night so that I could get back to Dota/Warcraft III and it seemed to be working fine. It was detecting my RAM properly and it wasn't overusing it either. And my Debian, strangely enough, still told me that I had only 1GB of RAM. Something was not right. I actually thought for a moment that it was a problem with the RAM card, or because of the fact that both my cards were of a different make. But even on booting my system with just the 2GB card, the results were the same.

So I figured, it had something to do with the OS. I'm still trying to get the bottom of the misread by my Debian box, but I believe I've figured out the problem with my SXCE. Thing is, it's not a problem, that's how it's designed to be! And where's all that RAM going? If you've guessed it right, then you've won yourself a free opportunity to read the rest of this blog entry. If not, you get to hear the right answer :P.

The culprit is none other than ZFS itself. :)

The concept used over here is rather simple. Unused memory is wasted memory. Is it not? So ZFS uses a thing called ARC which is basically where the file system caches data from all the currently active storage pools. It keeps consuming memory because of the above mentioned reason and it may also reach a point where there is hardly any free memory left. Before you say, “But Lalith, if that's the case, how am I going to get enough RAM to play World of Warcraft, run my virtual machines and at the same time build OHAC?”... let me tell you that ZFS is not stealing RAM from any application. When the ARC has grown to the point where external applications don't have enough RAM for themselves, the ARC releases memory and the application can run normally.

To see for yourself, enter the following in your console:

# echo "::memstat" | mdb -k

# echo "::kmastat ! grep Total" |mdb -k

Here's the output on my system:


I hate formatting stuff that's copy pasted from the terminal, so I've hence taken the liberty to put up a screenshot :). Notice the green graph in the system monitor on my panel. That's how much memory is being used at that instant (1.7 out of 2.4 GB).

But you may come across a situation where an application to be started needs a huge amount of RAM to start, and hence, it will cause you problems if ARC takes up all your RAM. To prevent this from happening, you can try limiting the arc size by adding the following entry into your /etc/system file.

zfs:zfs_arc_max = <Number of bytes>

Here's an interesting link, if you're a tuning freak and you want to pimp your ZFS :P

Do correct me if I've made any mistakes here. Cheers!

Wednesday Sep 24, 2008

Although it's the field I find most enticing, it's kind of strange I've never blogged about high availability clustering. Ever since my HOD, Professor M.S Gaur, asked me to deploy Linux HA (Heartbeat) to keep our servers highly available, I've developed a deep interest towards this concept. Disaster can strike at any time and when this leads to disruption of a service, an organisation can incur huge losses. To overcome this, we make use of high availability clustering where several nodes appear as a single entity to a client, offering the given service. The nodes together may either act as a failover cluster wherein only one node provides the service at a time (active node) and if it fails, another node rises to take it's place or it may be a scalable cluster where the load is distributed across multiple nodes to maintain availability. Here, I'll be giving a step by step detail on how to failover apache between zones.

The first step, of course, would be to install SXCE. I choose SXCE build 86. There isn't much to specify here apart from the fact that you need to create a 512MB partition to be mounted as /globaldevices. The cluster nodes will access devices connected to other nodes through here. Next, you have to set up a single node cluster. I won't be going into details of that because we have this excellent piece of documentation over here:

http://opensolaris.org/os/community/ha-clusters/ohac/Documentation/SCXdocs/installsinglenode/

Now, we move on to the interesting part.

The plan here is to set up two zones named node1 and node2. We will be failing apache over the two of them.

#: zonecfg -z node1 create
zone3: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:node1> create
zonecfg:node1> set zonepath=/export/home/lalith/zones/1
zonecfg:node1> set autoboot=false
zonecfg:node1> add net
zonecfg:node1: net> set address= <IP 1>
zonecfg:node1: net> set physical= <device name>
zonecfg:node1> end
zonecfg:node1> verify
zonecfg:node1> exit

#: zoneadm -z node1 install

This will install zone node1. Now to configure node2.

#: zonecfg -z node2 create
zone3: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:node2> create
zonecfg:node2> set zonepath=/export/home/lalith/zones/2
zonecfg:node2> set autoboot=false
zonecfg:node2> add net
zonecfg:node2: net> set address= <IP 2>
zonecfg:node2: net> set physical= <device name>
zonecfg:node2> end
zonecfg:node2> verify
zonecfg:node2> exit

#: zoneadm -z node2 install

Now boot both the zones.

#: zoneadm -z node1 boot

(configure node1)

#: zoneadm -z node2 boot

(configure node2)

Apache by default won't have the httpd.conf file ready for you. So what we'll be doing here is to create a copy of the httpd.conf-example file with the name httpd.conf in the global zone and the non global zones.

In the global zone, zone node1 and zone node2,

#: cp /etc/apache/httpd.conf-example /etc/apache/httpd.conf

Now your cluster should have a logical hostname that will identify the currently active device. This will remain unique to the cluster. It is important that all devices in the cluster have this hostname listed in it's /etc/inet/hosts. I choose the name 'node' for my cluster (I just realised it doesn't make much sense :P )

In non-global zone, zone node1 and zone node2,

#: echo '<Cluster IP> node' >> /etc/inet/hosts

Now your apache is all ready to go. The next step would be to setup the resource groups for your single node cluster. First, you'll need to setup the logical hostname resource that will set the hostname (that you'd added into your /etc/inet/hosts file) to identify your cluster. It is essential that you do this otherwise your IP won't failover (not like the cluster will allow you to make the resource group without this :P). Second, we'll configure apache to run on our single node cluster. We'll be using the Java Web Console for this (if you haven't enabled it, look into the 'how to setup a single node cluster' documentation again).

First, login to the web console (http://127.0.0.1:6789 by default), and go to Sun Cluster.

The first step involved in making the cluster would be to setup a resource group. In the left menu, go to resource groups and then, select 'New'. You will get another window where you'll be asked details about your resource group. I've already made the resource group named web1, so my window would look different from yours. This is just to give you an idea of the details.


Now select the primary nodes, we'll be including our zones here.

Once you've setup your resource group, it's time to setup individual resources. Again, select resource groups and from the drop down, choose the resource group that you just made. Select 'New', and setup two resources, one for your logical hostname...


... and the other for your Apache webserver. Set logical hostname as a strong dependency and specify the binary path for your apache (/usr/apache/bin on mine).

I'll remind you again that I'm showing you the details AFTER I've set up my resources, so hence, the drop downs are missing and the menus will be different.

Our resource configuration is done. Now go back to the resources group menu, select the group we just configured and click on 'restart'. Check if the services are online. If Murphy is kind enough, your cluster should be good to go!

Next, we'll invoke a failover between our zones. First, let's get an idea of our cluster's status with the following command,

#: /usr/cluster/bin/cluster status

Here's the output on my system...


Notice that our first zone, mercury:node1 is now online. You can verify this by opening your web browser and entering in your address bar both the cluster IP and node1's IP. Both will show you apache's default test page which implies that node1 is now in charge of the cluster. Now, to invoke the failover, we shut down node1 with this command,

#: zoneadm -z node1 halt

#: /usr/cluster/bin/cluster status

And the output is.... 

There you go! You've just failed apache over to zone mercury:node2. You may verify the same using your web browser. Keep repeating the process as many times as you want. Don't forget, have fun!

 Cheers! :)

Thursday Sep 18, 2008

Ok, so it's been a long time since I blogged, but this month has without any doubt been one of the most hectic times of my life. The first mid term examinations had just been done with and everyone had let out sighs of relief. But with a lot more evangelizing left to be done and SFD looming around the corner, I had to spring into action. Me and Saurabh, the CA from BITS-Pilani had agreed during our induction training programme in Bangalore, that we'd collaborate for all major events and pretty soon, we had our plans set and it was decided that BITS-Pilani would host the Rajasthan Wide Software Freedom Day Celebrations, 2008. I quickly called for a meeting with my group and informed them about my plans for SFD and what it's all about. We formed a group of coordinators and a group of volunteers. We decided to conduct Software Freedom Week, with a series of sessions for 5 days and quizzes after each session based on it. We decided to give away prizes (headphones) to the daily winners from each year and USB sticks to grand winners. Furthermore, all that'll be taught during the sessions will be taught by means of a lab session so that students get a hands on feel of things. We also agreed to hire a bus to take 50 students to BITS-Pilani for the Rajasthan Wide SFD Celebrations on the 21st of September. This was our first objective.


I'll give you all a little background before I write about our second objective for SFW. The main problem with Rajasthan is that students focus so much on clearing the engineering entrance examinations like the IIT-JEE and AIEEE, that they forget to think beyond that and they choose an engineering stream bubbling with misconceptions, the most common and disturbing one of which, is that of Computer Engineering and Electronics being the 'best branches' and branches like Civil Engineering being 'lower branches'. It can't any more wrong than this. There is nothing as a better branch or a worse branch when it comes to the field of engineering and the only thing that matters is interest. If one lacks that, it's pretty certain that he or she will not end up being a good engineer because this is a profession into which thousands of students graduate every year. Considering the limited number of jobs in the industry, only those who stand out end up being successful out there and to stand out, one needs to have a level of enthusiasm when it comes to excelling in his field. My institute is plagued with students who've picked certain branches without genuine interest and this is mostly prevalent in the Computer Engineering and Electronics Department. Most of them just want to get through with their four years and walk away with their degree. Our country produces only a two digit number of PhDs in the field of Computer Science compared to a 4 digit number of the same from China. Why is this? I guess I've already shown you all where the roots of the problem lie.


So my aim during Software Freedom Week was to visit as many schools as possible and clear the said misconceptions after talking about FOSS. I talked in Subodh Higher Secondary school about the world of open source for about 45 minutes. When I was done with answering questions, I went on to my next objective and asked the crowd of 250 assembled before me, “How many of you are going to pursue engineering?” Nearly 70% of the crowd raised their hands. My next question was, “How many of you consider Computer Engineering and Electronics as the best branches?” and I was shocked to see the same hands being raised. I asked them one by one why they thought so and they gave me very unsatisfying answers like there being more opportunities in the field of computers and that one can do anything they want with computers but not with other disciplines. I silenced each student with one argument each and told them about how important every branch is and what kind of students should pursue computer engineering and the doors of opportunities that it provides to. After four students, I repeated my last question again. This time, not a single hand was raised. :)


Subodh school also readily agreed to join hands with MOSUM in our FOSS Learning Connection where we'll visit students from their school occasionally and teach them how to work with open source technologies so that they may be inspired enough to excel in the field of computer science. I hope we can tap into some unseen potential by means of our endeavour. And I'm being told by my other coordinators that some other schools have also agreed to this initiative of ours.


The sessions within our institution began yesterday with a turnout of 70 students for my first talk. I believe I've succeeded in convincing them about the plethora of benefits that these technologies offer young students like ourselves and the edge it offers us when it comes to working in the industry one day. Let's hope the rest of the week is as blissful as it has been till date. With these thoughts, I get back to reading the OHAC documentation so I'm well prepared for the talk I'll be giving at BITS this weekend.

Sunday Sep 14, 2008

It's been ages since I put up a post so I guess it's time I come over and clear the cobwebs. It's been a pretty hectic week and a half since I got back from my CA induction training programme in Bangalore and I think I did quite a bit during the first week.

One thing I always intended on doing as CA of my institute is to nuke everyone's misconceptions on the open source ideology and the technologies that are associated with it. Contrary to what a lot of people think, open source is not a toy which is meant only for the lifeless geeks living in their basements with their computers. I don't think an end user needs to wonder how a technology is made as long as he can use it without any worries right? When's the last time you asked yourself how your bathing soap was manufactured and what chemicals go into it's making?

Open source has enough for everyone. If you're a developer, there's a whole lot of knowledge (which by extrapolation is source code) out their waiting to be hacked by you. If you're an end user, there's a lot of amazing software that can get your productivity up and running. Quality products and a healthy ecosystem where the developers interact more or less directly with the users is precisely what open source offers us. No middle layers, no sweet blondes from customer care centers, no nothing. People should embrace open source and experience the sheer awesomeness that comes bundled with it. And the best part of it is that it's all free! So what're you waiting for? Like Abhishek says, it's the age of participation, let's all participate!

Said and done, the aim of my first session was to enlighten people about what the world of open source offers them and why it's just plain better than their proprietary counterparts. I'd scheduled it for the 5th of August, a Tuesday and I'd gone through the routine of booking my department's seminar hall. But as luck would have it, the intended target of my audience, which was essentially 2nd years and 1st years, had their darned library card issuing on that very date. I've always hated the institute librarian ever since the day he kicked me and my ex out of the library for having a chat in the reading section. What a turd. I thought I forgot how much I hated him until this. He never put up a notice up in our department regarding the card issuing and hence, I didn't come to know. Even the juniors themselves were informed like 5 hours before my session started. But I decided to move ahead with the plan.

Surprisingly, I still got an attendance of around 35 students which included a fair mix of 1st, 2nd and 3rd yearites who decided NOT to get their cards issued because it's a well known fact that our library could be turned into a historical museum, considering how outdated our books are. Most third years didn't turn up because for some strange reason, they all felt they've already been enlightened. I wonder why they all still use Windows and TurboC then. Last I remember, Windows was proprietary wasn't it? Maybe it's changed. They'd know better I guess.

But I'm proud to say that every single student who were present that day told me how they just got a whole new insight on what open source actually was! It's better to know nothing than to know half of it, I've always told myself and that was the case with them all. They all insisted I get on with teaching them about these technologies ASAP and I'm convinced that the technology itself, and the ideology will partner well in driving these guys and gals forward.

Meanwhile, I came to know that some our students are organising a purely technical fest during the 3rd week of October, here in our institute. Before I knew it, they came running asking me to organise a programming contest. I wasn't really interested, but I saw this a golden opportunity and hence, I agreed do it for them IF and only IF they gave me at least two hours to conduct a workshop on Sun's technologies during the fest and hence, we had a deal. :)

My next session was held on the morning of Sunday the 10th. This time, I made sure that the librarian wouldn't interfere because that wretched fortress of his, stays closed on holidays :). I'd decided to divide my session into two, first with a talk on the Sun Academic Initiative and second with an introduction to the Unix environment. Booking the seminar hall for a weekend, especially after going through the hassle of being permitted to keep the keys wasn't easy and this clearly meant that I couldn't postpone this session if something was to go wrong. And heck, all the first years decided to go home for a week long mass bunk! My rotten luck just wasn't going to have enough of me.

The third years, yet again, decided they were good enough with Linux and whatever, so they didn't need an 'introduction' to the Unix environment. And just for the record, one of my batchies came to my room while I was typing this blog entry asking me for some help with an assignment and he then had this to say before he left, “Hey yaar, please tell me how I can learn Linux and all that. I think I need to do so badly.”

Strange, and in spite of all the notices I'd put up and the 'word of mouth' publicity I'd given my sessions, this dude didn't turn up. Sad.

But the best part of it was that forty second years attended my talk! There were five third years apart from this and a first year as well. At the end of my talk, I was taken aback by the enthusiasm my juniors showed. All of them wanted to get started with working on Linux and Solaris. They even asked me to conduct an install fest ASAP!

While I showed everyone my Debian GNU/Linux for the Unix commands, I kept giving people hints of what to expect in Open Solaris. Every now and then, when I have a conversation with a junior about Linux, I tell him something like 'so and so is better in solaris' and stuff like that. Everyone was particularly amazed by pre-emptive self healing :). I intend on building up this curiosity till the end of this month and then unleashing Open Solaris on them in September itself, after I myself, am comfortable with it. :)

The response I received from my juniors has given me a sense of hope, that one day, my institute can boast a large number of Linux and Open Solaris users and that we will have enough students in the developer communities out there. I see it as my responsibility to bring M-OSUM (MNIT Open Source User Mesh) to a height such that my successor doesn't have to do much work!

I guess I see the light at the end of the tunnel now, hope the road ahead proves to be smooth enough.

Cheers!