Kibana unable to connect to Elasticsearch - elasticsearch

I am having trouble getting Kibana to connect to elasticsearch. The error I get is below;
plugin:elasticsearch#5.6.1 Request Timeout after 3000ms
Elasticsearch has been deployed via kubernetes and runs as a service called monitoring-es with a cluster IP of 100.63.124.194.
In my Kibana.yml file I have set the elasticsearch url as;
elasticsearch.url: "http://100.63.124.194:9200"
However I still get the same error. Is this the correct value or is there something I am missing?
Thanks

Related

Cannot connect LogStash to AWS ElasticSearch "Attempted to resurrect connection to dead ES instance, but got an error"

I am building a setup which consists of AWS ElasticSearch (includes both ElasticSearch and Kibana), LogStash and FileBeat. I have been following this tutorial which explains how to Setup a Logstash Server for Amazon Elasticsearch Service and Auth with IAM.
I am using an Ubuntu 18.04 EC2 m4.large instance to host both LogStash and FileBeat. I have provisioned all of my assets inside a VPC. So far, I have provisioned an AWS ES domain, an Ubuntu 18.04 EC2 and then installed LogStash inside that. Right now, I am ignoring FileBeat and I just want to connect my LogStash service to the AWS ES domain.
As per the tutorial, I have
Created an IAM Access Policy
Created Role logstash-system-es with "ec2.amazonaws.com" as trusted entity
Authorized the Role in my AWS ES domain dashboard
Installed LogStash and configured as specified
(Here I entered the Access Key I am using and its ID into the output section. However, I am not sure how the Role and an Access Key relates to each other)
Started LogStash and tailed the logstash-plain.log file to see the output
When I check the output it appears LogStash cannot connect to the ES domain.The following line starts occurring infinitely. (I have replaced the AWS ES domain name with AWSESDOMAIN).
Attempted to resurrect connection to dead ES instance, but got an
error.
{:url=>"https://vpc-AWSESDOMAIN.us-east-1.es.amazonaws.com:443/",
:error_type=>LogStash::Outputs::AmazonElasticSearch::HttpClient::Pool::BadResponseCodeError,
:error=>"Got response code '403' contacting Elasticsearch at URL
'https://vpc-AWSESDOMAIN.us-east-1.es.amazonaws.com:443/'"}
FYI I have configured my AWS ES domain with Fine Grained Access Control when setting it up.
What seems to be the issue here? Is it regarding Fine Grained Access Control? Security Groups? IAM issue?

Kibana is not responding but cluster is working fine

We are using the Kibana hosted endpoint that comes with Elasticsearch on AWS accessible with a URL like https://*******.us-east-1.es.amazonaws.com/_plugin/kibana/
As of a few days ago, Kibana became unaccessible and Chrome/cURL returns a ERR_TIMED_OUT error.
Telnet shows that the port 443 is timing out:
telnet ******.us-east-1.es.amazonaws.com 443
Trying 10.0.1.238...
telnet: connect to address 10.0.1.238: Operation timed out
Trying 10.0.0.28...
telnet: connect to address 10.0.0.28: Operation timed out
telnet: Unable to connect to remote host
Everything else on the cluster seems to be working fine. Accessing Elastic thru code works and the cluster status is "Status: Green". The "Cluster Health" page on AWS does not show any visible issues.
The only other issue I am aware of is our inability to migrate Elastic from 6.x to 7.x due to this error:
Checking upgrade eligibility - Failed
Cluster has 3082.0 shards per node which exceeds the setting cluster.max_shards_per_node value 1000
According to AWS documentation "The 7.x versions of Elasticsearch have a default setting of no more than 1,000 shards per node" so I am unsure if this is related to our inability to access Kibana or not.
Would anyone know of a good next step to re-gain access to Kibana?

How to Access ElasticSearch From Server?

I am using elastic search in my ubuntu16.04 server. When i am trying to access elasticsearch from browser by using url ip:port/_cat/indices?v. I am getting site can't be reached. After that i am change the network.host value to network.host: 0.0.0.0. After change the network.host ip the search engine not started. How can i access the elasticsearch in my browser.I changed the port also.
Thank you..
There can be many reasons for ES not being reachable. I would start with the obvious and make sure that:
ES is listening on the port: on the ES instance when you run 'curl
ip:port' you should get an answer. if not the service didn't start
well.
make sure there are no firewall rules/security groups that prevent
access from remote network.
make sure network.publish_host is configure correctly:
https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html#advanced-network-settings
more info here: ElasticSearch instance not reachable from outside the server - Azure Windows 2012

Kibana asking for credentials

I set up a Kibana server that is accesing an External ElasticServer Datasource. Nignx is on top, and I access Kibana through it.
On the initial config, I set up the credentials of Kibana using:
sudo htpasswd -c /etc/nginx/htpasswd.users kibanaadmin
Then I was able to access the Kibana Web Console, and see it running. However, the external elasticServer was not configured, so I edited the kibana.yml file to point that external ElasticServer.
elasticsearch.url: "https://bluemix-sandbox-dal-9-portal0.dblayer.com:18671/"
elasticsearch.username: "admin"
elasticsearch.password: "mypass"
When I restarted Kibana, it was able to connect to the elasticsearch server, and in fact it seems that it wrote an entry on the index there.
However, now I am asked for some credentials to get connected to the Kibana Web interface. They are not the kibanaadmin I set up previously, or the ones on elasticsearch database. Which credentials should i use?
Are you sure you're not running Kibana from the wrong ES instance and both Kibana and Nginx are running on the same server. Haven't tried it out personally but then the below links could be handy.
Enabling Kibana Authentication with Nginx
Securing Elasticsearch, Kibana with nginx
Git- Kibana with Nginx Reverse Proxy

'Error Could not contact Elasticsearch at http://localhost:9200.' - kibana

'Error Could not contact Elasticsearch at http://localhost:9200. Please ensure that Elasticsearch is reachable from your system.'
Currently I am following http://packetbeat.com/getstarted
I installed
elastic search - running on localhost:9200 - returns the json,
2.packetbeat - running,
Kibana on port 8000
Now, I change my kibana/config.js file - enter ,
elasticsearch: "http://"localhost":9200",
under elasticsearch.
I get a plain white page with {{dashboard.current.title}} on top.
If I comment out elasticsearch: "http://"localhost":9200",
I get Error Could not contact Elasticsearch at http://localhost:9200. Please ensure that Elasticsearch is reachable from your system.
If I also enter it as elasticsearch: "http://localhost:9200",, I get the same error that it could not contact elasticsearch.
So, I am assuming elasticsearch: "http://"localhost":9200", is right, but it should render something. perhaps a UI
put hostname instead of localhost
for example
http://bilal:9200 (here bilal is my hostname)
if you dont know your hostname goto cmd or terminal type hostname
this works for me..
instead of localhost set your public ip or public dns for
elasticsearch: "http://public_dns:80",
and set the port forwarding from 80 to 9200.
Have Kibana auto-detect the ElasticSearch URL by using
elasticsearch: "http://"+window.location.hostname+":9200",
instead of elasticsearch: "http://"localhost":9200"
Dont change anything, for default elasticsearch is in port 9200:
The Elasticsearch instance to use for all your queries.
elasticsearch.url: "http://localhost:9200"
The problem is that perhaps you must put elasticsearch.url and you only put elasticsearch: "http://localhost:9200".

Resources