The local browser accesses the elasticsearch installed in the virtual machine, and the access fails

First check whether the virtual machine is turned on, and then check whether the es in the virtual machine is turned on

First, let me introduce my environment:

  1. The CentOS7 installed in the virtual machine and my local machine can ping each other.

  2. The firewall of CentOs7 was also closed by me

  3. No error is reported when starting es, and the elasticsearch.yml configuration file is changed to network.host: 0.0.0.0

  4. Type the command curl ip:9200 in the virtual machine, and the correct result is also displayed.

However, when visiting the local browser using ip:9200, the connection fails, as shown in the figure below

13929bb8d30b83f5e5757e3a0e7ad7b0.png

That is likely to be the CentOs system in the virtual machine, and there is a problem with the network configuration in the local windows.

The ip setting of VM8 in Windows is the same as the ip in the virtual machine, just change it to a different ip.

As shown in the figure below, change the ip, as long as it is different from the ip set in the centos configuration file

fd233f0a9bd52b082f9adc60a6070205.png

The figure below is the network configuration file ifcfg-ens33 of CentOs7,

1618585c5dbc8f8943858b5b7463d4db.png

Restart the network systemctl restart network.service, restart es, and use a browser to access es without reporting an error. The normal results are as follows:

f88610d32668e479bb520a1cc9cac135.png

Well, congratulations, success! Kaisen! ! !

Source: https://blog.csdn.net/yanzhenjingfan/article/details/86769980

5cca4db96168ccedd5f380d62e1530fd.jpeg

Guess you like

Origin blog.csdn.net/lxw1844912514/article/details/131255650