Elasticsearch7.x is installed on the cloud server, but the external network cannot be accessed through ip:9200?

After installing elasticsearch on the cloud server, decompressing elasticsearch, start it, it can be accessed through http://localhost:9200, but http://ip:9200 is not accessible, what should I do? The solution is as follows

First, you need to clarify your Elasticsearch version information

The Elasticsearch version I installed is 7.9.3

Second, clarify your deployment environment. I use HUAWEI CLOUD HECS (Yunyao Cloud Server)

1vCPUs | 2GB CentOS 7.6 64bit

 

1. Question: Why can't I access it with the external network ip:9200?

By default, Elasticsearch can only be accessed through the local loopback address of localhost/127.0.0.1. If you need to set to support other ip access, you need to set the network.host parameter of the configuration file. Remove the comment of network.host, that is, network.host is '0.0.0.0'.

 

After modification, start again. Continue to report errors.

2. ERROR: [2] bootstrap checks failed

  • [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
  • [2]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

问题1:max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

解决:切换到root用户修改配置sysctl.conf
 
vi /etc/sysctl.conf 
添加下面配置:
vm.max_map_count=655360
并执行命令:
sysctl -p

问题2 : the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

往 yml 文件中添加下面的配置
node.name: node-1
cluster.initial_master_nodes: [“node-1”]

After solving the above problem, it is found that the host's internal network IP: 9200 can be accessed normally, but the external network IP: 9200 is still inaccessible. Why is this?

This is related to the configuration of Huawei Cloud Security Group. Others like Alibaba Cloud and Tencent Cloud also have the concept of security groups, so if you use cloud server deployment, you need to consider the configuration of security groups.

The location of relevant documents about HUAWEI CLOUD security groups is as follows:

https://support.huaweicloud.com/usermanual-ecs/zh-cn_topic_0030878383.html

 

After solving the above error problem, the browser will return to the following normal Internet page after entering IP: 9200

Guess you like

Origin blog.csdn.net/qq_36148847/article/details/109325591