How to enable elasticsearch access from remote machines


Elasticsearch is one of the most popular open source search platforms available today.

In this post, we will look at how to enable remote access to elastic. Now, what do I mean by remote access? By remote access, I mean ability to access the elastic api endpoints from machines other than where it is setup.

The default elasticsearch installation is localhost only, you can access it only from the machine where it is setup. While this is okay for POC type development work, for most other use cases we need elasticsearch to be installed on a server somewhere and be able to access it from other machines.

Before we get started with the steps needed to configure elasticsearch installation for remote access, do note that these are applicable only for elastic 7.1.x (maybe even 7.x).

Steps:
  1. Navigate to the folder where elasticsearch is installed. It should look something like this screenshot
  2. Open up the config folder. There should be a elasticsearch.yml file. Open it.
  3. In the Network section, find the entry called network.host. It may be commented out, uncomment it and update it to the hostname of your choice.
  4. If the elastic instance is to be enabled for access from other machines within the corp network, then this host name will be the name of your machine or ip address which is accessible from other devices in the network.
  5. Next find the entry in the same file called node.name. Uncomment if it is commented out. The default value here will be node-1, change it to whatever you want to call your elastic node.
  6. Next find the entry called cluster.initial_master_nodes. Again uncomment it and change the value to the name of the node you setup in previous step.
  7. Now, start elasticsearch
  8. Access it using http://myhostnamehere:9200
Note: When you start elasticsearch, if you are using windows firewall, you may see an alert and get an option to allow or deny network access. You will need to allow this for elasticsearch to work in this configuration.

This should be it! Elasticsearch should now be accessible from other devices within the network.

Do note that by default elastic instance is not secured and exposing it even within the network without some type of authentication is not a good idea. We will look at how to do that in one of the upcoming posts.

References:
https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html#_ipv4_vs_ipv6
https://stackoverflow.com/a/56238134/158589
https://discuss.elastic.co/t/problems-with-access-to-elasticsearch-form-outside-machine/172450


Comments

  1. Cities and states can use legalized playing to assist specific public companies, corresponding to education. The majority of games are slots but have the ability to|you presumably can} select between loads of desk sport 우리카지노 variants as nicely. For instance, lots of|there are many} totally different blackjack tables and about a dozen roulette wheels.

    ReplyDelete

Post a Comment

Popular posts from this blog

Your project does not reference error!

Add co-administrators for your azure subscription