- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将数据批量插入到具有 3 个数据节点的 4 节点 Elasticsearch 集群中。
数据节点规范:16 个 CPU - 7GB 内存 - 500GB SSD
数据被插入到非数据节点上并拆分成 5 个分片并设置为具有 1 个副本。大约有 250GB 的数据要插入。
然而,在每个节点上插入约 40GB 的数据并处理一小时后,同时在整个时间跨度内最大使用 CPU 约 60% 和 RAM 约 30% 后,一些分片进入初始化状态:
~$ curl -XGET 'http://localhost:9200/_cluster/health/osm?level=shards&pretty=true'
{
"cluster_name" : "elastic_osm",
"status" : "yellow",
"timed_out" : false,
"number_of_nodes" : 4,
"number_of_data_nodes" : 3,
"active_primary_shards" : 5,
"active_shards" : 9,
"relocating_shards" : 1,
"initializing_shards" : 1,
"unassigned_shards" : 0,
"delayed_unassigned_shards" : 0,
"number_of_pending_tasks" : 0,
"number_of_in_flight_fetch" : 0,
"indices" : {
"osm" : {
"status" : "yellow",
"number_of_shards" : 5,
"number_of_replicas" : 1,
"active_primary_shards" : 5,
"active_shards" : 9,
"relocating_shards" : 1,
"initializing_shards" : 1,
"unassigned_shards" : 0,
"shards" : {
"0" : {
"status" : "yellow",
"primary_active" : true,
"active_shards" : 1,
"relocating_shards" : 0,
"initializing_shards" : 1,
"unassigned_shards" : 0
},
"1" : {
"status" : "green",
"primary_active" : true,
"active_shards" : 2,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 0
},
"2" : {
"status" : "green",
"primary_active" : true,
"active_shards" : 2,
"relocating_shards" : 1,
"initializing_shards" : 0,
"unassigned_shards" : 0
},
"3" : {
"status" : "green",
"primary_active" : true,
"active_shards" : 2,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 0
},
"4" : {
"status" : "green",
"primary_active" : true,
"active_shards" : 2,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 0
}
}
}
}
}
再深入一点,我发现有一个节点的堆空间有问题:
~$ curl -XGET 'localhost:9200/osm/_search_shards?pretty=true'
{
"nodes" : {
"1DpvDUf7SKywJrBgQqs9eg" : {
"name" : "elastic-osm-node-1",
"transport_address" : "inet[/xxx.xxx.x.x:xxxx]",
"attributes" : {
"master" : "true"
}
},
"FiBYw-v_QfO3nJQfHflf_w" : {
"name" : "elastic-osm-node-3",
"transport_address" : "inet[/xxx.xxx.x.x:x]",
"attributes" : {
"master" : "true"
}
},
"ibpt8lGiS6yDJf4e09RN9Q" : {
"name" : "elastic-osm-node-2",
"transport_address" : "inet[/xxx.xxx.x.x:xxxx]",
"attributes" : {
"master" : "true"
}
}
},
"shards" : [ [ {
"state" : "STARTED",
"primary" : true,
"node" : "ibpt8lGiS6yDJf4e09RN9Q",
"relocating_node" : null,
"shard" : 0,
"index" : "osm"
}, {
"state" : "INITIALIZING",
"primary" : false,
"node" : "FiBYw-v_QfO3nJQfHflf_w",
"relocating_node" : null,
"shard" : 0,
"index" : "osm",
"unassigned_info" : {
"reason" : "ALLOCATION_FAILED",
"at" : "2015-10-30T10:42:25.539Z",
"details" : "shard failure [engine failure, reason [already closed by tragic event]][OutOfMemoryError[Java heap space]]"
}
} ], [ {
"state" : "STARTED",
"primary" : true,
"node" : "FiBYw-v_QfO3nJQfHflf_w",
"relocating_node" : null,
"shard" : 1,
"index" : "osm"
}, {
"state" : "STARTED",
"primary" : false,
"node" : "1DpvDUf7SKywJrBgQqs9eg",
"relocating_node" : null,
"shard" : 1,
"index" : "osm"
} ], [ {
"state" : "RELOCATING",
"primary" : false,
"node" : "FiBYw-v_QfO3nJQfHflf_w",
"relocating_node" : "1DpvDUf7SKywJrBgQqs9eg",
"shard" : 2,
"index" : "osm"
}, {
"state" : "STARTED",
"primary" : true,
"node" : "ibpt8lGiS6yDJf4e09RN9Q",
"relocating_node" : null,
"shard" : 2,
"index" : "osm"
}, {
"state" : "INITIALIZING",
"primary" : false,
"node" : "1DpvDUf7SKywJrBgQqs9eg",
"relocating_node" : "FiBYw-v_QfO3nJQfHflf_w",
"shard" : 2,
"index" : "osm"
} ], [ {
"state" : "STARTED",
"primary" : false,
"node" : "FiBYw-v_QfO3nJQfHflf_w",
"relocating_node" : null,
"shard" : 3,
"index" : "osm"
}, {
"state" : "STARTED",
"primary" : true,
"node" : "1DpvDUf7SKywJrBgQqs9eg",
"relocating_node" : null,
"shard" : 3,
"index" : "osm"
} ], [ {
"state" : "STARTED",
"primary" : false,
"node" : "ibpt8lGiS6yDJf4e09RN9Q",
"relocating_node" : null,
"shard" : 4,
"index" : "osm"
}, {
"state" : "STARTED",
"primary" : true,
"node" : "FiBYw-v_QfO3nJQfHflf_w",
"relocating_node" : null,
"shard" : 4,
"index" : "osm"
} ] ]
}
但是服务器上设置的 ES_HEAP_SIZE 是内存的一半:
~$ echo $ES_HEAP_SIZE
7233.0m
而且使用量只有5g:
~$ free -g
total used
Mem: 14 5
如果我再等一会儿,节点就会完全离开集群,所有副本都会进入初始化状态,这会使我的插入失败并停止:
{
"state" : "INITIALIZING",
"primary" : false,
"node" : "ibpt8lGiS6yDJf4e09RN9Q",
"relocating_node" : null,
"shard" : 3,
"index" : "osm",
"unassigned_info" : {
"reason" : "NODE_LEFT",
"at" : "2015-10-30T10:53:32.044Z",
"details" : "node_left[FiBYw-v_QfO3nJQfHflf_w]"
}
Conf :为了加快插入速度,我在数据节点 elasticsearch 配置上使用了这些参数
刷新间隔:-1,threadpool.bulk.size: 16,threadpool.bulk.queue_size: 1000
为什么会这样?我该如何解决这个问题并让我的批量插入成功?对于最大堆大小,我是否需要超过 50% 的 RAM?
编辑:由于调整 elasticsearch 参数不好,我删除了线程池参数并且它工作但非常慢。 Elasticsearch 并非设计用于过快地摄取过多数据。
最佳答案
删除这些设置:
threadpool.bulk.size: 16
threadpool.bulk.queue_size: 1000
这些设置的默认值应该足以避免集群过载。
并确保按照说明 here 正确调整批量索引过程的大小.根据集群/数据,批量需要具有一定的大小。对于那些希望尽可能摄取的人,您不能使用任何您想要的值。每个集群都有局限性,您应该测试自己的集群。
关于elasticsearch - 为什么分片在批量插入期间被初始化和重新定位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33434657/
我是 Spring 新手,这就是我想要做的事情: 我正在使用一个基于 Maven 的库,它有自己的 Spring 上下文和 Autowiring 字段。 它的bean配置文件是src/test/res
我在我的测试脚本中有以下列表初始化: newSequenceCore=["ls", "ns", "*", "cm", "*", "ov", "ov", "ov", "ov", "kd"] (代表要在控
这个问题在这里已经有了答案: 关闭 11 年前。 Possible Duplicate: Class construction with initial values 当我查看 http://en.
我得到了成员变量“objectCount”的限定错误。编译器还返回“ISO C++ 禁止非常量静态成员的类内初始化”。这是主类: #include #include "Tree.h" using n
我有如下所示的a.h class A { public: void doSomething()=0; }; 然后我有如下所示的b.h #include "a.h" class b: publi
我需要解析 Firebase DataSnapshot (一个 JSON 对象)转换成一个数据类,其属性包括 enum 和 list。所以我更喜欢通过传递 DataSnapshot 来手动解析它进入二
我使用 JQuery 一段时间了,我总是使用以下代码来初始化我的 javascript: $(document).ready( function() { // Initalisation logic
这里是 Objective-C 菜鸟。 为什么会这样: NSString *myString = [NSString alloc]; [myString initWithFormat:@"%f", s
我无法让核心数据支持的 NSArrayController 在我的代码中正常工作。下面是我的代码: pageArrayController = [[NSArrayController alloc] i
我对这一切都很陌生,并且无法将其安装到我的后端代码中。它去哪里?在我的页脚下面有我所有的 JS? 比如,这是什么意思: Popup initialization code should be exec
这可能是一个简单的问题,但是嘿,我是初学者。 所以我创建了一个程序来计算一些东西,它目前正在控制台中运行。我决定向其中添加一个用户界面,因此我使用 NetBeans IDE 中的内置功能创建了一个 J
我有 2 个 Controller ,TEST1Controller 和 TEST2Controller 在TEST2Controller中,我有一个initialize()函数设置属性值。 如果我尝
据我所知, dependentObservable 在声明时会进行计算。但如果某些值尚不存在怎么办? 例如: var viewModel ={}; var dependentObservable1 =
我正在阅读 POODR 这本书,它使用旧语法进行默认值初始化。我想用新语法实现相同的功能。 class Gear attr_reader :chainring, :cog, :wheel de
我按照 polymer 教程的说明进行操作: https://www.polymer-project.org/3.0/start/install-3-0 (我跳过了可选部分) 但是,在我执行命令“po
很抱歉问到一个非常新手的Kotlin问题,但是我正在努力理解与构造函数和初始化有关的一些东西。 我有这个类和构造函数: class TestCaseBuilder constructor(
假设我们有一个包含 30 列和 30 行的网格。 生命游戏规则简而言之: 一个小区有八个相邻小区 当一个细胞拥有三个存活的相邻细胞时,该细胞就会存活 如果一个细胞恰好有两个或三个活的相邻细胞,那么它就
我是 MQTT 和 Android 开放附件“AOA” 的新手。在阅读教程时,我意识到,在尝试写入 ByteArrayOutputStream 类型的变量之前,应该写入 0 或 0x00首先到该变量。
我有 2 个 Controller ,TEST1Controller 和 TEST2Controller 在TEST2Controller中,我有一个initialize()函数设置属性值。 如果我尝
我有一个inotify /内核问题。我正在使用“inotify” Python项目进行观察,但是,我的问题仍然是固有的关于inotify内核实现的核心。 Python inotify项目处理递归ino
我是一名优秀的程序员,十分优秀!