Redis 安装配置


1、下载:

官方网站:http://www.redis.io/download下载(建议下载稳定版)

2、Redis 介绍:

RedisRemote Dictionary Server的缩写。他本质上一个Key/Value数据库,与Memcached类似的NoSQL型数据库,但是他的数据可以持久化的保存在磁盘上,解决了服务重启后数据不丢失的问题,他的值可以是string(字符串)list(列表)sets(集合)或者是ordered sets(被排序的集合),所有的数据类型都具有push/popadd/remove、执行服务端的并集、交集、两个sets集中的差别等等操作,这些操作都是具有原子性的,Redis还支持各种不同的排序能力。

根目录下:

       redis.conf 默认配置文件

Src目录:

make命令执行完成后,会在src目录下生成5个可执行文件,分别是redis-serverredis-cliredis-benchmarkredis-check-aofredis-check-dump。

3、解压

解压Redistar包很简单:

 tar -zxvf redis-2.4.14.tar.gz

4、编译安装

cd 到解压的目录中

make

5、启动、停止命令

安装完成后进入到 scr目录中

执行命令  redis-server  启动的默认端口是6379

下面是启动后的界面(也可以放到后台启动[root@axwaydemo src]# ./redis-server &)

[root@axwaydemo src]# pwd
/home/redis/redis/src
[root@axwaydemo src]# ./redis-server
[2068] 26 Jun 13:10:20.448 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
[2068] 26 Jun 13:10:20.450 * Increased maximum number of open files to 10032 (it was originally set to 1024).
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 2.8.11 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in stand alone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 2068
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

[2068] 26 Jun 13:10:20.460 # Server started, Redis version 2.8.11
[2068] 26 Jun 13:10:20.460 # 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.
[2068] 26 Jun 13:10:20.467 * DB loaded from disk: 0.002 seconds
[2068] 26 Jun 13:10:20.468 * The server is now ready to accept connections on port 6379


redis-server 命令:

Redis服务器的daemon启动程序

redis-server         启动并加装默认配置文件[/path/to/redis.conf]

redis-server         /biran/conf/redis.conf启动并加装指定配置文件

redis-server - (read config from stdin) 使用标准输入读取配置为启动参数

redis-server --test-memory 256 检测256MB内存

redis-server –version 查版本号


6、Redis 测试

Redis性能测试工具,测试Redis在你的系统及你的配置下的读写性能。

redis的基准信息和性能检测。

redis-benchmark-h localhost -p 6379 -c 100 -n 100000

100个并发连接,100000个请求,检测host为localhost 端口为6379的redis服务器性能




转载于:https://my.oschina.net/it1693/blog/284368

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值