Aug 152012
 

Need to play with PHP extension for redis for a while, and after reading several articles on the web, I decided to with PHPRedis instead of Predis because of performance.

My goal is build up a webservice to proxy requests to backend redis servers, the web server is actually a proxy handling all routing related issues, so that clients don’t have to worry about hashing, sharding, etc. So I do prefer something pretty fast, though I don’t know how fast I need.

I dig out an article of how to build up PHPRedis extension, but need to get redis.ini from github to so that build won’t fail. However, if you are lazy you can just put “extension=redis.so” to redis.ini by yourself, anyway, all up to you. Determine name of tarball and directory in spec file is some sort of tricky, as it seems things changed every version. I was using nicolasff-phpredis-2.2.1-66-g89bdaf2.tar.gz and nicolasff-phpredis-89bdaf2, note that they are not identical though have some common parts.

I’ve deployed the extension to one of my test box, and will do some tests later on.

Aug 092012
 

Encountered several times so better write it down here – in case you want to write messages to syslog facility, you can do “echo something | logger”, sure logger has lots of options to specify facility and priority etc.

logger should be part of Linux base package as I checked (util-linux-ng for CentOS, util-linux for Fedora, and bsdutils for Ubuntu).

BTW, dpkg -S <file> shows the package who owns the file.

Aug 092012
 

NetworkManager should be 2nd most useless thing on Linux (I give champaignship to SELinux).

Again this is NIS client setup, after everything setup, I found that the domain is messed up, obviously NetworkManager set domain to localdomain for some reason, it could be because of its default setting, but isnt’t good to leave this default value as a comment in configuration file? Anyway, I spent quite sometime digging into ypbind, nss, network, dhcp, stuffs, and finally – just disable the NetworkManager service, reboot the machine and everything went perfectly fine.

So write this down here – remind me disable NetworkManager next time if I install any Linux box.

Aug 082012
 

A colleague setup an NIS server to centralize the authentication, but on client side, after using yppasswd changed password, it never takes effect (i.e. still have to use old password), but restart ypserv make data sync up.

Quickly google and found this article, then adding “host 127.0.0.1” to /var/yp/securenets then restart (for the last time) ypserv gets this solved.

Aug 072012
 

Time to play with Virutalization again, this time I’m using kvm on CentOS 6, which has pretty many documentation but do need to pay more attention on details – I was locked out of the box last night after changing the network setting (with mistakes for sure ๐Ÿ™ ), this should be avoided for anyone who’s going to do this. Again, stay beside your machine whenever you are to do the initial setup.

After network setup is done, everything else is pretty smoothy, just need to read lots of man pages to know syntax of those qemu and virt-* commands. I repeated several times by virt-install, then virsh destroy and virsh undefine, etc., then virt-install again. There should be some better way to change configuration for existing VMs but for me, it’s much more easier to run from scratch.

Now I have 4 VMs running on a 8-cores/32G box, it seems everything’s OK so far, but I need to do some more tests – especially performance test – before carrying on.

BTW, a VNC viewer plus ssh tunnel is a must to do the setup, since I still haven’t figure out how to auto-installation, i.e. touchless, or installation without manually involve the process.

Aug 022012
 

Hit the process of registering a new outlook.com account, played with it and got a new (just for test) address, accidently hit the button changed it to my primary account, then found no way to switch back!!!

Somebody mentioned this to solve the problem, but it doesn’t work to me.

Still trying to dig in to find out proper solution, but if I fail maybe I will give up my old hotmail mail box.

 

Aug 012012
 

Be aware this is a joke. ๐Ÿ˜€

I had alert from a memcached service that mentioning for all the time that hit rate was too low, after checking it I found it was actually because the traffic was too low (the site was not in production yet), so how to solve this problem?

After thinking of various “serious” solutions, I finally turned to running a script, keep hitting the entries (actually, only one specific entry) in the cache, so to raise the hit rate to a level that makes Nagios stop alerting me.

OK, OK, I know this is bad, but fun, isn’t it?

Actually this causes another thinking – if there is a particular key having high miss rate, do we care? If we do then the monitoring mechanism won’t work for that case …