Elasticserach常见问题

启动:

直接启动: ./bin/elasticsearch

后台启动:./bin/elasticsearch -d

测试: curl http://192.168.2.101:9200

停止:

查看es进程: jps | grep Elasticsearch

杀掉进程: kill -9 进程号

问题及解决

问题1:

max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

解决方法:

vim /etc/security/limits.conf

在最后面追加下面内容:

francis hard nofile 65536

francis soft nofile 65536 # francis为es安装目录的所有者

或者:

soft nofile 65536

hard nofile 65536 # *表示所有用户,nofile表示最大文件句柄数,表示能够打开的最大文件数目

修改后退出重新登录,使用如下命令查看是否修改成功:

ulimit -Hn

ulimit -Sn

问题2:

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

解决方法:

vim /etc/sysctl.conf

在最后面追加内容: vm.max_map_count=262144

查看修改后的结果:sysctl -p

问题3:

Java HotSpot™ 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 2060255232, 0) failed; error=‘Cannot allocate memory’ (errno=12)

解决方法:

编辑文件 vim /usr/local/elasticsearch/config /jvm.options

修改以下配置,将1g变为更小的值:

-Xms1g

-Xmx1g

问题4:

问题5:

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

解决方法:

vim /usr/local/elasticsearch/config/ elasticsearch.yml

添加配置:cluster.initial_master_nodes: [“node01”]

问题6:

Exception in thread “main” java.nio.file.AccessDeniedException: /usr/local/elasticsearch /config/jvm.options

解决办法:

这种是权限问题,一般这种权限问题执行: chown -R francis:francis /usr/local/elasticsearch 即可解决

分片数不够:

[2022-03-18T09:32:07,019][WARN ][o.e.x.m.e.l.LocalExporter] [node-1] unexpected error while indexing monitoring document

org.elasticsearch.xpack.monitoring.exporter.ExportException: org.elasticsearch.common.ValidationException: Validation Failed: 1: this action would add [1] total shards, but this cluster currently has [10437]/[10000] maximum shards open;

解决方法:

PUT /_cluster/settings

{

"transient": {

"cluster": {

"max_shards_per_node":20000

}

}

}

匹配通配符

PUT /_cluster/settings

{

"persistent" : {

"action.destructive_requires_name": false

}

}

### Elasticsearch 8 安装配置与使用教程 #### 安装指南 对于希望在 Mac 系统上部署 Elasticsearch 的用户而言,官方提供了详尽的指导手册[^1]。此文档不仅涵盖了 macOS 平台上的具体操作流程,还适用于其他操作系统环境下的相似设置过程。 为了简化安装体验并确保最佳性能表现,建议遵循以下要点: - **系统需求确认**:检查计算机硬件条件以及软件依赖项是否满足最低标准。 - **下载对应版本**:访问官网获取最新稳定版压缩包或通过 Docker 镜像快速启动实例。 - **解压&初始化**:按照指引完成必要的目录结构创建及初始参数设定工作。 - **服务注册**:利用 Homebrew 或者手动方式将 ES 注册成为后台守护进程以便长期运行。 #### 修改配置文件的方法 当需要调整默认行为时,则可以通过命令行工具 `docker cp` 将正在运行中的容器内 `/usr/share/elasticsearch/config/elasticsearch.yml` 文件拷贝至主机磁盘指定位置进行编辑保存后再替换回原处[^2]。 ```bash docker cp some-elasticsearch:/usr/share/elasticsearch/config/elasticsearch.yml /path/to/local/ ``` 随后依据实际业务场景定制化各项功能开关、集群名称、网络监听地址等重要选项。 #### 新增特性概览 随着版本迭代更新,在 v8.x 中引入了一系列改进措施和技术革新,其中包括但不限于以下几个方面: - **安全性增强**:内置身份验证机制得到进一步完善;支持更广泛的身份提供商集成方案。 - **查询优化器升级**:针对复杂检索模式提供更加高效的执行计划生成算法。 - **机器学习模块强化**:新增多种预训练模型供开发者调用分析数据趋势预测异常情况。 - **可观测性提升**:集成了更多监控指标采集接口方便运维人员实时掌握健康状况。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Moon-01

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值