Skip to content

Instantly share code, notes, and snippets.

@hvasconcelos
Created June 7, 2014 00:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hvasconcelos/4cd108236a7bc7285636 to your computer and use it in GitHub Desktop.
Save hvasconcelos/4cd108236a7bc7285636 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Mongodb
sudo cp /shared/mongodb.repo /etc/yum.repos.d/mongodb.repo
sudo yum -y install update
sudo yum -y install mongodb-org
sudo yum -y install vim wget
sudo chkconfig mongod on
wget https://gist.githubusercontent.com/hvasconcelos/e514938043c7bab2aed4/raw/dc5b54aa1bd20dcde422a7f018477fccc6852b0b/mongod.conf /etc/mongod.conf
sudo service mongod stop
sudo service mongod start
# Redis
sudo yum -y install make gcc tcl lua lua-devel jemalloc
cd /usr/local/src
wget http://download.redis.io/releases/redis-2.8.10.tar.gz
tar xzf redis-2.8.10.tar.gz
cd redis-2.8.10
cd deps
sudo make hiredis lua jemalloc linenoise
cd ..
sudo make
sudo make install
mkdir -p /var/db/redis
mkdir -p /etc/redis
sudo wget http://download.redis.io/redis-stable/redis.conf -O /etc/redis/redis.conf
sudo sed -ie "s/^daemonize no$/daemonize yes/" /etc/redis/redis.conf
sudo sed -ie "s/^dir \.\//dir \/var\/db\/redis\//" /etc/redis/redis.conf
sudo sed -ie "s/^loglevel debug$/loglevel notice/" /etc/redis/redis.conf
sudo sed -ie "s/^logfile \"\"$/logfile \/var\/log\/redis.log/" /etc/redis/redis.conf
sudo wget https://gist.githubusercontent.com/paulrosania/257849/raw/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server -O /etc/init.d/redis-server
sudo chmod u+x /etc/init.d/redis-server
sudo sed -ie "s/usr\/local\/sbin\/redis/usr\/local\/bin\/redis/" /etc/init.d/redis-server
sudo /sbin/chkconfig --add redis-server
sudo /sbin/chkconfig --level 345 redis-server on
sudo /sbin/service redis-server stop
sudo /sbin/service redis-server start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment