elasticsearch


How do I enable remote access/request in Elasticsearch 2.0?


Starting from v2.0 Elasticsearch is listening only on localhost by default, but I'd like to make request outside localhost.
For example, a request like this is allowed:
http://localhost:9200/
But this is not:
http://server_name:9200/ (from outside of the server, eg: a local computer in the same LAN).
Thanks for your help.
Rename the elasticsearch.yml file to elasticsearch.json inside config folder and add:
{
"network" : {
"host" : "10.0.0.4"
}
}
Another option is to provide the settings externally either using the ES_JAVA_OPTS or as parameters to the elasticsearch command, for example:
$ elasticsearch -Des.network.host=10.0.0.4
Another option is to set es.default. prefix instead of es. prefix, which means the default setting will be used only if not explicitly set in the configuration file.
Another option is to use the ${...} notation within the configuration file which will resolve to an environment setting, for example:
{
"network" : {
"host" : "${ES_NET_HOST}"
}
}
The location of the configuration file can be set externally using a system property:
$ elasticsearch -Des.config=/path/to/config/file
For more info, check out https://www.elastic.co/guide/en/elasticsearch/reference/1.4/setup-configuration.html
In config/elasticsearch.yml put
network.host: 0.0.0.0
As #arsent mentioned add that ip address to the config file:
sudo nano /etc/elasticsearch/elasticsearch.yml
Jay also added an important point - if you're using a firewall, remember to add a rule allowing traffic to that port.
If you want to allow a master server to access ES over http, then add a rule allowing access to only from that particular address. For example, say you are using ufw, then run this command to add your port:
sudo ufw allow from xxx.xxx.xxx.xxx to any port zzzz
Replace xxx.xxx.xxx.xxx with your master server IP address and zzzz with the port you configured in config/elasticsearch.yml
It is recommended to use a custom port and not keep the default 9200
To test it, SSH into your master server and ping the ES ip with the correct port to see if you get a response:
curl -X GET 'http://xxx.xxx.xxx.xxx:zzzz'
You can also verify ES is inaccessible from other IPs by trying it with your browser.
There's an excellent article that shows how to set up ES on Ubuntu on DigitalOcean
In config/elasticsearch.yml, put network.host: 0.0.0.0 as #arsent said.
And also add Inbound Rule in firewall for your ElasticSearch port(9200 ByDefault).
It worked in ElasticSearch version 2.3.0

Related Links

Elasticsearch: Group results of different types in response structure
Storing data in Elasticsearch - OLTP
Elasticsearch + Shield, security_exception happens when Document Level Security is enabled
ElasticSearch Parent/Child Restriction
How to configure kibana for multiple nodes in the same cluster?
Get latest records in elastic search
Put filtered mustache search template on AWS elasticsearch cluster using javascript API
Get Percentage of Values in Elasticsearch
elasticsearch - aggregating counts on array matches
ElasticSearch has_child query does not support query_string
elastic search autocomplete, searching with space creating an issue
(ELK) logstash grok for SBR accounting log
aws cloudsearch/lucene query street names
Getting cardinality of multiple fields?
Aggregating a Key/Value list in ElasticSearch
“reverse cardinality” in elasticsearch?

Categories

HOME
oracle
protocol-buffers
azure-functions
typelite
exchange-server
concurrency
risk-management
out-of-memory
consul
gallery
cypher
tibco
google-search-console
wagtail
telegraf
scheduler
tup
polymer-2.x
clickable-image
yahoo
business-intelligence
android-externalstorage
max-msp-jitter
texas-instruments
susy-sass
codefluent
deepfreeze
adminlte
spring-shell
amazon-mws
gitkraken
backtracking
conda
chronicle-queue
backendless
beego
ibm-connections
javax.persistence
source-insight
actframework
plantuml
listjs
adminer
cmis
cloudera-quickstart-vm
distributed-caching
1wire
contactless-smartcard
transparency
liteide
windows-media-player
return-type
django-static-precompiler
deedle
mobile-angular-ui
degrees
metabase
libharu
deferred-rendering
powerpoint-2013
flipclock
android-expansion-files
flask-security
pack
miniconda
variable-length-array
http.client
dnx50
sqlbase
unhandled
compositetype
darwin
clarion
pass-by-value
global-scope
xml-signature
visual-studio-6
nidaqmx
thruway
gpu-programming
armv6
pbkdf2
visual-c++-2005
hints
node.js-stream
rikulo
mongo-jackson-mapper
android-authenticator
xmlwriter
idispatch
nsmutablestring
workflow-manager-1.x
msinfo32
upshot
downgrade
mysqli-multi-query
motif
activex-exe

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile