elasticsearch 7安装

问题提前报

max virtual memory areas error

max virtual memory areas vm.max_map_count 65530 is too low, increase to at least 262144

如果您的环境是Linux,注意要做以下操作,否则es可能会启动失败

1 用编辑工具打开文件/etc/sysctl.conf

2 在尾部添加一行配置vm.max_map_count = 262144,如果已存在就修改,数值不能低于262144

3 修改保存,然后执行命令sudo sysctl -p使其立即生效

heap size error

initial heap size 1073741824 not equal to maximum heap size 4294967296; this can cause resize pauses and prevents mlockall from locking the entire heap

原因是 ES_JAVA_OPTS 设置错误,前后必须相同,如

-Xms3g -Xmx3g

手动安装es

下载

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.17.15-linux-x86_64.tar.gz

解压

shell 复制代码
tar -zxvf elasticsearch-7.17.15-linux-x86_64.tar.gz
mv elasticsearch-7.17.15 /usr/local/elasticsearch

添加用户

shell 复制代码
useradd es
passwd es
chown -R es:es /usr/local/elasticsearch

配置文件修改

vim elasticsearch.yml

yaml 复制代码
network.host: 0.0.0.0
http.port: 9200
discovery.seed_hosts: "[::1]"
cluster.initial_master_nodes: ["node-1"]

启动

/usr/local/elasticsearch/bin/elasticsearch -d

访问验证

http://127.0.0.1:9200/

相关推荐
Devin~Y8 小时前
电商场景下的Java面试实战:从Spring Boot微服务到Kafka、Redis与AI RAG
java·spring boot·redis·elasticsearch·spring cloud·微服务·kafka
SelectDB技术团队9 小时前
Agent 场景动态 JSON 性能拆解:Apache Doris 比 ClickHouse 快 7 倍、比 Elasticsearch 快 2 倍
数据库·clickhouse·elasticsearch·json·apache·日志分析·apache doris
Elastic 中国社区官方博客10 小时前
如何为阿里云 Elasticsearch 创建推理端点,连接器,Workflow 并写入数据
大数据·人工智能·elasticsearch·搜索引擎·阿里云·云计算·全文检索
杰佛史彦明110 小时前
ElasticSearch中的分词器详解
大数据·elasticsearch·c#
Elasticsearch11 小时前
如何在 Elasticsearch 中使用 BBQ 将 Jina v5 嵌入缩小 29 倍而不损失召回率
elasticsearch
阿标在干嘛12 小时前
政策快报平台的全文检索:从ES到向量检索的演进
大数据·elasticsearch·全文检索
Elastic 中国社区官方博客1 天前
如何比较两个 Elasticsearch 索引并找出缺失的文档
大数据·运维·数据库·elasticsearch·搜索引擎
阿里云大数据AI技术1 天前
Elasticsearch 智能助手:Agent 让运维从经验驱动迈向智能协同
人工智能·elasticsearch·agent
贾天佑忆月2 天前
Mac 本地项目推送至 GitHub 完整指南
elasticsearch·macos·github
望江东浪2 天前
我的 Claude Code 效率工具全套配置分享
大数据·elasticsearch·搜索引擎