一、找到Elasticsearch官网https://www.elastic.co/downloads/elasticsearch
如图选择TAR包,将其链接地址复制
到ubuntu系统下,我安装在/home/ubuntu/目录下使用
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.1.1.tar.gz
进行下载、使用tar命令解压
tar -zvxf elasticsearch-6.1.1.tar.gz
解压后启动可能会出现问题,我使用的服务器是内存很小,只有800多MB,而默认的elasticsearch的启动需要JVM大小配置为1G
可以在 confiog/jvm.options下可以配置elasticsearch的启动JVM大小
## JVM configuration
################################################################
## IMPORTANT: JVM heap size
################################################################
##
## You should always set the min and max JVM heap
## size to the same value. For example, to set
## the heap to 4 GB, set:
##
## -Xms4g
## -Xmx4g
##
## See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html
## for more information
##
################################################################
# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space
-Xms1g
-Xmx1g
只截取了部分jvm.options的内容,可以看到启动文件对JVM要求是1g大小
当内存不够时候出现的异常
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c5330000, 986513408, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 986513408 bytes for committing reserved memor