Removed explicit setting of number_of_replicas when creating the kibana index. This allows Elasticsearch index templates and default index settings to control this value.

This commit is contained in:
Dan Grabowski 2015-05-19 23:59:52 -04:00
parent 05baf24ec9
commit b3ca9c6967
2 changed files with 34 additions and 2 deletions

View file

@ -9,8 +9,7 @@ define(function (require) {
index: configFile.kibana_index,
body: {
settings: {
number_of_shards : 1,
number_of_replicas: 1
number_of_shards : 1
}
}
})

View file

@ -0,0 +1,33 @@
define(function (require) {
describe('Setup: Create Kibana Index', function () {
var sinon = require('test_utils/auto_release_sinon');
require('test_utils/no_digest_promises').activateForSuite();
var createKibanaIndex;
var es;
var Promise;
beforeEach(module('kibana'));
beforeEach(inject(function (Private, $injector) {
createKibanaIndex = Private(require('components/setup/steps/create_kibana_index'));
es = $injector.get('es');
Promise = $injector.get('Promise');
}));
it('sets number of shards for kibana index to 1', function () {
var es_indices_stub = sinon.stub(es.indices, 'create').returns(Promise.resolve({}));
createKibanaIndex();
expect(es_indices_stub.calledOnce).to.be(true);
expect(es_indices_stub.firstCall.args[0].body.settings.number_of_shards).to.be(1);
});
it('does not set number of replicas for kibana index', function () {
var es_indices_stub = sinon.stub(es.indices, 'create').returns(Promise.resolve({}));
createKibanaIndex();
expect(es_indices_stub.calledOnce).to.be(true);
expect(es_indices_stub.firstCall.args[0].body.settings).to.not.have.property('number_of_replicas');
});
});
});