搭建环境html
CenterOs 6.5linux
在安装Redis以前,要确保系统有gcc环境。redis
# yum install gcc
一.安装Redisvim
1.官网下载服务器
# wget http://download.redis.io/releases/redis-3.0.0.tar.gz工具
2.解压:性能
# tar -zxvf redis-3.0.0.tar.gz学习
3.进入解压后的目录并编译测试
# cd redis-3.0.0命令行
# make
4.安装到指定目录
4.1 检查包包是否正常。
# make test cd src && make test make[1]: Entering directory `/root/program/redis-3.0.0/src' You need tcl 8.5 or newer in order to run the Redis test make[1]: *** [test] Error 1 make[1]: Leaving directory `/root/program/redis-3.0.0/src' make: *** [test] Error 2
须要安装 tcl 8.5 或以上版本,官网传送门
http://www.linuxfromscratch.org/blfs/view/cvs/general/tcl.html
(不过不安装这个也能够继续下面步骤)
安装完tcl后 回到主题,继续安装Redis
把Redis安装到指定目录
# make PREFIX=/usr/local/redis/ install
为了方便管理,这里把redis-3.0.0 目录下的redis.conf文件复制到安装目录下
# cp redis.conf /usr/local/redis/bin/
5.启动redis
redis默认启动端口好为 6379
打开Redis后台启动模式 须要把redis.conf 文件的 daemonize 改成yes
# vim redis.conf
################################ GENERAL #####################################
# By default Redis does not run as a daemon. Use 'yes' if you need it.
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
daemonize yes
启动
# redis-server redis.conf
使用redis自带客户端测试
[root@localhost bin]# redis-cli
127.0.0.1:6379>
关于学习redis很不错的博文,须要的同窗点击传送
http://www.cnblogs.com/stephen-liu74/archive/2012/03/12/2348935.htm
6. 进入安装目录,查看安装列表
[root@localhost bin]# ll
total 2692
-rwxr-xr-x 1 root root 236070 Mar 7 06:50 redis-benchmark
-rwxr-xr-x 1 root root 22169 Mar 7 06:50 redis-check-aof
-rwxr-xr-x 1 root root 45355 Mar 7 06:50 redis-check-dump
-rwxr-xr-x 1 root root 341405 Mar 7 06:50 redis-cli
lrwxrwxrwx 1 root root 12 Mar 7 06:50 redis-sentinel -> redis-server
-rwxr-xr-x 1 root root 2099834 Mar 7 06:50 redis-server
安装目录下文件介绍
文件名 | 说明 |
redis-benchmark | Redis性能测试工具 |
redis-check-aof | AOF文件修复工具 |
redis-check-dump | RDB文件修复工具 |
redis-cli | Redis命令行客户端 |
redis-server | Redis服务器 |
redis-sentinel | Redis集群管理工具 |