Spring Data弹性搜索:删除低磁盘水印警告

时间:2017-05-03 07:26:12

标签: java elasticsearch spring-data spring-data-elasticsearch

在运行Spring Data嵌入式弹性搜索时,我会收到持续警告 {foreach from=$aReportSubmissions key=iKey item=aReportSubmission} {$aReportSubmission.event_name|print_r} {/foreach}

通常,在运行单独的ES服务器时,我会通过配置Elastic Search配置文件来消除这些类型的警告。

有没有办法在.properties文件或low disk watermark exceeded Java类中指定一些配置参数来在嵌入式Spring Data ES版本中关闭此警告?

谢谢!

编辑:

ElasticSearchConfiguration.class

@Configuration

2 个答案:

答案 0 :(得分:1)

构建节点时,您可以指定适当的配置设置:

    ImmutableSettings.Builder settingsBuilder = ImmutableSettings.settingsBuilder();

    settingsBuilder.put("node.name", "MyNode");
    settingsBuilder.put("cluster.routing.allocation.disk.threshold_enabled", "false");
    Settings settings = settingsBuilder.build();

    node = NodeBuilder.nodeBuilder()
                      .settings(settings)
                      .clusterName("MyCluster")
                      .local(true).node();

答案 1 :(得分:1)

事实证明,您可以通过在 application.properties 中指定以下参数来执行此操作:

START:
03 05 2017 09:34:54.160:INFO [karma]: Karma v1.6.0 server started at http://0.0.0.0:9876/
03 05 2017 09:34:54.162:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency
03 05 2017 09:34:54.167:INFO [launcher]: Starting browser PhantomJS
03 05 2017 09:34:55.058:INFO [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Connected on socket lYV_7fbawdBMHcp0AAAA with id 4050484
03 05 2017 09:35:05.061:WARN [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Disconnected (1 times), because no message in 10000 ms.
PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
  Disconnected, because no message in 10000 ms.

Finished in 10.005 secs / 0 secs @ 09:35:05 GMT+0200 (CEST)

[09:35:05] 'test' errored after 12 s
[09:35:05] Error: Failed 1 tests.
    at karma.Server.failCount (.../build/tasks/test.js:15:26)
    at removeAllListeners (.../node_modules/karma/lib/server.js:380:7)
    at Server.<anonymous> (.../node_modules/karma/lib/server.js:391:9)
    at Server.g (events.js:286:16)
    at emitNone (events.js:91:20)
    at Server.emit (events.js:185:7)
    at emitCloseNT (net.js:1549:8)
    at _combinedTickCallback (internal/process/next_tick.js:71:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
npm ERR! Test failed.  See above for more details.