use of org.elasticsearch.node.NodeValidationException in project wildfly-camel by wildfly-extras.
the class ElasticsearchServerServlet method init.
@Override
public void init() throws ServletException {
System.setProperty("es.set.netty.runtime.available.processors", "false");
Settings settings = Settings.builder().put("http.port", AvailablePortFinder.getAndStoreNextAvailable("es-port.txt")).put("http.cors.enabled", true).put("http.cors.allow-origin", "*").put("path.data", DATA_PATH).put("path.home", HOME_PATH).build();
List<Class<? extends Plugin>> plugins = new ArrayList<>();
plugins.add(Netty4Plugin.class);
node = new ElasticsearchNode(settings, plugins);
try {
node.start();
} catch (NodeValidationException e) {
throw new ServletException(e);
}
}
use of org.elasticsearch.node.NodeValidationException in project elasticsearch-cluster-runner by codelibs.
the class ElasticsearchClusterRunner method startNode.
/**
* Start a closed node.
*
* @param i the number of nodes
* @return true if the node is started.
*/
public boolean startNode(final int i) {
if (i >= nodeList.size()) {
return false;
}
if (!nodeList.get(i).isClosed()) {
return false;
}
final Node node = new ClusterRunnerNode(envList.get(i), pluginList);
try {
node.start();
nodeList.set(i, node);
return true;
} catch (final NodeValidationException e) {
print(e.getLocalizedMessage());
}
return false;
}
use of org.elasticsearch.node.NodeValidationException in project lobid-resources by hbz.
the class LocBibframeInstances2ElasticsearchTest method setup.
@BeforeClass
public static void setup() {
try {
if (System.getProperty("generateTestData", "false").equals("true")) {
LOG.info("You set generateTestData=true. Thus, first going to remove all test files residing in " + "the test directory. The build will be mostly 'succesful' and you sould check the changes " + "by oing a 'git diff' on your own.");
Files.walk(Paths.get(DIRECTORY_TO_TEST_JSON_FILES)).filter(Files::isRegularFile).map(Path::toFile).forEach(File::delete);
}
} catch (IOException e) {
e.printStackTrace();
}
node = new Node(Settings.builder().put(Node.NODE_NAME_SETTING.getKey(), "testNodeLocNtriples2ElasticsearchLobidTest").put(NetworkModule.TRANSPORT_TYPE_KEY, NetworkModule.LOCAL_TRANSPORT).put(NetworkModule.HTTP_ENABLED.getKey(), //
false).put(Environment.PATH_HOME_SETTING.getKey(), //
"tmp").build());
try {
node.start();
} catch (NodeValidationException e) {
e.printStackTrace();
}
rdfGraphToJsonLd.setContextLocationFilname("web/conf/context-loc.jsonld");
rdfGraphToJsonLd.setRdfTypeToIdentifyRootId("http://id.loc.gov/ontologies/bibframe/Work");
client = node.client();
client.admin().indices().prepareDelete("_all").execute().actionGet();
client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet();
etl(client);
}
use of org.elasticsearch.node.NodeValidationException in project asquare by cognizone.
the class EmbeddedContext method getEmbeddedElastic.
protected EmbeddedElasticsearch7Store getEmbeddedElastic(String uri) {
return embeddedElasticsearch7StoreByOriginalUri.computeIfAbsent(uri, map -> {
File dataFolder = getTemporaryFolder("elastic: " + uri);
EmbeddedElasticsearch7Store embeddedElasticsearch7Store = new EmbeddedElasticsearch7Store(dataFolder);
try {
embeddedElasticsearch7Store.start();
return embeddedElasticsearch7Store;
} catch (NodeValidationException e) {
log.error("Embedded elastic server {} can not be started, {}", uri, e.getLocalizedMessage());
}
return null;
});
}
Aggregations