【索引级别分配】

第2题,索引级别分片分配设置
Configure hamlet-1 to allocate both primary shards to node2, using the node name
通过配置节点名字,指定hamlet-1的俩主分片都放在node2上
Configure hamlet-2 so that no primary shard is allocated to node3
通过配置,避免hamlet-2的分片放置在node3
Remove any allocation filter setting associated with hamlet-1 and hamlet-2
取消所有针对hamlet-1和hamlet-2分片放置的设置
Verify the success of the last action by using the _cat API
通过_catAPI验证一下这些操作成功了没

第2题,题解
把hamlet-1的主分片都放node2上
PUT hamlet-1/_settings
{
   "index.routing.allocation.require._name": "node2"
}
校验命令:GET /_cat/shards/hamlet-1?v&h=index,shard,prirep,state,docs,store,ip,node


把hamlet-2所有主分片都移出node3
PUT hamlet-2/_settings
{
  "index.routing.allocation.exclude._name": "node3"
}

校验命令:

GET /_cat/shards/hamlet-2?v&h=index,shard,prirep,state,docs,store,ip,node
 

注意:设置是针对所有分片的,分配时不只参考预定策略,也会考虑内置限定  (临时,不彻底)

如果节点重启,replica shard 会出现未分配的现象 (彻底)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值