elasticsearch学习笔记(一)

centos安装elasticsearch


前言

本系列学习笔记测试环境基于liunx系统搭建,系统环境为centos7.9,elasticsearch版本为7.13.4,水平有限,欢迎指导
在这里插入图片描述

安装elasticsearch

1. 下载Elasticsearch

到官网下载对应文件并解压 https://www.elastic.co/cn/downloads/elasticsearch
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.13.4-linux-aarch64.tar.gz
在这里插入图片描述

2. 解压文件

tar -zxvf elasticsearch-7.13.4-linux-aarch64.tar.gz -C /opt/elasticsearch/
在这里插入图片描述

3. 修改配置文件

主要配置文件在config文件夹中jvm.optionselasticsearch.yml
修改jvm.options中-Xms4g和-Xmsx4g,根据自己主机内存调整大小

path.data: /opt/elasticsearch/data
path.log: /opt/elasticsearch/logs

4. 启动Elasticsearch

./bin/elasticsearch -d

在这里插入图片描述
不能用 root账号启动es,
创建账号 例如 elastic
启动:
报错
ElasticsearchException[Failure running machine learning native code. This could be due to running on an unsupported OS or distribution, missing OS libraries, or a problem with the temp directory. To bypass this problem by running Elasticsearch without machine learning functionality set [xpack.ml.enabled: false].]
在这里插入图片描述
编辑elasticsearch.yml
末尾添加:

xpack.ml.enabled: false

启动es
在这里插入图片描述
报错 :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
解决:
discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes 至少设置一个

报错 : max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决:修改一个进程能拥有最大内存区域限制 编辑 /etc/sysctl.conf加入下面内容 ,保存后 执行 sysctl -p.

vm.max_map_count = 262144
vm.swappiness = 1

再次启动
执行curl 'localhost:9200'
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值