I have 2 environments - dev and qa, both hosted on two different virtual machines in Azure. The dev environment works fine, and the qa is not. Here are the details:
Elasticsearch version: 2.3.4 in dev, 2.4.4 in qa.
Kibana version: 4.5.4, in both environments.
Kibana yml configuration: server.host: "0.0.0.0", in both environments
Elasticsearch yml configuration: network.host: 0.0.0.0, in both environments
This is my test code in node js that I ran from my office pc:
var elasticsearch = require('elasticsearch');
var elasticClient = new elasticsearch.Client({
hosts: [ 'http://my-qa-ip:80/' ],
log: 'trace',
requestTimeout: 1200000,
});
elasticClient.search({
index: 'my_apps',
type: 'owner',
size: 100,
body: {
'query': {
'filtered': {
'filter': {
'bool': {
'must': [
{ 'term': {
'ownerUsername': 'myapp'
}
}
]
}
}
}
}
}
}, function (err, resp) {
console.log(JSON.stringify(err, null, 4));
console.log(JSON.stringify(resp, null, 4));
});
The error returned was this:
{
"statusCode": 400,
"error": "Bad Request",
"message": "Missing kbn-version header"
}
So I tried to add the header but it didn't work:
var elasticClient = new elasticsearch.Client({
hosts: [ 'http://my-qa-ip:80/' ],
log: 'trace',
requestTimeout: 1200000,
headers: {
'kbn-version': '4.5.4'
}
});
I don't understand why I don't get the same error in the dev environment and what should I do to fix it. Another question that I have is why I can ping the my-qa-ip
above only in port 80, and not in port 9200 as I do with the dev environment. Both virtual machines have a security rule that says they can accept connections on all port from my office where I ran this test.
Thanks.