简体   繁体   中英

How to access elasticsearch from Linux Guest (Virtualbox) to OSX Host?

As the question states, if I have a linux/centos VM in virtualbox, how do I go to:

10.0.0.1:9200 to access elasticsearch?

On the guest, I am getting a "Connection timed out error". From my OSX host, I can see elasticsearch is running with "localhost:9200". I can tell Apache is accessible from the Linux guest because 10.0.0.1 shows the apache webpage fine. In my OSX configuration, I have "Web Sharing" enabled, which is why I assume that the guest is able to access port 80, but what about elasticsearch?

I tried:

  1. sudo ipfw add 7000 allow tcp from any to any dat-port 9200

Logged out, the logged back in. Still getting a "The connection has timed out" in guest CentOS VM.

  1. Drag the /usr/local/Cellar/elasticsearch/bin/elasticsearch into the "System Preferences" -> "Security" -> "Firewall"

Still getting a "The connection has timed out" in CentOS VM.

This feel like it should be something very simple.... note that elasticsearch was installed with homebrew.

You probably don't have the port 9200 open somewhere along the line. If your OSX Host is on the same network as your linux guest, then it is probably the firewall. You can change firewall settings on the OSX host by going to System Preferences > Security > Firewall .

If there is networking equipment between the computers (Based on the IP address I do not believe there is) you also need to open the port there as well.

If the port you need to open is not used it a .app application you will need to add it manually using the console. The command to do this is sudo ipfw add 7000 allow tcp from any to any dat-port 9200 . 7000 is the rule number, and 9200 is the port.

Additionally this is not the correct site for questions like this, the best place would be Ask Different the stack exchange site for mac questions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM