Skip to content
This repository has been archived by the owner on May 6, 2018. It is now read-only.

Commit

Permalink
merging umd-hadoop-dist into umd-hadoop-core
Browse files Browse the repository at this point in the history
extras, memcached experiment
  • Loading branch information
jimmylin committed Apr 19, 2009
1 parent edd3502 commit c01d90c
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 0 deletions.
39 changes: 39 additions & 0 deletions extras/memcached/bin-ec2/InstallMemcacheOnCluster.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#! /bin/sh

# checking the number of argument. First argument should be the path of rsa key file
if [ $# -ne 1 ]
then
echo "args: [path of the rsa key file]"
exit
fi

# if file does not exist then exit
if [ ! -f $1 ]
then
echo "$1 does not exist"
exit
fi


# getting list of ip addresses
LIST_OF_IP_ADDRESSESS='ListOfIpAddressess.txt'
if [ -f $LIST_OF_IP_ADDRESSESS ]
then
rm $LIST_OF_IP_ADDRESSESS
fi

ec2-describe-instances | awk '"INSTANCE"==$1 && "running"==$6 {print $4}' > $LIST_OF_IP_ADDRESSESS
echo "List of IP Addresses are stored in file ListOfIpAddresses.txt in the current directory"

var=`cat "$LIST_OF_IP_ADDRESSESS"`
for i in $var; do
ip_address=$i
echo "Starting memcached server on $ip_address ..."
`ssh -i $1 root@"$ip_address" 'killall memcached'`
`scp -i $1 dist/memcached root@"$ip_address":`
`scp -i $1 dist/libevent-1.4.so.2 root@"$ip_address":`
`scp -i $1 dist/start_memcached.sh root@"$ip_address":`
`ssh -i $1 root@"$ip_address" 'chmod +x start_memcached.sh'`
`ssh -i $1 root@"$ip_address" './start_memcached.sh'`
echo " ... Success!"
done
26 changes: 26 additions & 0 deletions extras/memcached/bin-ec2/RestartMemcached.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#! /bin/sh

# checking the number of argument. First argument should be the path of rsa key file
if [ $# -ne 1 ]
then
echo "args: [path of the rsa key file]"
exit
fi

# if file does not exist then exit
if [ ! -f $1 ]
then
echo "$1 does not exist"
exit
fi

LIST_OF_IP_ADDRESSESS='ListOfIpAddressess.txt'

var=`cat "$LIST_OF_IP_ADDRESSESS"`
for i in $var; do
ip_address=$i
echo "Restarting memcached server on $ip_address ..."
`ssh -i $1 root@"$ip_address" 'killall memcached'`
`ssh -i $1 root@"$ip_address" './start_memcached.sh'`
done

25 changes: 25 additions & 0 deletions extras/memcached/bin-ec2/VerifyMemcachedStatus.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#! /bin/sh

# checking the number of argument. First argument should be the path of rsa key file
if [ $# -ne 1 ]
then
echo "args: [path of the rsa key file]"
exit
fi

# if file does not exist then exit
if [ ! -f $1 ]
then
echo "$1 does not exist"
exit
fi

LIST_OF_IP_ADDRESSESS='ListOfIpAddressess.txt'

var=`cat "$LIST_OF_IP_ADDRESSESS"`
for i in $var; do
ip_address=$i
echo "Verifying memcached on $ip_address ..."
echo `ssh -i $1 root@"$ip_address" 'netstat -atpn | grep memcached'`
done

Binary file added extras/memcached/bin-ec2/dist/libevent-1.4.so.2
Binary file not shown.
Binary file added extras/memcached/bin-ec2/dist/memcached
Binary file not shown.
6 changes: 6 additions & 0 deletions extras/memcached/bin-ec2/dist/start_memcached.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

export LD_LIBRARY_PATH=.
chmod +x memcached
./memcached -d -u nobody -m 1024 -p 11211

21 changes: 21 additions & 0 deletions extras/memcached/bin-ec2/notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
make install exec_prefix=/fs/clip-qa/jimmylin/memcache/le-install

gcc -g -O2 -o memcached-debug memcached.o slabs.o items.o assoc.o thread.o stats.o ../le-install/lib/libevent-1.4.so.2

hadoop jar hadoop-0.17.0-streaming.jar -input stream.in -output stream.out \
-mapper start_memcached.sh \
-file start_memcached.sh -file memcached -file libevent-1.4.so.2 \
-jobconf mapred.map.tasks=1

"export LD_LIBRARY_PATH=.; ./memcached -d -u nobody -m 512 127.0.0.1 -p 11211; while [ 1 ] do sleep 5 done;"

hadoop jar hadoop-0.17.0-streaming.jar -input stream.in -output stream.out \
-mapper "/lib/ld-linux.so.2 --library-path . ./memcached -u nobody -m 512 -p 11211" \
-file start_memcached.sh -file memcached -file libevent-1.4.so.2 \
-jobconf mapred.map.tasks=2


scp memcached [email protected]:
scp libevent-1.4.so.2 [email protected]:
scp start_memcached.sh [email protected]:
ssh [email protected] ./start_memcached.sh
Binary file added extras/memcached/libevent-1.4.8-stable.tar.gz
Binary file not shown.
Binary file added extras/memcached/memcached-1.2.6.tar.gz
Binary file not shown.

0 comments on commit c01d90c

Please sign in to comment.