Tips for Elasticsearch installation issues
Possible errors & Countermeasures
max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
File handle Due to insufficient current user file permissions Need to modify the system configuration file limits. Conf: sudo vim/etc/security/limits. Conf
Add the following:
soft nofile 65536
hard nofile 131072
soft nproc 4096
hard nproc 4096
Copy the code
max number of threads [1024] for user [leyou] is too low, increase to at least [4096]
Number of threads is not enough, continue to modify the configuration file 20 – nproc. Conf: sudo vim/etc/security/limits. D / 20 – nproc. Conf
The modification is as follows:
soft nproc 4096
Copy the code
max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
Vm.max_map_count: limits the number of Vmas (virtual memory regions) that a process can have, and continues to modify the configuration file sysctl.conf: sudo vim /etc/sysctl.conf
Add the following:
vm.max_map_count=655360
Copy the code
Then run the sysctl -p command
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
This is because you did not define the node configuration as defined above.
In a development environment, you can run multiple ES nodes on the same host, and the default configuration will run the ES cluster.
In the production environment, es nodes are deployed on different hosts, and auto-bootstrap does not work. Therefore, you need to configure cluster. Initial_master_nodes and discovery.seed_hosts to specify the master node. Make the ES nodes join the cluster correctly.
Yml = elasticSearch.yml = elasticSearch.yml = elasticSearch.yml = ElasticSearch.yml
Configure the firewall iptables service
yum -y install iptables-services
To modify the firewall configuration, add firewall port 9200 vim /etc/sysconfig/iptables
Increase the rules
-A INPUT -m state --state NEW -m tcp -p tcp --dport 9200 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5000 -j ACCEPT
Copy the code
Save and exit
Systemctl restart iptables.service # Restart the firewall for the configuration to take effect
Systemctl enable iptables.service # Set the firewall to start upon startup
Finally, restart the system for the Settings to take effect.
Elasticsearch directory structure
- Bin Script file, including Elasticsearch, plug-in installation, and running statistics
- Config (Elasticsearch.yml) Cluster configuration file and user/role Based configuration
- JDK Java runtime environment
- Lib Java class library
- Logs (path.log) Log file
- Modules contains all es modules
- Plugins include all installed plug-ins
The JVM configuration
JVM configuration config/ JVMS. Options (default is 1 GB for 7.1 download)
Configuration suggestions:
- Set XMX and XMS the same
- XMX should not exceed 50% of your machine’s memory
- Do not exceed 30 GB (ES recommended)
Es command
- Bin/ElasticSearch # Access localhost:9200
View the installed plug-ins
- bin/elasticsearch-plugin list
- bin/elasticsearch-plugin remove
- Bin/Elasticsearch-plugin install analysis-icu
In addition to bin/ Elasticsearch-plugin list, you can also use localhost:9200/_cat/plugins
Plug-in mechanism is introduced: www.elastic.co/guide/en/el…
Es provides plug-in mechanisms to accomplish many tasks, such as data synchronization, node discovery, and security recovery
Open multiple nodes on one machine
/ work/env/elk/elasticsearch - 7.8.0 / bin/elasticsearch - E node. Name = node1 - E cluster. The name = geektime - E path. The data = node1_data - d/work/env/elk/elasticsearch - 7.8.0 / bin/elasticsearch - E node. Name = 2 - E cluster. The name = geektime - E Path. The data = node2_data - d/work/env/elk/elasticsearch - 7.8.0 / bin/elasticsearch - E node. Name = node3 - E cluster. The name = geektime -E path.data=node3_data -dCopy the code