1

I have a project running in the latest Laravel Homestead environment. I would like to make use of Elasticsearch which is running on my local computer where Homestead is installed.

It seems that I can't connect from the Homestead to the Elasticsearch (localhost:9200) because homestead will search on it's own 9200 port.

Any ideas?

Thanks!

2 Answers2

0

Rather then using localhost:9200 use your computer ip in homestead project.

Search your local pc ip,

if window : ipconfig /all

mac or linux : ifconfig

You will find : inet 192.168.1.151

Then use example : 192.168.1.151:9200 as elasticsearch port in your homestead or if localhost:9200 not working then try : 127.0.0.1 also

Mandeep Gill
  • 4,577
  • 1
  • 28
  • 34
0

You can configure port forwarding from homestead to your local machine by adding this line to Vagrantfile:

config.vm.network "forwarded_port", guest: 9200, host: 62000

After

vagrant reload

you will be able to connect to your elasticsearch instance with:

localhost:62000

MBozic
  • 1,132
  • 1
  • 10
  • 22