redis练习手册<一>redis的介绍和安装
来源:互联网 发布:js正则表达式大全 编辑:程序博客网 时间:2024/06/08 03:41
redis是当前比较热门的NOSQL系统之一,它是一个key-value存储系统。和Memcached类似,但很大程度补偿了memcached的不足,它支持存储的value类型相对更多,包括string、list、set、zset和hash。这些数据类型都支持push/pop、add/remove及取交集并集和差集及更丰富的操作。在此基础上,redis支持各种不同方式的排序。Redis数据都是缓存在计算机内存中,并且会周期性的把更新的数据写入磁盘或者把修改操作写入追加的记录文件。
安装环境:centos
1、下载
执行命令: http://redis.googlecode.com/files/redis-2.6.13.tar.gz
2、解压安装
执行命令:tar -zxvf redis-2.8.3.tar.gz
cd src
make
执行 编译过程中make报错,make[3]: gcc:命令未找到
新安装的虚拟机,无gcc 编译器。安装gcc、g++编译器
执行命令:yum install -y gcc g++ gcc-c++ make
继续执行 make 命令 仍然有错。
原因分析:
在README 有这个一段话。
<span style="white-space:pre"></span>Allocator <span style="white-space:pre"></span>--------- <span style="white-space:pre"></span>Selecting a non-default memory allocator when building Redis is done by setting <span style="white-space:pre"></span>the `MALLOC` environment variable. Redis is compiled and linked against libc <span style="white-space:pre"></span>malloc by default, with the exception of jemalloc being the default on Linux <span style="white-space:pre"></span>systems. This default was picked because jemalloc has proven to have fewer <span style="white-space:pre"></span>fragmentation problems than libc malloc. <span style="white-space:pre"></span>To force compiling against libc malloc, use: <span style="white-space:pre"></span> % make MALLOC=libc <span style="white-space:pre"></span>To compile against jemalloc on Mac OS X systems, use: <span style="white-space:pre"></span> % make MALLOC=jemalloc
说关于分配器allocator, 如果有MALLOC 这个 环境变量, 会有用这个环境变量的 去建立Redis。
而且libc 并不是默认的 分配器, 默认的是 jemalloc, 因为 jemalloc 被证明 有更少的 fragmentation problems 比libc。
但是如果你又没有jemalloc 而只有 libc 当然 make 出错。 所以加这么一个参数。
解决办法
make MALLOC=libc
执行成功
安装完成!
3、启动
可以直接进入src目下 运行 ./redis-server 可直接启动 redis 程序,但是这种模式启动退出xshell时,程序会停止运行。
所有使用 screen 窗口模式启动
安装screen:yum install screen
新建screen
执行命令:screen -R redis
在screen中启动redis
退出窗口 ,查询进程。
第一个为screen 进程
第二个为redis进程
第三个是查看进行命令
启动成功。
4、启动客户端
执行命令:./redis-cli
测试 数据是否正常 输入 输出。
启动成功。
http://zhidao.baidu.com/link?url=LvM0KE2SlhWwuukv0f2xutUH1FJCcNVJPJ0gOEauregIo2PCsXo78EMvPRAxd41CYL2cOcbKKhl2dCiIBCebKq
g++
http://www.phperz.com/article/14/1219/42002.html Redis 2.8.18 安装报错 error: jemalloc/jemalloc.h: No such file or directory解决方法
- redis练习手册<一>redis的介绍和安装
- redis练习手册<三>redis的配置文件redis.conf介绍
- 一.Redis的介绍和安装(Linux环境)
- Redis入门一:redis简单介绍和虚拟机下的安装
- Redis介绍和安装
- redis介绍和安装
- Redis介绍和安装
- Redis介绍和安装
- Redis系列(1)---Redis的介绍和安装
- redis学习之路:redis的介绍和安装
- Redis的安装 一
- redis练习手册<四>Redis 数据类型
- redis练习手册<五>Redis 命令
- redis练习手册<六>Redis安全
- redis练习手册<七>Redis键
- redis练习手册<十三>Redis发布订阅
- 【Redis手册一】常用命令
- redis--5--Redis 的安装配置介绍
- 【cocos2dx】 图片格式的区别 png jpg pvr
- ubuntu 14.04 no valid active connections found
- MySQL中KEY与INDEX的区别
- Vijos 1035 贪婪的送礼者
- Chrome DevTools的使用
- redis练习手册<一>redis的介绍和安装
- springmvc找不到静态资源文件等
- jdk动态代理实现原理
- learn python the hard way(笨办法学python) 练习10
- 将一个文件伪装在另一个文件下
- android学习笔记——BroadcastReceiver实现强制下线
- linux下编译php扩展:php7安装redis为例
- php中curl请求报错:Problem with the SSL CA cert (path? access rights?)
- QTextEdit实现语法高亮-Syntax Highlighter Example例子简单介绍