I'm writing tests that start a elasticsearch 6.4 single-node cluster to ensure that my queries behave as expected. It takes about 10 seconds for the cluster to start an my tests RestHighLevelClient to ping it without a connection error
Process proc = new ProcessBuilder("elasticsearch").start();
RestHighLevelClient client = new RestHighLevelClient(RestClient.builder(
new HttpHost('localhost', 9200, 'http'),
new HttpHost('localhost', 9201, 'http'),
));
// wait for cluster, takes about 10 seconds in practice.
do {
try {
client.ping(RequestOptions.DEFAULT);
break;
} catch (IOException ex) { }
} while (true);
Are there settings I can change to improve startup time?
memory
listed in the 6.4 store types
discovery.type=single-node
in 6.4There's no way so store all indexes into memory. index.store.type: memory
did exist in ES 1.x but disappeared in ES 2.0 a long time ago.
You can disable all logging by modifying te log4j2.properties
file and setting all loggers to OFF (and optionally use a NullAppender)
logger.action.level = OFF
rootLogger.level = OFF
logger.deprecation.level = OFF
logger.index_search_slowlog_rolling.level = OFF
logger.index_indexing_slowlog.level = OFF
logger.xpack_security_audit_logfile.level = OFF
Regarding disabling the discovery, you got it right by setting discovery.type=single-node
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With