goodmm 发表于 2015-7-23 01:31:30

install redis on linux

  #! /bin/bash
cd /usr/local/src
wget http://redis.googlecode.com/files/redis-2.6.4.tar.gz
tar -xvf redis-2.6.4.tar.gz
cd redis-2.6.4
make && make install
  if [ -d /usr/local/redis ];
then
    echo 'already installed, remove the redis first'
else
    mkdir /usr/local/redis
    mkdir /usr/local/redis/etc
    mkdir /usr/local/redis/var
    mkdir /usr/local/redis/bin   
cp *.conf /usr/local/redis/etc
    cp src/redis-benchmark /usr/local/redis/bin/
    cp src/redis-check-aof /usr/local/redis/bin/
    cp src/redis-cli /usr/local/redis/bin/
    cp src/redis-check-dump /usr/local/redis/bin/
    cp src/redis-stat /usr/local/redis/bin/   
    cp src/redis-sentinel /usr/local/redis/bin/
    cp src/redis-server /usr/local/redis/bin/
fi
  cd ..
rm -rf redis-2.6.4
rm -rf redis-2.6.4.tar.gz
  WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
页: [1]
查看完整版本: install redis on linux