create and manage RAID0/RAID10 using EBS volumes in AWS EC2 Ubuntu instance

July 20, 2012

This quick howto guide explains commands to create RAID device using EBS volumes attached to your EC2 instance and related configurations. I have created RAID level 0 (RAID0) here with 2 EBS Volumes (50GB each) but the procedure is same for other RAID levels as well, you just need to supply proper parameters in specific commands i.e. mdadm.

One major issue I faced while doing this exercise is that the RAID device needs to be re-assembled properly after instance reboot/restart and if you don’t take enough care, you may face different issues like instance get stuck while booting, or RAID won’t appear at all or it might get renamed to something else. I have explained the fix for that as well.

Read the full article →

Staging and production release deployment with Git using Capistrano

June 25, 2012

There are many ways to deploy your code on staging and production environment. What I am describing here is just one of them. It’s working as expected for me but I recommend doing proper research before using it in your environment.

We assume here that there is one Server having Git along with Gitolite for authentication and authorization running RHEL/CentOS. We will call this as release server. I have already described how to setup this server with Git, Gitolite, Gitweb and SSH/HTTP authentication in earlier article.

Read the full article →

7 essential tools for MySQL DBA

May 28, 2012

1. Percona Toolkit
Percona Toolkit (aka Maatkit and Aspersa) is must have collection of advanced command-line tools which helps in performing tasks that are too difficult or complex to perform manually.

2. Mydumper
Mydumper is a high-performance multi-threaded backup/restore tool for MySQL. It’s up to 10x faster compared to mysqldump, can take consistent snapshots and provides File compression on-the-fly. Though it’s still under active development but is well tested/used in production on some large installations.

Read the full article →

Simple and efficient MongoDB Backup using script

May 9, 2012

MongoDB Backup types and strategies are neatly explained in its documentation, which you can check here. In case you are not familiar with MongoDB backup types and strategies, please have a look at its documentation.

What I am describing here is a simple script which we are using since months to take MongoDB backup and transfer it over to our Backup server. Here are few things its doing:

  • As we have multiple MongoDB Replica Sets, the script identify current replica set and check whether current server is Master or Slave, exit if its Master. We take backup only from Slave host.
Read the full article →

A very small bash script challenge

April 25, 2012

*Kind Note*: This was written with a sense of humor to allow visitors quickly discover code anomaly and suggests fixes but if it is not up to your mark, please close your browser tab instead of making unnecessary noise. Thanks You!
I am putting a damn small thing here regarding bash script for fun.

Here it goes: Need to create a bash script which asks for a word from user, say either “one”, “two” or “three” and then check in single if statement (no else if section) that if its not “one” or “two” or “three” then print Not OK otherwise print OK.

Read the full article →