Nov 302009
 

I just finished A Byte of Python, planning to read it again and then turn to Dive into Python, I’ve done some simple Python programs while I was reading, everything seems fine so far.

A little girl though A Byte of Python is a scary book, she thought I mis-spelled “bite”, so the book I read becomes “a bite of a big snake”, I know it’s scary :D. It took me sometime to got her understood Python is a computer programming language, I just wish I made it but anyway she stopped talking about the book and go back calling me “lobster killer”.

Yes, I cooked another lobster for the last day of Thanks Giving holiday.

Nov 272009
 

What I’ve bought in the past couple of days, all under the name of “Thanks Giving shopping”:

  • A Sony HandyCam, now I can formally retire my Casio Exim
  • A set of JA Hanckels knives for kitchen … you will be cut even just look at it
  • Mario Kart for my Wii! Yes, I like racing game for all the time, even if it is childish

will play with these stuffs for sometime, having fun, and enjoying life. ๐Ÿ™‚

Nov 272009
 

Somebody heard it from “Julie and Julia”, and because I cooked a lobster for Thanks Giving, now I’m called “lobster killer” for all the time.

BTW, this year’s lobster tasted good, one more to come for this weekend. ๐Ÿ˜€

 Posted by at 12:41  Tagged with:
Nov 272009
 

Trying to search online for an affordable 8-cores machine, but now I’m asking myself – why?

Well, one of the most obviously reason is that if I can have one powerful machine, I can retire 2 or 3 machines at home, include one P4 desktop from year 2003, one PowerBook from year 2004, and one P4 laptop from year 2005 (this one is actually in question).

I found out that I need this many machines just because I need to test all those multiple host development and deployment. What could be ideal to me, is that I can have 8~10 hosts running in two separated network, so I can test more than what I’m playing now.

Actually I should not expect for a 8-core box as it will be pretty expensive (haven’t locked down price yet), based on my experience with current dual-core machine, it seems a 4-core box can satisfy me – it will be able to run 8~10 VMs but I need at least 8G memory, and if it is 12G then all data VMs can run at 1G mem which will be more like a real world.

So I should forget about 8-core machine unless someday Intel or AMD roll out a single 8-core CPU for desktop. It seems to me the most reasonable plan to consolidate computers at home is getting a new iMac, let it be the home desktop, running all photo/video editing, storage massive data, etc, and take the current home desktop (which is a 4-core desktop) and then retire the PowerBook (maybe leave it running somewhere? Anyway it does not occupy too much space) and the P4 box, and turning current dual-core machine as the second Window machine at home, pity I don’t think it can run Windows 7.

Nov 262009
 

It seems ipvsadm does not do health check, etc., so I turned to keepalived. While keepalived is doing great job on adding live node back and removing dead node out, it does not have a good way to dump current rules and stats, also it has problem during startup time.

I think latest keepalived may have solved the problem though I haven’t tried yet. If it works fine I will leave ipvsadm installed to be the utility tool only (i.e. disable service coming from ipvsadm).

I will look around to see if there is anything else similar to keepalived or not, it should be, I think.

Nov 252009
 

Playing with LVS – so that I don’t have to connect to individual Cassandra server.

What I planned for LVS:

  • 192.168.1.99 will be VIP
  • f5 (192.168.1.205) will be LVS director … you are right, its name is f5 ๐Ÿ˜‰
  • f1 (192.168.1.101) to f4 (192.168.1.104) will be real server
  • will do DR mode (I think it is called single-B on most L4 switches …)

The configuration is actually pretty simple, as long as you get it right, on LVS director (f5):

  • Configure VIP to eth0:0 as an alias, netmask should be 255.255.255.255, broadcast is VIP itself
  • Add following rules with ipvsadm (yea … you need to install this package)
    -A -t 192.168.1.99:9160 -s wlc
    -a -t 192.168.1.99:9160 -r 192.168.1.101:9160 -g -w 1
    -a -t 192.168.1.99:9160 -r 192.168.1.102:9160 -g -w 1
    -a -t 192.168.1.99:9160 -r 192.168.1.103:9160 -g -w 1
    -a -t 192.168.1.99:9160 -r 192.168.1.104:9160 -g -w 1
  • Start LVS (after restart network to make sure VIP is effective) by “ipvsadm –start-daemon master”
  • If you want to stop LVS you can do “ipvsadm –stop-daemon master”

