首页 \ 问答 \ BLPOP和MISCONF Redis配置为保存RDB快照(BLPOP and MISCONF Redis is configured to save RDB snapshots)

BLPOP和MISCONF Redis配置为保存RDB快照(BLPOP and MISCONF Redis is configured to save RDB snapshots)

我们在ELK堆栈中使用Redis来缓冲我们的系统和Elasticsearch之间的消息。 消息由自定义log4j-appender推送到redis,并由logstash弹出。

现在出现了问题:如果redis队列正在运行(因为例如Elasticsearch没有运行),redis切换到某种模式不再允许持久性更改。 这是有道理的,但是从Redis弹出消息(因为例如ES再次启动)将减少redis中队列的大小。

如果队列已满,是否可以选择配置redis以允许blpop?

最好的问候本杰明


we use Redis in an ELK stack for buffering messages between our systems and Elasticsearch. The messages are pushed into redis by a custom log4j-appender and popped by logstash.

Now there comes the problem: if the redis queue is running full (because e.g Elasticsearch is not running) redis switches to a mode were no persistent changes are allowed anymore. This makes sense, but popping messages from Redis (because e.g. ES is up again) would reduce the size of the queue in redis.

Is there an option to configure redis to allow blpop if the queue is full?

Best regards Benjamin


原文:https://stackoverflow.com/questions/34307670
更新时间:2024-01-23 16:01

最满意答案

它们之间的唯一区别是一个是对象的字符串表示,而第二个是javascript对象。

var json_content = '[{"key":"value"}]';
console.log("json_content"+json_content);

var json_content = [{"key":"value"}];
console.log("json_content"+json_content);

您的代码中还发生的另一件事是您在console.log()语句中使用串联+
对我来说,你应该避免使用这种方式并尝试使用,而是:

var json_content = '[{"key":"value"}]';
console.log("json_content", json_content);

var json_content = [{"key":"value"}];
console.log("json_content", json_content);

对于你的最后评论:

var json_content = '[{"key":"value"}]';
json_content = JSON.parse('[{"key":"value"}]');
console.log("json_content"+json_content);


The only difference between them is that one is a string representation of object while second one is javascript object.

var json_content = '[{"key":"value"}]';
console.log("json_content"+json_content);

var json_content = [{"key":"value"}];
console.log("json_content"+json_content);

One more thing is happening in your code is that you are using concatenation + in your console.log() statements.
To me you should avoid using such way and try with , instead:

var json_content = '[{"key":"value"}]';
console.log("json_content", json_content);

var json_content = [{"key":"value"}];
console.log("json_content", json_content);

For your last comment:

var json_content = '[{"key":"value"}]';
json_content = JSON.parse('[{"key":"value"}]');
console.log("json_content"+json_content);

相关问答

更多
  • 你可以在一行中使用object_hook和object_hook : import json from collections import namedtuple data = '{"name": "John Smith", "hometown": {"name": "New York", "id": 123}}' # Parse JSON into an object with attributes corresponding to dict keys. x = json.loads(data, ob ...
  • 假设你开始 df = pd.read_json("http://api.census.gov/data/2014/acsse/variables.json") 问题是该列是dicts: In [28]: df.variables.head() Out[28]: AIANHH {u'concept': u'Selectable Geographies', u'pred... ANRC {u'concept': u'Selectable Geographies', u'pred... BST ...
  • 首先,对象与json不匹配。 Header对象应包含两个字段,如Liste1和Liste2(可能是相同类型)。 另一方面,这些应包含id,name和companyList字段。 另外,你创建了json吗? Liste1和Liste2可能应该是json中的集合的一部分,在“[]”括号内,然后不是像Liste1和Liste2这样的两个字段,你可以在Header对象中有Collection。 Here the complete solution using GSON: package jsonProcessing ...
  • 您的文件作为JSON文本有效,例如可以通过将内容粘贴到https://jsonlint.com进行验证 将JSON文件“加载”到JavaScript解释器中的一种方法如下。 为了明确起见,假设解释器是v8或js(JavaScript-C)。 首先,复制文件,同时预先添加诸如“x =”的内容,例如 (echo "x="; cat input.json) > input.js 现在,启动v8或js后,运行: load("input.js") 变量x将包含JSON对象。 如果您想修剪键名以便它们没有外部空格,例 ...
  • 首先,尽量不要混用JQuery和AngularJS 。 如果你想获得json文件,而不是JQuery-Ajax使用AngularJS $ http服务,如下所示,并且为了转换成日期对象,你可以使用Date.parse $scope.self = {}; $http.get('data.json').success(function(data) { $scope.self.jsonData = data; $scope.self.jsonData.forEach(function(val ...
  • 通常,修改文件意味着将整个文件读取到内存中,进行更改,然后将整个文件写回文件。 (有些文件格式不需要这样,因为它具有静态大小的布局或其他机制,可以解决整个文件,但JSON不是其中之一。) JSON.net能够以一系列令牌的形式读取和编写JSON流 ,因此应该可以通过使用它来最小化内存占用。 但是,您仍然会将整个文件读入内存,然后将其写回。 由于同时读/写,您需要写入临时文件,然后,一旦完成,将该临时文件移动/重命名到正确的位置。 根据您构建JSON的方式,您可能还需要跟踪您在该结构中的位置。 这可以通过跟踪 ...
  • 使用数据子集,我已将其转换为DF。请注意,您拥有的数据不是json格式的数据。 import pandas as pd import json from collections import defaultdict import re f=open('inv.json') text= f.readlines() RowID=[] result={} for item in text: if item.startswith("###"): RowID=re.findall('\d ...
  • 它们之间的唯一区别是一个是对象的字符串表示,而第二个是javascript对象。 var json_content = '[{"key":"value"}]'; console.log("json_content"+json_content); var json_content = [{"key":"value"}]; console.log("json_content"+json_content); 您的代码中还发生的另一件事是您在console.log()语句中使用串联+ 。 对我来说,你应该 ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。