Elasticsearch在ubuntu下的安装

本文档详细介绍了如何在Ubuntu系统下安装Elasticsearch,包括从官网下载TAR包,解压,以及解决因内存不足导致的启动问题。通过修改`jvm.options`文件调整JVM内存配置,并解决了不能以root用户启动的问题,创建新用户后成功运行Elasticsearch。
摘要由CSDN通过智能技术生成
一、找到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
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值