Windows System Installation
1. Installing the JDK
Elastic search requires the use of a higher version of the JDK, this article uses D:\DevTools\jdk1.8.0_131 and configures environment variables
2. Install Elastic Search
Official website: https://www.elastic.co/cn/
:
Https://www.elastic.co/downloads/elasticsearch
This use version: elasticsearch-2.4.6 2.x version uses 1.8 below JDK will error, command Window Flash back, unzip can.
3. Use
Double-click Elasticsearch.bat file under installation directory D:\DevTools\elasticsearch-2.4.6\bin
4. Testing
Page access:
Http://localhost:9200/or Http://127.0.0.1:9200/
Linux system Installation
1. Download the installation package
Elasticsearch-2.2.0.tar.gz
Upload to Linux system, unzip TAR-XZVF elasticsearch-2.2.0.tar.gz
2, direct start will be error
Because of the version of the issue, the latest version of the security level has increased, not allowed to start with the root account, so we want to add a user. Because Elasticsearch has the function of remote execution script, so it is easy to Trojan virus, so it is not allowed to start with the root user, root user is not up, assign permissions, with the general user start.
---------------------------------------
#添加一个用户: Elasticsearch
$useradd Elasticsearch
#给用户elasticsearch设置密码, input 2 consecutive times
$PASSWD Elasticsearch
#创建一个用户组 ES
Groupadd ES
#分配 Elasticsearch to ES Group
Usermod-g Elasticsearch ES
#这里注意下, if the prompt user "es" does not exist, then because of the server version problem, you can switch to Usermod-g es Elasticsearch, that is, users and user groups to use the swap.
#在elasticsearch the root directory, given user rights. -R indicates a stepwise (n-tier directory), * denotes any file
Chown-r elasticsearch.es *
#切换到elasticsearch用户
Su Elasticsearch
-----------------------------------
If you do not assign the permissions directory to the user Elasticsearch as above. Then the following error will be reported:
Java.io.filenotfoundexception:/home/es/elasticsearch-2.2.0/logs/elasticsearch.log (Permission denied)
Elasticsearch installed on Windows and Linux systems, respectively