Red Crackle Blog

How to set up Percona XtraDB Cluster on Ubuntu

Using Percona XtraDB Cluser with at least 3 nodes is a good option when you want to use MySQL in a high-availability mode. The advantage is that even if one of the nodes goes down, the application will still be able to read and write to the MySQL database. In this article, we'll show you the steps to install Percona XtraDB Cluster 5.6 on Ubuntu 12.04. Here are the steps:

1) Percona packages are signed with a key. First we need to add the key to apt. Execute the following command on all the three servers.

How to connect to GlusterFS from a client machine

This article is for those users who already have GlusterFS server installed. In the article, we demonstrate how to connect to GlusterFS server from a client.The example shown in the article first installs GlusterFS native client 3.5.2 on Ubuntu 12.04. After this, a series of command line prompts are executed to connect to the GlusterFS server from a client. Add GlusterFS PPA and install its client library. A directory will also be created on the client machine from where GlusterFS will be mounted.Don't forget to replace parameter names with local ones While using the code provided in the article.

How to change location where MySQL stores data on disk

Most developers who install MySQL via apt-get on Ubuntu will know that it comes with pre-defined settings. The directory where MySQL stores its data is one such setting. The default location is /var/lib/mysql. There are times when this location will have to be changed. But a lot of developers face difficulty in this regard. This article will guide you through the process. Use the command line prompts provided in the article to arrive at desired results. After you have completed the steps mentioned in this article, make sure you restart MySQL. And voila, MySQL will use the new directory specified by you to store data.

How to cache pages by role in Varnish

Varnish is generally used to cache pages for anonymous users. It is also used to cache pages by role. At Red Crackle, we deploy Varnish to cache pages by role for corporate sites that are exclusively visible only under SSO. This ensures all users are authenticated but there is no user related information present on most of these pages. This article explains how Varnish caches pages and how configuration can be altered to cache pages by role. The article uses hook_init() to set a cookie that identifies user roles. hook_user_logout() is then used to remove the cookie as soon as the user logs out.

How to install Varnish 3 from source on Ubuntu 12.04

Recently we had to install Varnish from source so that we could compile it with some additional modules. Here are the steps to install Varnish 3 from source on Ubuntu 12.04:

1) Clone Varnish source from git.

git clone

2) Change into the cloned directory.

cd Varnish-Cache

3) Checkout branch 3.0 from git and pull the latest content of this branch.

How to put a breakpoint in a dynamically loaded javascript

Using Firebug or Chrome DevTools, It's very easy to put a breakpoint in a JS that is loaded during page load. But if you are loading a JS dynamically after the page load, it's not that simple. Today I learned a nice trick to make it easier to put a breakpoint in such a javascript using Chrome DevTools. Here are the steps:

1) At the bottom of the JS file that is being loaded dynamically, add the following line:

Ready to get started?REQUEST A QUOTE