Elasticsearch安装配置问题
2024-09-03 22:07:12
1、配置服务 ip 和 端口
进入 elasticsearch 安装目录,打开 config/elasticsearch.yml 配置 net.host 和 http.port
net.host: 0.0.0.0 http.port:
kibana 外网访问设置:
# vi kibana-7.3.0-linux-x86_64/config/kibana.yml server.host: "0.0.0.0"
2、坑
(1)用户
Linux 下不要使用 root 用户运行 Elasticsearch, 否则会报异常 can not run elasticsearch as root
(2)引导检查
如果你是使用 .zip 或 .tar.gz 安装包,有些配置需要手工配置,否则将导致启动失败,如:
ERROR: [] bootstrap checks failed
[]: max file descriptors [] for elasticsearch process is too low, increase to at least []
[]: max virtual memory areas vm.max_map_count [] is too low, increase to at least []
[]: 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
在 Elasticsearch 以前的版本中,其中的一些配置错误被记录为警告信息。可以理解的是,用户有时会忽略这些日志消息。为了确保这些设置受到应有的重视,Elasticsearch在启动之前会做一些检查 Bootstrap Checks | Elasticsearch Reference [7.0] | Elastic。这些 启动检查
Important Elasticsearch configuration | Elasticsearch Reference [7.0] | Elastic 会检测 Elasticsearch 和系统的各种设置,并比较与那些为值是否是 Elasticsearch 的操作安全值。如果 Elasticsearch 处于开发模式,任何启动检失败被记录为 Elasticsearch 警告日志。如果 Elasticsearch 是在生产模式下,任何启动检查失败会导致 Elasticsearch 拒绝启动。
要解决以上问题,需进行如下配置:
- 文件描述符配置
- 临时生效
- 使用
root
用户 - 运行
ulimit -n 65536
- 使用
- 永久生效
- 使用
root
用户 - 进入
/etc/security/limits.conf
- 添加一行
user - nofile 65536
- 使用
- 临时生效
- 虚拟内存配置
- 临时生效
- 使用
root
用户 - 运行
sysctl -w vm.max_map_count=262144
- 使用
- 永久生效
- 使用
root
用户 - 进入
/etc/sysctl.conf
- 添加或更新一行
vm.max_map_count=262144
- 使用
- 临时生效
- 自动发现配置
- 单节点
- 进入 elasticsearch 安装目录,打开 config/elasticsearch.yml
- 添加或更新一行
discovery.type: single-node
3、JVM内存大小指定太大,但本机内存不够用(主要还是没钱):
[root@file elasticsearch-7.1.]# ./bin/elasticsearch
Java HotSpot(TM) -Bit Server VM warning: INFO: os::commit_memory(0x00000000c5330000, , ) failed; error='Cannot allocate memory' (errno
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map bytes for committing reserved memory.
# An error report file with more information is saved as:
# logs/hs_err_pid27766.log
解决:
# 修改jvm.options文件配置即可,从1g改成了100m # Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space -Xms100m
-Xmx100m
最新文章
- 深入.net(继承)
- Mysql中mysqldump命令使用详解
- Masonry学习分享
- [转载]百度编辑器-Ueditor使用
- nginx try_files命令
- HDU 5805 NanoApe Loves Sequence (思维题) BestCoder Round #86 1002
- 手写PE文件(二)
- iOS本地数据存取
- iOS开发——数据持久化Swift篇&;通用文件存储
- 安装MYSQL 出现Error 1045 access denied 的解决方法
- Android创建启动画面[转]
- U盘为什么还有剩余空间,但却提示说空间不够
- 【前端单元测试入门05】react的单元测试之jest
- cpp typename关键字
- 学习STM32,你不得不了解的五大嵌入式操作系统
- Java 笔记——在 IDEA 中使用 Maven 配置和使用 MyBatis
- 【教程】ubuntu下安装NFS服务器
- iOS App中第一次运行添加半透明新手指引
- 启动ECLIPSE时,提示failed to create the java virtual machine
- hadoop2.x学习笔记(一):YARN
热门文章
- VTORRAAYY ws+tls+nginx config
- 用实例的方式去理解storm的并发度
- django国际化的简单设置
- ubuntu彻底删除git
- Zabbix trigger(触发器)设置
- c#使用 StackExchange.Redis 封装 RedisHelper
- java中list和map的底层实现原理
- CF827D Best Edge Weight[最小生成树+树剖/LCT/(可并堆/set启发式合并+倍增)]
- qt 防止应用重复启动
- assert 笔记