Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build ElasticSearch7.2.0 Cluster in CentOS7

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

It is believed that many inexperienced people have no idea about how to build ElasticSearch7.2.0 cluster in CentOS7. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

I. description of the environment:

Java version: jdk1.8.0

Operating system: CentOS7

ES version of ElasticSearch7.2.0

Server: 3, ip is 192.168.1.100192.168.1.101192.168.1.102, memory is 32GB.

Second, software installation:

1 and 3 servers respectively install jdk and configure JAVA_HOME

ES is installed on 2 and 3 servers respectively, and the installation path is / usr/installs/ElasticSearch-7.2.0

3. ES configuration:

1. Basic configuration, such as creating non-root users to start es, etc., without details.

2 、 / usr/installs/elasticsearch-7.2.0/config/jvm.option:

The main purpose here is to configure the jvm size. Here, according to the actual situation of the server memory, I have allocated 16GB to all three servers.

3 、 / usr/installs/elasticsearch-7.2.0/config/elasticsearch.yml:

192.168.1.100:

# No bootstrap.memory_lock: false#, no bootstrap.system_call_filter: false#, no http.max_content_length: 2047mb# cluster name cluster.name: test# node name node.name: node-1# data storage path path.data: / usr/installs/elasticsearch-7.2.0/data# log storage path path.logs: / usr/installs/elasticsearch-7.2.0/logs# You can visit network.host: 0.0.0.0#http port http.port: 920 cluster internal communication port transport.tcp.port: 930 whether the master node node.master: true# is the data node node.data: true# initial master node cluster.initial_master_nodes: ["node-1"] # can cross-domain http.cors.enabled: true# all domain names can access http.cors.allow-origin: "*" # Cluster node list discovery.seed_hosts: ["192.168.1.100" "192.168.1.101", "192.168.1.102"] # without discovery.zen.minimum_master_nodes: 1

192.168.1.101:

# No bootstrap.memory_lock: false#, no bootstrap.system_call_filter: false#, no http.max_content_length: 2047mb# cluster name cluster.name: test# node name node.name: node-2# data storage path path.data: / usr/installs/elasticsearch-7.2.0/data# log storage path path.logs: / usr/installs/elasticsearch-7.2.0/logs# You can visit network.host: 0.0.0.0#http port http.port: 920 cluster internal communication port transport.tcp.port: 930 whether the master node node.master: true# is the data node node.data: true# initial master node cluster.initial_master_nodes: ["node-1"] # can cross-domain http.cors.enabled: true# all domain names can access http.cors.allow-origin: "*" # Cluster node list discovery.seed_hosts: ["192.168.1.100" "192.168.1.101", "192.168.1.102"] # without discovery.zen.minimum_master_nodes: 1

192.168.1.102:

# No bootstrap.memory_lock: false#, no bootstrap.system_call_filter: false#, no http.max_content_length: 2047mb# cluster name cluster.name: test# node name node.name: node-3# data storage path path.data: / usr/installs/elasticsearch-7.2.0/data# log storage path path.logs: / usr/installs/elasticsearch-7.2.0/logs# You can visit network.host: 0.0.0.0#http port http.port: 920 cluster internal communication port transport.tcp.port: 930 whether the master node node.master: true# is the data node node.data: true# initial master node cluster.initial_master_nodes: ["node-1"] # can cross-domain http.cors.enabled: true# all domain names can access http.cors.allow-origin: "*" # Cluster node list discovery.seed_hosts: ["192.168.1.100" "192.168.1.101", "192.168.1.102"] # without discovery.zen.minimum_master_nodes: 1

4. Some common exceptions, error messages and solutions:

1 、 max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

Solution:

Switch to the root user, modify the / etc/security/limits.conf file, add the following configuration, and switch back to the es-admin user. * it is valid for all users.

* soft nofile 65536

* hard nofile 65536

2 、 max number of threads [3818] for user [es] is too low, increase to at least [4096]

Solution:

Modify the configuration file / etc/security/limits.conf by adding a configuration item below

* soft nproc 4096

* hard nproc 4096

3 、 max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [655360]

Solution:

Modify the / etc/sysctl.conf file to add the following configuration.

Vm.max_map_count=655360

After saving, execute sysctl-p, and the modification takes effect.

4. Remote unreachable or error reporting connection failure in the log

Solution: the firewall opens the corresponding ports 9200 and 9300, or turns off the firewall.

5 、 received a newer join from...

Solution: check cluster.initial_master_nodes: ["node-1"]. Multiple nodes are configured here. This error may occur.

After reading the above, have you mastered how to build an ElasticSearch7.2.0 cluster in CentOS7? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report