Redis下载
http://www.redis.io/download
把下载的压缩包放到/opt目录下
需要确保你的操作系统上已经安装gcc软件,如果没有安装可以使用yum install gcc*来安装,否则会编译出错。
tcl 8.6.0 编译安装:
cd /opt
wget http://downloads.sourceforge.net/tcl/tcl8.6.0-src.tar.gz
安装tcl:
cd unix &&
./configure --prefix=/usr \
--without-tzdata \
--mandir=/usr/share/man \
$([ $(uname -m) = x86_64 ] && echo --enable-64bit)
make
sed -e "s@^\(TCL_SRC_DIR='\).*@\1/usr/include'@" \
-e "/TCL_B/s@='\(-L\)\?.*unix@='\1/usr/lib@" \
-i tclConfig.sh
make install
make install-private-headers
ln -v -sf tclsh8.6 /usr/bin/tclsh
chmod -v 755 /usr/lib/libtcl8.6.so
把源码里的redis.conf复制到/etc目录下,再次执行make test即可全部通过
规范部署管理:
cd /opt/redis-2.6.11
mkdir bin
mkdir logs
mkdir conf
mkdir data
cd /opt/redis-2.6.11/src
cp redis-server redis-benchmark redis-check-aof redis-check-dump redis-cli /opt/redis-2.6.11/bin/
cd /opt/redis-2.6.11
cp redis.conf conf/
[root@localhost redis-2.8.24]# ll
total 160
-rw-rw-r--. 1 root root 37507 Dec 18 23:13 00-RELEASENOTES
drwxr-xr-x. 2 root root 4096 Jan 27 18:45 bin
-rw-rw-r--. 1 root root 53 Dec 18 23:13 BUGS
drwxr-xr-x. 2 root root 4096 Jan 27 18:45 conf
-rw-rw-r--. 1 root root 1439 Dec 18 23:13 CONTRIBUTING
-rw-rw-r--. 1 root root 1487 Dec 18 23:13 COPYING
drwxr-xr-x. 2 root root 4096 Jan 27 19:00 data
drwxrwxr-x. 6 root root 4096 Jan 27 17:49 deps
-rw-rw-r--. 1 root root 11 Dec 18 23:13 INSTALL
drwxr-xr-x. 2 root root 4096 Jan 27 18:45 logs
-rw-rw-r--. 1 root root 151 Dec 18 23:13 Makefile
-rw-rw-r--. 1 root root 4223 Dec 18 23:13 MANIFESTO
-rw-rw-r--. 1 root root 5201 Dec 18 23:13 README
-rw-rw-r--. 1 root root 36298 Dec 18 23:13 redis.conf
-rwxrwxr-x. 1 root root 271 Dec 18 23:13 runtest
-rwxrwxr-x. 1 root root 281 Dec 18 23:13 runtest-sentinel
-rw-rw-r--. 1 root root 7109 Dec 18 23:13 sentinel.conf
drwxrwxr-x. 2 root root 4096 Jan 27 17:49 src
drwxrwxr-x. 9 root root 4096 Dec 18 23:13 tests
drwxrwxr-x. 3 root root 4096 Dec 18 23:13 utils
[root@localhost bin]# ll
total 15244
-rwxr-xr-x. 1 root root 4586219 Jan 27 18:25 redis-benchmark
-rwxr-xr-x. 1 root root 22177 Jan 27 18:25 redis-check-aof
-rwxr-xr-x. 1 root root 45387 Jan 27 18:25 redis-check-dump
-rwxr-xr-x. 1 root root 4688093 Jan 27 18:25 redis-cli
-rwxr-xr-x. 1 root root 6255733 Jan 27 18:25 redis-server
Redis启动与停止
启动命令与停止命令设置:
cd /opt/redis-2.6.11/bin
touch mystart.sh
touch mystop.sh
vim mystart.sh
/opt/redis-2.6.11/bin/redis-server /opt/redis-2.6.11/config/redis.conf
vim mystop.sh
/opt/redis-2.6.11/bin/redis-cli �Cp 6380 shutdown