January 31, 2013

Setting Up Percona-xtrabackup


Percona XtraBackup is the world's only open-source, free MySQL hot backup software that performs non-blocking backups for InnoDB and XtraDB databases. With Percona XtraBackup, you can achieve the following benefits:
  • Backups that complete quickly and reliably
  • Uninterrupted transaction processing during backups
  • Savings on disk space and network bandwidth
  • Automatic backup verification
  • Higher uptime due to faster restore time
Ref

 Installation:

wget http://www.percona.com/redir/downloads/XtraBackup/XtraBackup-2.0.3/binary/Linux/x86_64/percona-xtrabackup-2.0.3-470.tar.gz

tar -zxvf percona-xtrabackup-2.0.3-470.tar.gz

cd percona-xtrabackup-2.0.3/bin

sudo cp * /usr/bin

Setting Up Percona-mysql-server

Percona apt Repository is not included in Base Ubuntu. So need to install it

sudo gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
sudo gpg -a --export CD2EFD2A | sudo apt-key add -

Add this to /etc/apt/sources.list, replacing VERSION with the name of your distribution:

deb http://repo.percona.com/apt precise main
deb-src http://repo.percona.com/apt precise main
apt-get update
apt-get install percona-server-server-5.5 percona-server-client-5.5

Ref:http://www.percona.com/doc/percona-server/5.5/installation/apt_repo.html
Ref:http://www.percona.com/doc/percona-server/5.5/installation.html

We can generate initial mysql configuration file (my.cnf) through the following link
https://tools.percona.com/wizard

VirtualBox Clone Root HD / Ubuntu / Network issue



When you clone a root Ubuntu disk in VirtualBox, one thing that gets messed up is the network card definition.  This is because Ubuntu (as it should) uses UDEV IDs for the network device.  When you boot your new disk, the network device ID has changed, so it creates a new eth1 device.  Unfortunately, this conflicts with the VirtualBox network setup.  What to do?

Boot the box (no network)

Edit the /etc/udev/rules.d/70-persistent-net.rules

Delete the eth0 line and modify the eth1 line to be eth0

--------- Example OLD -----------

# This file was automatically generated by the /lib/udev/write_net_rules# program, run by the persistent-net-generator.rules rules file.## You can modify it, as long as you keep each rule on a single# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x100e (e1000)    <-------------------- br="" delete="" lines="" these="" two="">SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:d8:8d:15", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x100e (e1000)     ---Modify the next line and change eth1 to be eth0
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:89:84:98", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

----------------------------------------

--------- Example NEW -----------

# This file was automatically generated by the /lib/udev/write_net_rules# program, run by the persistent-net-generator.rules rules file.## You can modify it, as long as you keep each rule on a single# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:89:84:98", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

----------------------------------------
Reference:

Image cache issue in drupal with nginx


Resolved it by adding the following in nginx virtual host file:
       
    location ^~ /sites/default/files/imagecache/ {
            index  index.php index.html;

            if (!-e $request_filename) {
                rewrite  ^/(.*)$  /index.php?q=$1  last;
                break;
            }
        }

The above assumes that your imagecache files are to be stored in sites/default/files/imagecache
Instead of nginx serving the static content (the jpeg or png or whatever) to the browser it will instead rewrite the path to (invisibly): index.php?q=sites/default/files...
This allows imagecache to run its manipulations on the file.
Just make sure you alter the location directive to match whatever path your imagecache files are in (relative to site root) and you should be fine.

Reference: