安装redis
1下载
http://redis.io/download
下载文件大小1M左右,将下载的redis-2.8.3.tar.gz,传到需要的unix主机上。
或者直接在unix主机上,wget http://download.redis.io/releases/redis-2.8.3.tar.gz
2解压
gunzip redis-2.8.3.tar.gz
tar xvf redis-2.8.3.tar
3.编译
cd redis-2.8.3
make
此时,二进制文件都编译到src目录下
(如果想编译到/usr/local/bin目录下,
可以在
redis-2.8.3目录
执行make install,但要确保当前用户对/usr/local/bin有写权限哦)
4.然后将该src目录路径,放到用户profile的PATH环境变量即可。
5.我的profile(供参考)
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
REDIS_BASE=/home/ldh/redis
REDIS_HOME=$REDIS_BASE/redis-2.8.3
PATH=$PATH:$HOME/bin:$REDIS_HOME/bin:/home/ldh/redis/redis-2.8.3/src
export PATH
export REDIS_BASE
export REDIS_HOME
6.我的目录结构(供参考)
[root@hauser ~]# su - ldh
[ldh@hauser ~]$ ls
redis redis-stable.tar.gz
[ldh@hauser ~]$ cd redis
[ldh@hauser redis]$ ls
redis-2.8.3 redis-2.8.3.tar
[ldh@hauser redis]$ cd redis-2.8.3
[ldh@hauser redis-2.8.3]$ ls
00-RELEASENOTES CONTRIBUTING deps Makefile README runtest src utils
BUGS COPYING INSTALL MANIFESTO redis.conf sentinel.conf tests
[ldh@hauser redis-2.8.3]$ pwd
/home/ldh/redis/redis-2.8.3