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

Sample Analysis of elastic search installation on centos7

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

Share

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

Editor to share with you a sample analysis of elastic search installation on centos7, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

This article introduces the installation and filling notes of elastic search on centos7 and shares them with you. The details are as follows:

Download elastic search 5.3.0

Wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.3.0.tar.gzmv elasticsearch-5.3.0.tar.gz / optcd / opttar-xzvf elasticsearch-5.3.0.tar.gzcd elasticsearch-5.3.0/

Start ES

Cd / bin./elasticsearch

According to the reason, it should be OK, but then all kinds of pits appear one by one and elaborate separately.

Error 1:error='Cannot allocate memory' (errno=12)

Error='Cannot allocate memory'

Solutions:

Since the default jvm space allocated by elasticsearch6.0 is 2g, it needs to be reduced a bit.

Vim config/jvm.options-Xms2g →-Xms512m-Xmx2g →-Xmx512m

Error 2: can not run elasticsearch as root

Can not run elasticsearch as root

Solutions:

In a Linux environment, elasticsearch is not allowed to run with root privileges! So you need to create a non-root user to start es with a non-root user

Groupadd elk # create user group elkuseradd elk-g elk-p 111111 # create new user elk,-g elk set its user group to elk,-p 111set its password 6 1chown-R elk:elk / opt # change / opt folder and internal files belong to elk:elksu elk # switch to non-root user elk

Error 3: (1) max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

(2) max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

This error occurs when you modify the network.host in config/elasticsearch.yml to network.host: 0.0.0.0 so that any IP on the public network can access it.

Solutions:

Switch to the root user, and

Vim / etc/security/limits.conf* soft nofile 300000 * hard nofile 300000 * soft nproc 102400 * soft memlock unlimited* hard memlock unlimited

/ etc/security/limits.conf

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

Vm.max_map_count is too low

Solutions:

First you need to switch to the root user

You can then execute the following command to set the vm.max_map_count, but it will return to the original value after reboot.

Sysctl-w vm.max_map_count=262144

Persistence is done by modifying the vm.max_map_count parameter in the / etc/sysctl.conf file:

Echo "vm.max_map_count=262144" > / etc/sysctl.confsysctl-p

Finally, the access to the public network is successful:

Access to the public network was successful!

Install the visualization plug-in elasticsearch-head

Git clone git://github.com/mobz/elasticsearch-head.gitcd elasticsearch-headnpm install # I have a problem trying to use cnpm install here, I can npm run start it with npm

Then visit http:// your installation machine IP:9100 on the public network.

Access to elasticsearch-head visual interface succeeded

Finally, a simple test is actually done.

If you create a new Index, you can send a PUT request directly to the Elastic server. The following example is a new Index called weather.

Use the rest interface to add index to es

However, refreshing the elasticsearch-head visual interface shows that the index has been inserted successfully

The index has been inserted

The above is all the contents of the article "sample Analysis of elastic search installation on centos7". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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

Servers

Wechat

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

12
Report