[root@localhost202 redis-2.8.19]# /usr/local/redis/bin/redis-server >> /data/redis-start.txt   #从定向到文件,方便我们查看,内容如下:

[root@localhost202 redis-2.8.19]# cat /data/redis-start.txt

[]  Jan ::42.506 # Warning: no config file specified, using the default config. In order to specify a config file use /usr/local/redis/bin/redis-server /path/to/redis.conf
[] Jan ::42.508 * Increased maximum number of open files to (it was originally set to ).
[] Jan ::42.509 # Warning: bit instance detected but no memory limit set. Setting GB maxmemory limit with 'noeviction' policy now.
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 2.8. (/) bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in stand alone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port:
| `-._ `._ / _.-' | PID: 6033
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-' [] Jan ::42.511 # Server started, Redis version 2.8.
[] Jan ::42.511 # WARNING overcommit_memory is set to ! 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.
[] Jan ::42.511 # WARNING: The TCP backlog setting of cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of .
[] Jan ::42.511 * DB loaded from disk: 0.000 seconds
[] Jan ::42.511 * The server is now ready to accept connections on port
[ | signal handler] () Received SIGINT scheduling shutdown...
[] Jan ::46.643 # User requested shutdown...
[] Jan ::46.643 * Saving the final RDB snapshot before exiting.
[] Jan ::46.663 * DB saved on disk
[] Jan ::46.663 # Redis is now ready to exit, bye bye...

1、增加配置文件

2、配置maxmemory

3、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.

配置:

  1. 为了防止内存爆满导致系统崩溃,需要设置/etc/redis/*.cnf中的maxmemory
  2. 防止报错,可以调整内存分配策略
    /etc/sysctl.conf 这个是Redis日志中可以看到的建议:
    添加vm.overcommit_memory=1保存,并执行:sysctl vm.overcommit_memory=1使之生效 /proc/sys/vm/overcommit_memory,这个里面就是overcommit_memory值,这个可以被上面的设置更新.
    0, 表示内核将检查是否有足够的可用内存供应用进程使用;如果有足够的可用内存,内存申请允许;否则,内存申请失败,并把错误返回给应用进程。
    1, 表示内核允许分配所有的物理内存,而不管当前的内存状态如何。
    2, 表示内核允许分配超过所有物理内存和交换空间总和的内存

Redis必要的一些配置的更多相关文章

  1. Redis Sentinel集群配置中的一些细节

    今天在配置Redis集群,用作Tomcat集群的缓存共享.关于Redis集群的配置网上有很多文章,这里只是记录一下我在配置过程中遇到的一些小的细节问题. 1. 关于Protected Mode的问题 ...

  2. [Linux]Linux下redis的安装及配置.

    在上一篇[Linux] linux下安装配置 zookeeper/redis/solr/tomcat/IK分词器 详细实例. 我们已经将redis所需tar包拷贝到了linux下的root 根目录下, ...

  3. Redis安装及主从配置(转)

    一.何为Redis redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符串).list(链表).set(集合)和zset(有 ...

  4. Redis集群的配置

    [转]Redis集群的配置 一:memcache 和 Redis 对比总结 [memecache 特点] 1:速度最快(没有自测,但网上有详细的测试用例) 2:支持水平扩展,可以任意添加节点 [red ...

  5. redis安装与基本配置

    获取下载包 wget http://download.redis.io/releases/redis-2.8.24.tar.gz 解压和编译 tar -zxvf redis-2.8.24.tar.gz ...

  6. Redis安装及主从配置

    一.何为Redis redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符串).list(链表).set(集合)和zset(有 ...

  7. redis的简单安装配置

    一.简介 Redis是一种高级key-value数据库,数据可以持久化,支持的数据类型很丰富,有字符串,哈希,链表,集合和有序集合5种数据类型 Redis支持在服务器端计算集合的并,交和补集(diff ...

  8. redis的单实例配置+web链接redis

    [root@cache01 src]# wget http://download.redis.io/redis-stable.tar.gz [root@cache01 src]# tar -xzvf ...

  9. Redis安装及基本配置

    一.Redis介绍 1.Redis是一个key-value存储系统 2.官方站点http://redis.io 3.Redis和Memcached类似,但支持数据持久化 4.支持更多value类型,除 ...

  10. Redis的安装、配置 --转载

    原文地址:http://blog.sina.com.cn/s/blog_505bf9af0101ehhp.html redis的安装.配置 安装步骤如下:下载redis安装包:$ cd /opt/ap ...

随机推荐

  1. Educational Codeforces Round 11 C. Hard Process 前缀和+二分

    题目链接: http://codeforces.com/contest/660/problem/C 题意: 将最多k个0变成1,使得连续的1的个数最大 题解: 二分连续的1的个数x.用前缀和判断区间[ ...

  2. ts 使用Visual Studio2012和TFS网站管理源代码

        所需工具 Visual Studio 2012 http://tfs.visualstudio.com/ 微软网站 微软账号  hotmail 或live都行 达到目的 适合于个人项目,多用户 ...

  3. isEmpty()与equals()、==“”区别

    isEmpty方法源码:public static boolean isEmpty(String str) { return (str == null) || (str.length() == 0); ...

  4. hlsl 的tex函数

    texCUBE http://msdn.microsoft.com/en-us/library/windows/desktop/bb509687(v=vs.85).aspx

  5. 【AutoMapper】实体类间自动实现映射关系,及其转换。

    官方项目下载: http://automapper.codeplex.com/ 博文 http://www.iteye.com/blogs/tag/AutoMapper 图解: 第一步:创建映射Map ...

  6. uva 10158

    并查集 #include <cstdio> #include <cstdlib> #include <cmath> #include <map> #in ...

  7. jQuery1.9.1源码分析--Ajax模块

    //Serialize an array of form elements or a set of //key/values into a query string // 将数组形式的表单元素或者哈希 ...

  8. java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@450b2f48 异常处理

    晕死的错误,改了半天也没想到是这样的原因,基础正要呀... 先看一下警告信息: 07-07 08:32:19.540: WARN/WindowManager(74): Failed looking u ...

  9. spring测试父类,使用junit-4.4.jar,spring-test.jar

    @ContextConfiguration(locations = "classpath:conf/applicationContext.xml") @RunWith(Spring ...

  10. NGINX的奇淫技巧 —— 6. IF实现数学比较功能 (1)

    NGINX的奇淫技巧 —— 6. IF实现数学比较功能 (1) ARGUS 1月13日 发布 推荐 0 推荐 收藏 3 收藏,839 浏览 nginx的if支持=.!= 逻辑比较, 但不支持if中 & ...