CH 9 节点属性

时间:2021-06-28 20:45:39   收藏:0   阅读:0

概述

节点属性是一种描述节点的方式没有资源保障。可以用来让应用挑选正确的节点

特性

节点属性有一下几个特性:

配置
设置ResourceManager的节点属性

配置在yarn-site.xml中

属性 描述
yarn.node-attribute.fs-store.root-dir 中心化节点属性映射存放的目录
yarn.node-attribute.fs-store.impl.class 配置org.apache.hadoop.yarn.nodelabels.NodeAttributeStore

注意:

中心化节点属性映射
分布式属性映射

分布式映射,是通过配置的:

属性 描述
yarn.nodemanager.node-attributes.provider NM中node属性provider,script,config或者类名
yarn.nodemanager.node-attributes.provider.fetch-interval-ms 定期获取节点属性的时间
yarn.nodemanager.node-attributes.provider.fetch-timeout-ms 如果script,超时之后会被中断,超时时间
yarn.nodemanager.node-attributes.provider.script.path script路径
yarn.nodemanager.node-attributes.provider.script.opts 脚本需要的参数
yarn.nodemanager.node-attributes.provider.configured-node-attributes 当配置为config时,从参数获取节点属性
指定应用的节点属性

//expression : AND(python!=3:java=1.8)
SchedulingRequest schedulingRequest =
    SchedulingRequest.newBuilder().executionType(
        ExecutionTypeRequest.newInstance(ExecutionType.GUARANTEED))
        .allocationRequestId(10L).priority(Priority.newInstance(1))
        .placementConstraintExpression(
            PlacementConstraints.and(
                PlacementConstraints
                    .targetNodeAttribute(PlacementConstraints.NODE,
                        NodeAttributeOpCode.NE,
                        PlacementConstraints.PlacementTargets
                            .nodeAttribute("python", "3")),
                PlacementConstraints
                    .targetNodeAttribute(PlacementConstraints.NODE,
                        NodeAttributeOpCode.EQ,
                        PlacementConstraints.PlacementTargets
                            .nodeAttribute("java", "1.8")))
                .build()).resourceSizing(
        ResourceSizing.newInstance(1, Resource.newInstance(1024, 1)))
        .build();
监控

REST:http://rm-http-address:port/ws/v1/cluster/nodes/{nodeid} 
web UI:还不支持
通过命令行:

评论(0)
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!