CentOS6.5安装Redis2.8.19
来源:互联网 发布:星球大战顺序 知乎 编辑:程序博客网 时间:2024/05/29 18:22
其实,不想写这篇文章的,网上有很多文章了,只是记录一下自己的安装过程,可能和网上的有些不怎么一样,我们的文章一般会比较详细,今天就简单记录一下~~
首先,我的源码包一般放在/data/src/ 下面
1、下载Redis2.8.19
[root@localhost202 src]# wget http://download.redis.io/releases/redis-2.8.19.tar.gz
[root@localhost202 src]# tar -zxf redis-2.8.19.tar.gz
[root@localhost202 src]# cd redis-2.8.19
2、编译
[root@localhost202 redis-2.8.19]# make
3、编译测试
[root@localhost202 redis-2.8.19]# make test
小提示:如果没安装有tcl那么会包下面这错误:
You need tcl 8.5 or newer in order to run the Redis test
【安装Tcl-8.6.3】
[root@localhost202 src]# wget http://downloads.sourceforge.net/tcl/tcl8.6.3-src.tar.gz
[root@localhost202 src]# tar -zxf tcl8.6.3-src.tar.gz
[root@localhost202 src]# cd tcl8.6.3/unix/
[root@localhost202 src]# ./configure
[root@localhost202 src]# make
[root@localhost202 src]# make install
4、安装
[root@localhost202 redis-2.8.19]# make PREFIX=/usr/local/redis install
这步完了之后,Redis就被安装到了/usr/local/redis/ 下面了
5、配置,下面就是修改配置文件
[root@localhost202 redis-2.8.19]# cp ./redis.conf /usr/local/redis/
[root@localhost202 redis-2.8.19]# vim /usr/local/redis/redis.conf
daemonize yes #redis将以守护进程的方式运行,默认为no会暂用你的终端
timeout 300 #当 客户端闲置多长时间后关闭连接,如果指定为0,表示关闭该功能
dir /data/redisdb #指定数据库持久化数据目录
更多的配置信息说明,请百度“redis配置文件详解”,了解更多的信息
[root@localhost202 redis-2.8.19]# mkdir -p /data/redisdb #创建redis数据存放目录
6、运行/开启Redis
[root@localhost202 redis-2.8.19]# /usr/local/redis/bin/redis-server
这里会输出一些信息,会教你怎样配置一些重要的配置,请看这篇文章:
http://www.cnblogs.com/whendream/p/4228885.html
7、进入Redis客户端,进行简单的操作体验
[root@localhost202 redis-2.8.19]# /usr/local/redis/bin/redis-cli
127.0.0.1:6379> set name tomener
OK
127.0.0.1:6379> get name
"tomener"
~~小插曲,刚开是安装的时候,把安装目录名称写错了,写成了/usr/local/reids 本来应该是redis,怎么办呢,先关闭Redis,看第8步,然后再make PREFIX=/usr/local/redis install一次,完了之后把,之前的reids目录删除了, rm -rf /usr/local/reids,再配置一次配置文件就ok了。
8、关闭Redis
[root@localhost202 redis-2.8.19]# /usr/local/redis/bin/redis-cli shutdown
CentOS编译安装Redis完毕~~
9、加入服务,并开机自启动
[root@localhost202 redis-2.8.19]# vim /etc/init.d/redis
加入如下脚本,新浪博客不好贴出来,我就贴到我们的cnblogs供大家使用
http://www.cnblogs.com/whendream/p/4228768.html
把里面的代码复制到redis里面
[root@localhost202 redis-2.8.19]# chmod 0755 /etc/init.d/redis
测试一下
[root@localhost202 redis-2.8.19]# /etc/init.d/redis start
加入Linux服务
[root@localhost202 redis-2.8.19]# chkconfig --add redis
设置开机自启动
[root@localhost202 redis-2.8.19]# chkconfig --level 235 redis on
加入服务之后我们就可以用熟悉的命令来开启、关闭、重启redis了
[root@localhost202 redis-2.8.19]# service redis start|stop|restart
Redis安装、配置、启动、服务的介绍到此就介绍了~~
- CentOS6.5安装Redis2.8.19
- Centos6.5 安装Redis2.6.16
- CentOS6.5安装Redis2.8.19 和php redis扩展
- CentOS6.5安装Redis2.8.19 和php redis扩展
- CentOS6.5下安装Redis2.8.7
- CentOS6.5下安装Redis2.8.6和phpredis2.2.4扩展
- redis2.8.19安装
- CentOS6.5下的Redis2.8.6和phpredis2.2.4扩展的安装过程详解
- redis2.6.4 在centos6.4上的安装
- CentOS6.2(X86-64)安装配置Redis2.8.9
- redis2.6.4 在centos6.4上的安装
- redis2.6.4 在centos6.4上的安装
- centos5.5 编译安装 redis2.2.11
- CentOS6.1+Nginx1.1.12+PHP5.3.9+Redis2.4.5+Memcache及相关扩展安装脚本
- Redis2.6在Centos6.2下安装与java客户端测试
- Linux安装Redis2.8.3
- 安装redis2.8.3
- Redis2.8.13安装配置
- SpringMvc下载excel文件
- C#里边的控件缩写大全
- js事件驱动
- HDU 1754 I Hate It 线段树 最大值 点更新
- 椭圆拟合算法总结
- CentOS6.5安装Redis2.8.19
- 配置LVM(逻辑卷管理)
- POJ 2251:Dungeon Master
- hdu 5335 Walk Out
- JS闭包理解
- 搭建高可用MongoDB集群 副本
- MySQL数据库中删除重复记录的方法总结(转载)
- HDU 5335 - Walk Out (DFS + 贪心)
- 常用博客地址搬家