Elastic-search junit-tests failing on Jenkins


(moksha) #1

Hi there,
I have tried to use elastic-search in my project and, am initial stages of it. Although the unit-test cases run locally(built with maven) but, seems to fail when build on Jenkins!

Configuration when running junit-tests:

// create index/mapping
client.admin().indices().create(new CreateIndexRequest(index)
.mapping(type, ElasticsearchTemplate.readFileFromClasspath("some_json_file")));
// load data
client.prepareBulk().add(new IndexRequestBuilder(client).setId(some_id).setIndex(index).setType(type)
.setSource(source_object));
//refresh
client.admin().indices().refresh(new RefreshRequest(index)).actionGet();

Following are the settings used for creating ES-client locally:

Node node = NodeBuilder.nodeBuilder().settings(ImmutableSettings.settingsBuilder().build()).local(true).build().start();
Client client = node.client(); // singleton client object for caller

All settings have been taken as default.

Logs in Jenkins show:

[elasticsearch[Nightside][clusterService#updateTask][T#1]] DEBUG o.e.g.local - [Nightside] [my_index][0]: not allocating, number_of_allocated_shards_found [0], required_number [1]
[elasticsearch[Nightside][clusterService#updateTask][T#1]] DEBUG o.e.g.local - [Nightside] [my_index][3]: not allocating, number_of_allocated_shards_found [0], required_number [1]
[elasticsearch[Nightside][clusterService#updateTask][T#1]] DEBUG o.e.g.local - [Nightside] [my_index][4]: not allocating, number_of_allocated_shards_found [0], required_number [1]
[elasticsearch[Nightside][clusterService#updateTask][T#1]] DEBUG o.e.g.local - [Nightside] [my_index][2]: not allocating, number_of_allocated_shards_found [0], required_number [1]
[elasticsearch[Nightside][clusterService#updateTask][T#1]] DEBUG o.e.g.local - [Nightside] [my_index][1]: not allocating, number_of_allocated_shards_found [0], required_number [1]

Note: This works fine when built locally. Even the transport client works fine.

Can somebody shed some light on this...as to what might be happening here? why shards donot seem to be allocated on jenkins specifically?

Thank you.


(system) #2