Elasticsearch上的“打开文件太多”(“Too many open files” on Elasticsearch)
我有一个集群ES,从2天前我有这个错误:
[2016-03-14 15:08:48,342][WARN ][cluster.action.shard] [node-01] [logstash-2016.03.14][2] received shard failed for [logstash-2016.03.14][2], node[72oHnFiXTVqgXaUYKTAu2Q], [P], s[INITIALIZING], indexUUID [AKybrAEZRXebyRxcmzTqJQ], reason [Failed to start shard, message [IndexShardGatewayRecoveryException[[logstash-2016.03.14][2] failed recovery]; nested: EngineCreationFailureException[[logstash-2016.03.14][2] failed to open reader on writer]; nested: FileSystemException[/var/lib/elasticsearch/elasticsearch/nodes/0/indices/logstash-2016.03.14/2/index/_lg_Lucene410_0.dvm: Too many open files]; ]]
如果我运行
curl -XGET 'http://localhost:9200/_nodes?os=true&process=true&pretty=true' | grep "max_file_descriptors"
curl -XGET 'http://localhost:9200/_nodes?os=true&process=true&pretty=true' | grep "max_file_descriptors"
我有这个输出:"max_file_descriptors" : 65535, "max_file_descriptors" : 65535,
到文件/etc/security/limit.conf我已经有:
elasticsearch - nofile 65535 elasticsearch - memlock unlimited
如果我检查索引的状态我有一些索引RED ....因此logstash出错并崩溃所有
i have a cluster ES and from 2 days ago i have this error:
[2016-03-14 15:08:48,342][WARN ][cluster.action.shard] [node-01] [logstash-2016.03.14][2] received shard failed for [logstash-2016.03.14][2], node[72oHnFiXTVqgXaUYKTAu2Q], [P], s[INITIALIZING], indexUUID [AKybrAEZRXebyRxcmzTqJQ], reason [Failed to start shard, message [IndexShardGatewayRecoveryException[[logstash-2016.03.14][2] failed recovery]; nested: EngineCreationFailureException[[logstash-2016.03.14][2] failed to open reader on writer]; nested: FileSystemException[/var/lib/elasticsearch/elasticsearch/nodes/0/indices/logstash-2016.03.14/2/index/_lg_Lucene410_0.dvm: Too many open files]; ]]
If i run
curl -XGET 'http://localhost:9200/_nodes?os=true&process=true&pretty=true' | grep "max_file_descriptors"
i have this output:"max_file_descriptors" : 65535, "max_file_descriptors" : 65535,
To the file /etc/security/limit.conf i already have:
elasticsearch - nofile 65535 elasticsearch - memlock unlimited
If i check the status of index i have some index RED....consequently logstash goes wrong and crashes all
原文:https://stackoverflow.com/questions/35990055
最满意答案
垂直或水平绘制并添加0.5(jsfiddle.net/xr5az/2/) - 您将只获得黑白颜色。 (注意我隐藏线的开头和结尾,它会是灰色的...)
ctx.moveTo(-2,5.5); ctx.lineTo(17,5.5); ctx.stroke();
当你添加角度时,系统会添加额外的灰色像素,没有它,线看起来会很糟糕。
- 如果您只想从黑色获取线条,请在线条起点和终点之间绘制许多单独的像素(如果想要线宽> 1则绘制正方形)。
ps对不起破碎的小提琴链接,系统踢了我的消息,即使代码包括10次......
draw vertically or horizontally and add 0.5 (jsfiddle.net/xr5az/2/) - you will get only black and white colours. (note that i hided line begin and end, it would be grey ...)
ctx.moveTo(-2, 5.5); ctx.lineTo(17, 5.5); ctx.stroke();
when you add angle, system adds extra grey colors pixels, without it, line would look bad.
- if you want to get line only from black color, draw many separate pixels (or squares if you want lineWidth > 1) between line start and end points.
p.s. sorry for broken fiddle link, system kicked my message even with code included like 10 times ...
相关问答
更多-
在画布上绘制渐变线(Draw a line with gradient in canvas)[2022-11-29]
使用2D画布API自定义线条渲染 没有简单的方法来创建你想要的类型的行,而不会牺牲很多质量。 为了获得最佳质量,您需要将线条渲染为一组垂直于线条并沿着线条长度的小条。 为每个部分计算宽度和颜色,然后渲染该条。 以下图片将有助于解释我的意思。 中间的线是定义曲线。 外线显示宽度变化。 标记为A的部分是单条(放大) 您将线划分为相同的小部分,对于线上的每个点,您需要找到线上的位置以及垂直于线上该点的矢量。 然后,您可以找到距离正确距离的点上方和下方的点,以使宽度成为该点的线。 然后以正确的颜色绘制每个条。 问题 ... -
垂直或水平绘制并添加0.5(jsfiddle.net/xr5az/2/) - 您将只获得黑白颜色。 (注意我隐藏线的开头和结尾,它会是灰色的...) ctx.moveTo(-2,5.5); ctx.lineTo(17,5.5); ctx.stroke(); 当你添加角度时,系统会添加额外的灰色像素,没有它,线看起来会很糟糕。 如果您只想从黑色获取线条,请在线条起点和终点之间绘制许多单独的像素(如果想要线宽> 1则绘制正方形)。 ps对不起破碎的小提琴链接,系统踢了我的消息,即使代码包括10次...... d ...
-
我能够找出问题我自己..如果有人将来需要它我发布修复..我做了一个c.moveTo到以前的X,Y值..并且pblm是固定的.. i was able to figure out the issue my self.. I'm posting the fix if anybody needs it in future.. I made a c.moveTo to previous X, Y values.. and the pblm is fixed..
-
HTML Canvas中的渐变(Gradient in HTML Canvas)[2022-09-28]
如果要使用一个渐变来绘制多个矩形,则必须使用标准化渐变(== [0,1]中的坐标),然后以标准化方式绘制矩形。 Expl: var grd = ctx.createLinearGradient(0, 0, 1.0, 0); grd.addColorStop(0,"black"); grd.addColorStop(1,"red"); 然后绘制矩形: function drawNormalizedRect(context, x,y,w,h) { context.save(); context.t ... -
除了上一个答案,要获得点击像素的颜色,您需要获得鼠标的x和y : var canvas = document.querySelector('#example') var ctx = canvas.getContext('2d'); var gradient = ctx.createLinearGradient(0, 0, 300, -300); gradient.addColorStop(0, 'rgba(179, 63, 19, 1)'); gradient.addColorStop(8 / ...
-
这是一个函数,它应该完成梯度线绘制 function drawgradientline(x,y,height){ var grd = context.createLinearGradient(x, y, 1, height); grd.addColorStop(0, '#12a6eb'); grd.addColorStop(1, '#ebc711'); context.fillStyle = grd; context.fill(); } Here is ...
-
柔软的边缘html5帆布(soft edges html5 canvas)[2022-01-29]
你得到这种效果的原因是因为你在鼠标按下时开始一个新的路径,然后在每个鼠标上移动你向路径添加一个新点,然后绘制路径。 这意味着您一次又一次地重绘路径的相同部分,这会将半透明像素加在一起,从而破坏柔软度。 我建议只使用渐变圆作为“画笔”。 这是一个修改过的jsfiddle: http : //jsfiddle.net/yB3Kr/ 对绘制函数进行了主要更改: function draw(x,y,w,r,g,b,a){ var gradient = ctx.createRadialGradient(x, ... -
稍微搜索一下,我从Mozilla Development Network找到了这个例子 function draw() { var ctx = document.getElementById('canvas').getContext('2d'); var radgrad = ctx.createRadialGradient(0,0,1,0,0,150); radgrad.addColorStop(0, '#A7D30C'); radgrad.addColorStop(1, ...
-
画布删除线性渐变(Canvas remove linear gradient)[2022-08-19]
是的,您可以重复使用一次创建的CanvasGradient, var ctx = c.getContext("2d"); var grads = []; for(var i=0; i<20; i++){ grads.push(ctx.createLinearGradient(0,0,300,0)); } grads.forEach(function(grad, i){ var a = i * (360 / 20); grad.addColorStop(0, 'hsl(' + a + ... -
代码中需要进行一些小的更改。 在选择颜色值时,您使用以下行, var color_select = document.getElementById('selectedColor'); 基本上它将返回HTMLElementObject而不是颜色。 要从html元素获取颜色,您需要检索该元素的值。 使用, var color_select = document.getElementById('selectedColor').value; 对所有三个工具使用此颜色检查。 使用下面粘贴的更新代码。 ...