CentOS 下 Redis 安装
2012-09-03 00:00
190 查看
确定测试环境和软件版本
Linux : centOS-6.2
Nginx : nginx-1.2.0
MySQL : mysql-5.5.3
PHP : php-5.3.8
Redis : Redis 2.4.11
获取 redis
创建目录存放源码包
Linux : centOS-6.2
Nginx : nginx-1.2.0
MySQL : mysql-5.5.3
PHP : php-5.3.8
Redis : Redis 2.4.11
获取 redis
创建目录存放源码包
mkdir -p /data0/software cd /data0/software
wget http://redis.googlecode.com/files/redis-2.4.11.tar.gz[/code]
注:需要更多版本的 Redis,移步:http://code.google.com/p/redis/downloads/list
编译安装 redistar zxvf redis-2.4.11.tar.gz mv redis-2.4.11 /usr/local/webserver/redis cd /usr/local/webserver/redis make && make install
redis 可执行文件
安装成功后,自动复制 redis 可执行文件到环境变量中
redis-cli:客户端程序
redis-server:服务程序
redis-check-dump:本地数据库检查
redis-check-aof:更新日志检查
redis-benchmark:性能测试,用以模拟同时由N个客户端发送 M 个 SETs/GETs 查询 (类似于 Apache 的 ab 工具)
redis 启动
启动服务redis-server redis.conf
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.
[解决办法]:键入 sysctl vm.overcommit_memory=1
该文件指定了内核针对内存分配的策略,其值可以是0、1、2。
0,表示内核将检查是否有足够的可用内存供应用进程使用;如果有足够的可用内存,内存申请允许;否则,内存申请失败,并把错误返回给应用进程。
1,表示内核允许分配所有的物理内存,而不管当前的内存状态如何。
2,表示内核允许分配超过所有物理内存和交换空间总和的内存
Warning: 32 bit instance detected but no memory limit set. Setting 3.5 GB maxmemory limit with 'noeviction' policy now.
[解决办法]:修改配置文件 redis.conf,将 maxmemory 设置为 maxmemory 1024000000 #分配256M内存
关闭服务redis-cli shutdown
redis 基础配置
redis 各式文档
Redis 命令参考(中文):http://redis.readthedocs.org/en/latest/index.html
Redis 命令参考(英文):http://redis.io/commands
相关文章推荐
- centos安装redis
- CentOS 7下安装Redis和MongoDB(2016.4.13)
- centos7 安装redis并开机启动
- CentOS中,安装Apache+PHP+Mongo DB+Redis DB
- CentOS 6.4下安装Nginx+MYSQL+Lua+Redis(上)
- centos 7 yum命令安装 Nginx、PHP 7、MySQL 57 、redis
- linux(centos6.6) 下安装,配置redis, 及开机自启动
- CentOS系统安装Redis及Redis的PHP扩展详解
- centos手动编译安装apache、php、mysql、redis扩展
- Redis的安装(Centos)(转)
- CentOS6.5下Redis安装与配置
- 在centos6.4上安装redis3.0
- centOS上安装redis
- centOS安装redis和tomcat
- Linux(CentOS 5.5) Redis 安装及RedisPHP拓展安装应用
- centos安装redis集群
- centos 安装 redis3.0.0 集群
- Centos环境下Redis的安装
- CentOS安装Redis记录
- CentOS 7 上安装 Redis3.2.3 并开启外网访问(亲测好用,转)