Now let’s turn to real servers – all real servers (f1~f4) are doing the same:

  • Add these lines to /etc/sysctl.conf and then do a “sysctl -p”
    net.ipv4.conf.dummy0.arp_ignore = 1
    net.ipv4.conf.dummy0.arp_announce = 2
    net.ipv4.conf.all.arp_ignore = 1
    net.ipv4.conf.all.arp_announce = 2
  • Configure VIP to dummy0 as an alias, netmask should be 255.255.255.255, broadcast is VIP itself
  • Change ThriftAddress in storage-conf.xml for Cassandra, to 0.0.0.0 so that Thrift serves on all interfaces
  • Remember to restart Cassandra so to make new configuration takes effect

Now, launch your favorite client, connecting to 192.168.1.99:9160, you should get everything as if connect to individual server.

Nov 242009
 

Alright, this should be named as fighting cat.

I believe it’s a cat, a wild cat. I said “I believe” because I never saw it – it comes in night only.

I’m not a cat-hater, but it left feces on my tree EVERY NIGHT, this becomes annoying whenever I clean up my backyard during the weekend, as it becomes a lot.

I’m loser in this case so far – I tried put something smelled really bad over there, obviously it doesn’t care, then I tried to put water that since cat scares, obvious it’s a brave cat. My most recent try is buying 4 rat traps, putting them there on the tree – I don’t meant to catch the cat, but just want to scare it so never come again.

I was happy yesterday morning while I found nothing there other than my rat traps, but bad news for this morning – one rat trap got triggered (but something you know, shi*t), and seems the cat didn’t get hurt at all, actually I was almost hurt by those rat traps whenever I was pulling them down and re-set.

OK, now I lost my idea, I’m going to search online for some serious solution. Things in my mind include: poisoned bait (again I don’t want to kill the cat), electric fence, and what else? Also I will try to set motion detected camera to see if I can catch the scene or not, maybe it’s not a cat at all …

 Posted by at 11:59  Tagged with:
Nov 242009
 

“not fast” is better than “slow”, so I think I’m making progress, better than before.

Updates:

  • I moved to proxmox which gives me better VM performance so that I can have more VMs for my test, it did take me some time to dig out a usable solution. Now I’m running 4 VMs so I can test fail-over and bootstrap etc.
  • I moved to Python since PHP is not that popular now especially in all these new technology, I’m a code-by-sample guy, so while the whole world is writing codes in Java, Ruby, and Python, I don’t have many choices. I picked Python because I don’t want to run things like Tomcat, and built-in web servers does not convince me (I’m talking about Ruby).
  • I’ve done some simple tests but dealing with columns, etc., the test environment gives me reasonable performance number – 8ms per read/write.
  • I’m still learning Python and its web stuffs, seems not that hard to catch up though. I’m using web.py which seems to be the lightest framework, I may be wrong but I don’t want to dig in more at this moment.

To-do list:

  • I need to figure out if Ubuntu is still the way to go for my virtualization environment, I’m worrying proxmox is not a major player in this area so it may ruin my long term plan.
  • I need to find out if there is any other better HTTP server, “better” here means: light, support wsgi.
  • I’m going to compose some test scripts dealing with super column, which is what I need to use for the statistic project.
  • Revisit original design, both schema and work flow may have some changes.

I would like to say, everything is on the track, though I’m not that fast. I will post updates after this thanks giving as I doubt if I will have time coding during the holiday.

Nov 202009
 

I recently spent lot of time on reading articles from Linux Magazine, as it always introduce pretty new (or not new, but less known) technology and products, this time it is Proxmox, an open source virtualization product.

I’m running VMWare Go at home at this moment, but I failed to solve the license issue and every 60 days I have to re-install everything. I guess I got the wrong ISO, so what I installed was actually for vSphere, but I just don’t want to spend too much time on digging it out as obviously VMWare does not want people get the right solution easily.

Xen is another story, at least to me it is not easy to use, maybe next version will be easier (I should take a try either but I lack of machines …). Also, I still have this impression that running Ubuntu with Xen is painful as it is, kind of, tightly bundled with RedHat distro.

Now here comes Proxmox which seems promising, I will take a try today (may be weekend as well) and then if it works I will stick with it, but if not … I will try out Xen.

Let’s see.