ElasticSearch Couchbase Replication Issue - elasticsearch

I have a problem with my ElasticSearch cluster in Couchbase XDCR configuration.
I put private ip 10.28.0.21 as IP ( my elasticsearch and couchbase in the same server) when creating cluster reference. Then the system change that by public IP (92.222..) of my server. It is very strange. I don't know why?
Couchbase logs show :
Updated remote cluster 'ElasticSearch' hostname to "92.222..:9091" because old one
("10.28.0.21:9091") is not part of the cluster anymore
Thanks for any suggestions.

Couchbase uses the IP that ElasticSearch returns as its host address. If you want ElasticSearch to publish the private IP instead of the public, you can override it with the network.publish_host setting in elasticsearch.yml. If the private IP isn't static, you might have to set it to the IP of a particular network interface, such as _eth0_. Take a look here for more details: https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html

Related

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

Access specific port run by services using elastic ip

I have windows server 2008 R2 running in AWS (with Elastic IP)where i am running Apache service to host one of website which i can easily access using various method like
Like "localhost:port" works fine
Using server NIC ip address:port works fine.
In my current use case where i want to expose this website on my elastic IP i am not able to do so.
However if i host any website on my IIS i can access or view using my elastic IP but i am unable to host apache website on IIS.
Whenever i try to access apache one it never worked.
I tweaked firewall setting
I also updated conf file of apache whenever i try to give elastic IP address it will not start.
Failed with following error message
The Apache service named reported the following error:
>>> (OS 10049)The requested address is not valid in its context. : make_sock: could not bind to address 52.xx.xx.xx:8888
Following is my service details of apache on services.msc
C:\Program Files (x86)\vcollapp\apache\bin\Apache.exe -k runservice
Now how can i expose my site which is running on apache service inside windows to elastic ip of AWS.
Thanks in Advance for your help and time.
Try binding to 0.0.0.0? This will accept connections from all interfaces, not just localhost.
If you check your network interfaces, do you see an interface with the Elastic IP? Or do you just have your Private IP?
There are different ways of using Elastic IP's, and my assumption here is that the IP is not physically attached to your machine, but instead, you have a private IP that all traffic from the Elastic IP is routed through.
WAN -> Elastic -> Private

Difference in telnet of amazon ec2 instance using internal and public IP

I have a 4 node hadoop cluster on ec2. We have configured Hortonworks Hadoop (HDP version 2.4) through Ambari.
I have opened all traffic for our all four instances internally and the office external IP.
Whenever I do telnet within the cluster using internal IP:
telnet <internal_ip> 2181
It is able to connect to the specific port I have my service(zookeeper) running on.
When I use public IP of the same instance(Elastic IP) instead of internal IP, I am not able to telnet either within the cluster or from my office IP:
telnet <elastic_ip> 2181
I have already configured security group to allow all traffic. I am using Ubuntu 14.04. We are not using any other firewall except AWS security group.
Please suggest how can I connect using Elastic IP/Public IP of my instance on this port.
Please find the screenshot of Security Group of EC2:
Do you use the default VPC ?
If not, check if the VPC has an Internet Gateway, the Route table (you need a route to the Internet Gateway) and the Networks ACLs.
The Route table and Network ACLs are applied to a subnet.
The default VPC is configured to allow outside traffic, not a new VPC.
Or, the Elastic IP is linked to the same network interface ? The Elastic IP is linked to a network interface of an instance.
EDIT: you can take a look on AWS doc for a better explanation:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html

Elasticsearch on EC2

I've spent some time now looking for information regarding elasticsearch.yml configurations that make my single instance Elasticsearch (on Windows 2012 Server EC2) accessible via public ip, but everytime I uncomment one or both of following settings the only thing that changes is, calling the private ip as well results in an error.
network.publish_host: <public ip>
network.bind_host: <private ip>
Is this correct and are there any other settings that have to be defined? Shouldn't it run with the default values?
This is more of a general answer as to how networking works within EC2 instead of a specific answer to your question. But it should help inform how to configure your application.
EC2 has 1:1 NAT between a public and private IP address. Because of this, only the private IP address is visible to the instance directly.
If you are binding a service to a network interface, it would be the one with the private IP.
Some services do require knowledge of the external IP address in order to function properly. The only one I have run into is FTP in a passive configuration, likely due to the fact that it needs to open a separate socket for data transfer.
In the case of elastic search, it appears that they have a special plugin that will help configure elastic search for the aws environment: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-network.html
I had the same problem.
Installed only one instance of ES on aws EC2 and wanted to grant it public access.
On ubuntu 16.04 this is what works for me:
in /etc/elasticsearch/elasticsearch.yml add this line:
network.host: <ec2 instance private ip>
The private ip should be something like 172.x.x.x
Also do not forget allow access in security group in your aws console for port 9200 (default) and ip address from which you will be sending requests.
So difference was setting not public but private ip address from aws console..
Also note that this can be dangerous as there is not any user/password or other access control

Access EC2 port 9200 from external service

I'm struggling to get EC2 and ElasticSearch up and running. Specifically I'm trying to reach my node from outside Amazon's cloud for verification purposes. I've set up the security group so that I have a "Custom TCP" rule on port 9200 and ElasticSearch is listening on that port, which I can see with netstat -l. When I curl -XGET https://localhost:9200 I get the response expected from ElasticSearch. When I curl -XGET https://publicIP:9200 from WITHIN Amazon (ie. another node that I have running) I get the response expected from ElasticSearch. When I try to do the same request from my desktop I get "no response". I can not, for the life of me, figure out why this is happening.
There are several things to check:
Accessing the public URL of an instance from inside the amazon cloud will map to its private IP. In you test above, where you specify publicIP, did you use the public IP or public domain name? Make sure to test with the IP, not the domain name.
If access to the public IP works from the same machine, try the same thing from another EC2 instance.
Finally, you may have a firewall rule on your desktop, or your work network, preventing outgoing access on port 9200.
If you are running Elasticsearch as a service, then go to /etc/elasticsearch/elasticsearch.yml and make the
network.host: "0.0.0.0"
This solution worked for me.

Resources