I am still testing this setup so please be aware to have adequate testing before trying to put it in production and share your valuable thoughts in comments if you have better idea for implementing same thing. As we know, Redis is an open source, BSD licensed, advanced key-value store with lots of features which makes it preferred choice. Persistency (disk dump) is one of them. In a busy, loaded Redis server, persistency can have its own noticeable overhead and impact performance.

How can we have data reliability/recoverability without having overhead of persistency in working redis server?


Redis is an open source, advanced key-value store. This guide provides you instructions/commands you can use to install and configure redis with master/slave config in two ec2 Ubuntu instances. Our intention is to use redis to store php sessions which needs to be shared among other instances.

1. Open ports in aws firewall:
Redis works with port 6379 which you need to open in aws firewall. You can do this by command line tools or Amazon Consle. IN case of Console, navigate to Security Groups, select security group in which instances are running and then select “inbound” tab to see/update rules.


Quickly setup rvm, Ruby, RubyGems and Apache with Passenger in aws ec2 ubuntu instance

October 8, 2012

While you can download Ruby directly from here or from repositories (though you may not find latest version in it). I preferred using the awesome Ruby version manager tool (rvm) for this purpose. Our setup was in requirement of latest Ruby, Gems and Passenger with Apache2 module and that setup seems to be straightforward but I faced lots of smaller issues and hence thought of collecting and putting final commands here so that next time it would be a quick setup without all that digging.

These commands are tested successfully in Ubuntu 12.04 ec2 instance.

Read the full article →

create secure mongodb replica-set in amazon aws ec2 instances

September 10, 2012

Installation and configuration of MongoDB is relatively very easy. There are different ways you can run MongoDB, be it running single server, master-slave, replica-set or running in sharded/cluster way. By default, MongoDB installation doesn’t provide secure environment where clients should authenticate themselves before accesssing database.

My setup consists 2 small instances running as normal MongoDB servers and 1 micro instance running as arbiter. An arbiter is special member in replica-set which takes part in voting/selection of primary but doesn’t store any data in it. Its perfectly fine to host your arbiter server within an existing server running for some other service like load balancer (haproxy) etc because of its lighweight resource utilization. To make setup secure, clients must use username/password to connect to MongoDB and also members of replica-set must have shared key file.

Read the full article →

Simple upstart job in Ubuntu to ensure your processes keep running

August 27, 2012

This is small post explaining a simple concept in Ubuntu. One of my friend requested about a way to ensure his processes keep running. Of course there are multiple ways to do and I have documented this earlier with details my earlier post.

Let’s review quickly:

1. Run processes through cron but it’s only helpful if check frequency is per minute or higher.
2. Use some process monitoring solution like Monit.
3. Create custom daemon wrapper script which keep checking processes all the time.

Read the full article →