概述
问题:
一些高配的机器会选择在一个物理机上启动多个ES节点来充分利用资源,那么如何避免一个索引的主副本都分布在一个物理机上,从而导致一个物理机宕机了导致索引不可用?
解答:
引用官方文档
cluster.routing.allocation.same_shard.host
Allows to perform a check to prevent allocation of multiple instances of the same shard on a single host, based on host name and host address. Defaults to false
, meaning that no check is performed by default. This setting only applies if multiple nodes are started on the same machine.
在所有ES节点的安装目录下的config/elasticsearch.yaml 文件里添加配置项,并且重启相关节点即可。
|
最后
以上就是老实大白为你收集整理的ES 单机多节点如何保证高可用的全部内容,希望文章能够帮你解决ES 单机多节点如何保证高可用所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复