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

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

Moon-01

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

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

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

打赏作者

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

抵扣说明:

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

余额充值