How to access ES install on another machine


i have 2 VM my java application install on VM1 and ES instal on VM2.
how java application access the ES which install on Vm2 .
how to specify "index.path"

I don't think I understand the question.

You have 2 nodes? One per VM?
They form a cluster?

You want to connect your Java app to those nodes?

Is it what you meant?

Did you look at the Java client doc?

If I understand you right, your Java application on VM1 will have to do a CURL request to VM2 running Elasticsearch. As the 2 applications are running on 2 different logical servers as virtual machines, they would need to communicate with each other as if they were two physically separate machines.