incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anthony Molinaro <antho...@alumni.caltech.edu>
Subject Re: Cold boot performance problems
Date Sat, 09 Oct 2010 04:08:48 GMT

On Fri, Oct 08, 2010 at 05:31:28PM -0700, Dave Viner wrote:
> Has anyone found solid step-by-step docs on how to raid0 the ephemeral disks
> in ec2 for use by Cassandra?

No, but here's a script I used to raid0 3 ephemerals in an xlarge instance.
You can edit the top part for different configs for different number of
ephemerals.

-Anthony

-----8<-----8<--- begin script ------>8----->8----

#!/bin/bash

########################
# config stuff to edit #
########################

# partitions to use
partitions="/dev/sdb /dev/sdd /dev/sde"

# tempfile to use
tempfile="/tmp/fdisk.raid"

# devices in raid
raidcount=3
raidparts="/dev/sdb1 /dev/sdd1 /dev/sde1"

# raiddev to use
raiddev="/dev/md0"


function buildraid () {

#######################################
# script, typically stuff not to edit #
#######################################

# loop through partitions, create the fdisk file and then create partitions
for partition in $partitions; do

# create an input file for fdisk
cat > "$tempfile" << EOF
n
p
1


t
fd
w
EOF

# partition the disks
echo "Partitioning $partition..."
fdisk $partition < $tempfile

# remove the temp file
rm -f /tmp/fdisk.raid

done

echo "Creating RAID device $raiddev..."
mdadm --create --verbose $raiddev --level=raid0 --raid-devices=$raidcount $raidparts

echo "Formatting RAID device $raiddev using ext3..."
mkfs.ext3 $raiddev

echo "RAID device $raiddev read to use.  Mount using mount -t ext3 $raiddev <mount point>"
}

function makefstab () {

tempfstab="/tmp/fstab"
cat > "$tempfstab" << EOF
/dev/sda1  /         ext3    defaults        1 1
/dev/sdc2  /mnt2     ext3    defaults        0 0
/dev/md0   /mnt      ext3    defaults        0 0
none       /dev/pts  devpts  gid=5,mode=620  0 0
none       /dev/shm  tmpfs   defaults        0 0
none       /proc     proc    defaults        0 0
none       /sys      sysfs   defaults        0 0
rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs defaults 0 0
EOF

cp /tmp/fstab /etc/fstab

}

# build raid with 3 disks
if test ! -f /var/lib/lock/builtraid.lock ;
  then
    touch /var/lib/lock/builtraid.lock
    umount /mnt
    buildraid
    makefstab
    mount /mnt
  fi

-----8<-----8<--- end script ------>8----->8----

Mime
View raw message