001/** 002* Licensed to the Apache Software Foundation (ASF) under one 003* or more contributor license agreements. See the NOTICE file 004* distributed with this work for additional information 005* regarding copyright ownership. The ASF licenses this file 006* to you under the Apache License, Version 2.0 (the 007* "License"); you may not use this file except in compliance 008* with the License. You may obtain a copy of the License at 009* 010* http://www.apache.org/licenses/LICENSE-2.0 011* 012* Unless required by applicable law or agreed to in writing, software 013* distributed under the License is distributed on an "AS IS" BASIS, 014* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 015* See the License for the specific language governing permissions and 016* limitations under the License. 017*/ 018 019package org.apache.hadoop.yarn.conf; 020 021import java.net.InetSocketAddress; 022import java.util.Arrays; 023import java.util.Collections; 024import java.util.List; 025 026import org.apache.hadoop.HadoopIllegalArgumentException; 027import org.apache.hadoop.classification.InterfaceAudience.Private; 028import org.apache.hadoop.classification.InterfaceAudience.Public; 029import org.apache.hadoop.classification.InterfaceStability.Evolving; 030import org.apache.hadoop.classification.InterfaceStability.Unstable; 031import org.apache.hadoop.conf.Configuration; 032import org.apache.hadoop.http.HttpConfig; 033import org.apache.hadoop.net.NetUtils; 034import org.apache.hadoop.util.StringUtils; 035import org.apache.hadoop.yarn.api.ApplicationConstants; 036 037@Public 038@Evolving 039public class YarnConfiguration extends Configuration { 040 041 @Private 042 public static final String CS_CONFIGURATION_FILE= "capacity-scheduler.xml"; 043 044 @Private 045 public static final String HADOOP_POLICY_CONFIGURATION_FILE = 046 "hadoop-policy.xml"; 047 048 @Private 049 public static final String YARN_SITE_CONFIGURATION_FILE = "yarn-site.xml"; 050 051 private static final String YARN_DEFAULT_CONFIGURATION_FILE = 052 "yarn-default.xml"; 053 054 @Private 055 public static final String CORE_SITE_CONFIGURATION_FILE = "core-site.xml"; 056 057 @Private 058 public static final List<String> RM_CONFIGURATION_FILES = 059 Collections.unmodifiableList(Arrays.asList( 060 CS_CONFIGURATION_FILE, 061 HADOOP_POLICY_CONFIGURATION_FILE, 062 YARN_SITE_CONFIGURATION_FILE, 063 CORE_SITE_CONFIGURATION_FILE)); 064 065 @Evolving 066 public static final int APPLICATION_MAX_TAGS = 10; 067 068 @Evolving 069 public static final int APPLICATION_MAX_TAG_LENGTH = 100; 070 071 static { 072 addDeprecatedKeys(); 073 Configuration.addDefaultResource(YARN_DEFAULT_CONFIGURATION_FILE); 074 Configuration.addDefaultResource(YARN_SITE_CONFIGURATION_FILE); 075 } 076 077 private static void addDeprecatedKeys() { 078 Configuration.addDeprecations(new DeprecationDelta[] { 079 new DeprecationDelta("yarn.client.max-nodemanagers-proxies", 080 NM_CLIENT_MAX_NM_PROXIES) 081 }); 082 } 083 084 //Configurations 085 086 public static final String YARN_PREFIX = "yarn."; 087 088 /** Delay before deleting resource to ease debugging of NM issues */ 089 public static final String DEBUG_NM_DELETE_DELAY_SEC = 090 YarnConfiguration.NM_PREFIX + "delete.debug-delay-sec"; 091 092 //////////////////////////////// 093 // IPC Configs 094 //////////////////////////////// 095 public static final String IPC_PREFIX = YARN_PREFIX + "ipc."; 096 097 /** Factory to create client IPC classes.*/ 098 public static final String IPC_CLIENT_FACTORY_CLASS = 099 IPC_PREFIX + "client.factory.class"; 100 public static final String DEFAULT_IPC_CLIENT_FACTORY_CLASS = 101 "org.apache.hadoop.yarn.factories.impl.pb.RpcClientFactoryPBImpl"; 102 103 /** Factory to create server IPC classes.*/ 104 public static final String IPC_SERVER_FACTORY_CLASS = 105 IPC_PREFIX + "server.factory.class"; 106 public static final String DEFAULT_IPC_SERVER_FACTORY_CLASS = 107 "org.apache.hadoop.yarn.factories.impl.pb.RpcServerFactoryPBImpl"; 108 109 /** Factory to create serializeable records.*/ 110 public static final String IPC_RECORD_FACTORY_CLASS = 111 IPC_PREFIX + "record.factory.class"; 112 public static final String DEFAULT_IPC_RECORD_FACTORY_CLASS = 113 "org.apache.hadoop.yarn.factories.impl.pb.RecordFactoryPBImpl"; 114 115 /** RPC class implementation*/ 116 public static final String IPC_RPC_IMPL = 117 IPC_PREFIX + "rpc.class"; 118 public static final String DEFAULT_IPC_RPC_IMPL = 119 "org.apache.hadoop.yarn.ipc.HadoopYarnProtoRPC"; 120 121 //////////////////////////////// 122 // Resource Manager Configs 123 //////////////////////////////// 124 public static final String RM_PREFIX = "yarn.resourcemanager."; 125 126 public static final String RM_CLUSTER_ID = RM_PREFIX + "cluster-id"; 127 128 public static final String RM_HOSTNAME = RM_PREFIX + "hostname"; 129 130 /** The address of the applications manager interface in the RM.*/ 131 public static final String RM_ADDRESS = 132 RM_PREFIX + "address"; 133 public static final int DEFAULT_RM_PORT = 8032; 134 public static final String DEFAULT_RM_ADDRESS = 135 "0.0.0.0:" + DEFAULT_RM_PORT; 136 137 /** The actual bind address for the RM.*/ 138 public static final String RM_BIND_HOST = 139 RM_PREFIX + "bind-host"; 140 141 /** The number of threads used to handle applications manager requests.*/ 142 public static final String RM_CLIENT_THREAD_COUNT = 143 RM_PREFIX + "client.thread-count"; 144 public static final int DEFAULT_RM_CLIENT_THREAD_COUNT = 50; 145 146 /** Number of threads used to launch/cleanup AM.*/ 147 public static final String RM_AMLAUNCHER_THREAD_COUNT = 148 RM_PREFIX + "amlauncher.thread-count"; 149 public static final int DEFAULT_RM_AMLAUNCHER_THREAD_COUNT = 50; 150 151 /** Retry times to connect with NM.*/ 152 public static final String RM_NODEMANAGER_CONNECT_RETIRES = 153 RM_PREFIX + "nodemanager-connect-retries"; 154 public static final int DEFAULT_RM_NODEMANAGER_CONNECT_RETIRES = 10; 155 156 /** The Kerberos principal for the resource manager.*/ 157 public static final String RM_PRINCIPAL = 158 RM_PREFIX + "principal"; 159 160 /** The address of the scheduler interface.*/ 161 public static final String RM_SCHEDULER_ADDRESS = 162 RM_PREFIX + "scheduler.address"; 163 public static final int DEFAULT_RM_SCHEDULER_PORT = 8030; 164 public static final String DEFAULT_RM_SCHEDULER_ADDRESS = "0.0.0.0:" + 165 DEFAULT_RM_SCHEDULER_PORT; 166 167 /** Miniumum request grant-able by the RM scheduler. */ 168 public static final String RM_SCHEDULER_MINIMUM_ALLOCATION_MB = 169 YARN_PREFIX + "scheduler.minimum-allocation-mb"; 170 public static final int DEFAULT_RM_SCHEDULER_MINIMUM_ALLOCATION_MB = 1024; 171 public static final String RM_SCHEDULER_MINIMUM_ALLOCATION_VCORES = 172 YARN_PREFIX + "scheduler.minimum-allocation-vcores"; 173 public static final int DEFAULT_RM_SCHEDULER_MINIMUM_ALLOCATION_VCORES = 1; 174 175 /** Maximum request grant-able by the RM scheduler. */ 176 public static final String RM_SCHEDULER_MAXIMUM_ALLOCATION_MB = 177 YARN_PREFIX + "scheduler.maximum-allocation-mb"; 178 public static final int DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_MB = 8192; 179 public static final String RM_SCHEDULER_MAXIMUM_ALLOCATION_VCORES = 180 YARN_PREFIX + "scheduler.maximum-allocation-vcores"; 181 public static final int DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_VCORES = 4; 182 183 /** Number of threads to handle scheduler interface.*/ 184 public static final String RM_SCHEDULER_CLIENT_THREAD_COUNT = 185 RM_PREFIX + "scheduler.client.thread-count"; 186 public static final int DEFAULT_RM_SCHEDULER_CLIENT_THREAD_COUNT = 50; 187 188 /** If the port should be included or not in the node name. The node name 189 * is used by the scheduler for resource requests allocation location 190 * matching. Typically this is just the hostname, using the port is needed 191 * when using minicluster and specific NM are required.*/ 192 public static final String RM_SCHEDULER_INCLUDE_PORT_IN_NODE_NAME = 193 YARN_PREFIX + "scheduler.include-port-in-node-name"; 194 public static final boolean DEFAULT_RM_SCHEDULER_USE_PORT_FOR_NODE_NAME = 195 false; 196 197 /** Enable Resource Manager webapp ui actions */ 198 public static final String RM_WEBAPP_UI_ACTIONS_ENABLED = 199 RM_PREFIX + "webapp.ui-actions.enabled"; 200 public static final boolean DEFAULT_RM_WEBAPP_UI_ACTIONS_ENABLED = 201 true; 202 203 /** Whether the RM should enable Reservation System */ 204 public static final String RM_RESERVATION_SYSTEM_ENABLE = RM_PREFIX 205 + "reservation-system.enable"; 206 public static final boolean DEFAULT_RM_RESERVATION_SYSTEM_ENABLE = false; 207 208 /** The class to use as the Reservation System. */ 209 public static final String RM_RESERVATION_SYSTEM_CLASS = RM_PREFIX 210 + "reservation-system.class"; 211 212 /** The PlanFollower for the Reservation System. */ 213 public static final String RM_RESERVATION_SYSTEM_PLAN_FOLLOWER = RM_PREFIX 214 + "reservation-system.plan.follower"; 215 216 /** The step size of the Reservation System. */ 217 public static final String RM_RESERVATION_SYSTEM_PLAN_FOLLOWER_TIME_STEP = 218 RM_PREFIX + "reservation-system.planfollower.time-step"; 219 public static final long DEFAULT_RM_RESERVATION_SYSTEM_PLAN_FOLLOWER_TIME_STEP = 220 1000L; 221 222 /** 223 * Enable periodic monitor threads. 224 * @see #RM_SCHEDULER_MONITOR_POLICIES 225 */ 226 public static final String RM_SCHEDULER_ENABLE_MONITORS = 227 RM_PREFIX + "scheduler.monitor.enable"; 228 public static final boolean DEFAULT_RM_SCHEDULER_ENABLE_MONITORS = false; 229 230 /** List of SchedulingEditPolicy classes affecting the scheduler. */ 231 public static final String RM_SCHEDULER_MONITOR_POLICIES = 232 RM_PREFIX + "scheduler.monitor.policies"; 233 234 /** The address of the RM web application.*/ 235 public static final String RM_WEBAPP_ADDRESS = 236 RM_PREFIX + "webapp.address"; 237 238 public static final int DEFAULT_RM_WEBAPP_PORT = 8088; 239 public static final String DEFAULT_RM_WEBAPP_ADDRESS = "0.0.0.0:" + 240 DEFAULT_RM_WEBAPP_PORT; 241 242 /** The https address of the RM web application.*/ 243 public static final String RM_WEBAPP_HTTPS_ADDRESS = 244 RM_PREFIX + "webapp.https.address"; 245 public static final boolean YARN_SSL_CLIENT_HTTPS_NEED_AUTH_DEFAULT = false; 246 public static final String YARN_SSL_SERVER_RESOURCE_DEFAULT = "ssl-server.xml"; 247 248 public static final int DEFAULT_RM_WEBAPP_HTTPS_PORT = 8090; 249 public static final String DEFAULT_RM_WEBAPP_HTTPS_ADDRESS = "0.0.0.0:" 250 + DEFAULT_RM_WEBAPP_HTTPS_PORT; 251 252 public static final String RM_RESOURCE_TRACKER_ADDRESS = 253 RM_PREFIX + "resource-tracker.address"; 254 public static final int DEFAULT_RM_RESOURCE_TRACKER_PORT = 8031; 255 public static final String DEFAULT_RM_RESOURCE_TRACKER_ADDRESS = 256 "0.0.0.0:" + DEFAULT_RM_RESOURCE_TRACKER_PORT; 257 258 /** The expiry interval for application master reporting.*/ 259 public static final String RM_AM_EXPIRY_INTERVAL_MS = 260 YARN_PREFIX + "am.liveness-monitor.expiry-interval-ms"; 261 public static final int DEFAULT_RM_AM_EXPIRY_INTERVAL_MS = 600000; 262 263 /** How long to wait until a node manager is considered dead.*/ 264 public static final String RM_NM_EXPIRY_INTERVAL_MS = 265 YARN_PREFIX + "nm.liveness-monitor.expiry-interval-ms"; 266 public static final int DEFAULT_RM_NM_EXPIRY_INTERVAL_MS = 600000; 267 268 /** Are acls enabled.*/ 269 public static final String YARN_ACL_ENABLE = 270 YARN_PREFIX + "acl.enable"; 271 public static final boolean DEFAULT_YARN_ACL_ENABLE = false; 272 273 /** ACL of who can be admin of YARN cluster.*/ 274 public static final String YARN_ADMIN_ACL = 275 YARN_PREFIX + "admin.acl"; 276 public static final String DEFAULT_YARN_ADMIN_ACL = "*"; 277 278 /** ACL used in case none is found. Allows nothing. */ 279 public static final String DEFAULT_YARN_APP_ACL = " "; 280 281 /** 282 * Enable/disable intermediate-data encryption at YARN level. For now, this 283 * only is used by the FileSystemRMStateStore to setup right file-system 284 * security attributes. 285 */ 286 @Private 287 public static final String YARN_INTERMEDIATE_DATA_ENCRYPTION = YARN_PREFIX 288 + "intermediate-data-encryption.enable"; 289 290 @Private 291 public static final boolean DEFAULT_YARN_INTERMEDIATE_DATA_ENCRYPTION = false; 292 293 /** The address of the RM admin interface.*/ 294 public static final String RM_ADMIN_ADDRESS = 295 RM_PREFIX + "admin.address"; 296 public static final int DEFAULT_RM_ADMIN_PORT = 8033; 297 public static final String DEFAULT_RM_ADMIN_ADDRESS = "0.0.0.0:" + 298 DEFAULT_RM_ADMIN_PORT; 299 300 /**Number of threads used to handle RM admin interface.*/ 301 public static final String RM_ADMIN_CLIENT_THREAD_COUNT = 302 RM_PREFIX + "admin.client.thread-count"; 303 public static final int DEFAULT_RM_ADMIN_CLIENT_THREAD_COUNT = 1; 304 305 /** 306 * The maximum number of application attempts. 307 * It's a global setting for all application masters. 308 */ 309 public static final String RM_AM_MAX_ATTEMPTS = 310 RM_PREFIX + "am.max-attempts"; 311 public static final int DEFAULT_RM_AM_MAX_ATTEMPTS = 2; 312 313 /** The keytab for the resource manager.*/ 314 public static final String RM_KEYTAB = 315 RM_PREFIX + "keytab"; 316 317 /**The kerberos principal to be used for spnego filter for RM.*/ 318 public static final String RM_WEBAPP_SPNEGO_USER_NAME_KEY = 319 RM_PREFIX + "webapp.spnego-principal"; 320 321 /**The kerberos keytab to be used for spnego filter for RM.*/ 322 public static final String RM_WEBAPP_SPNEGO_KEYTAB_FILE_KEY = 323 RM_PREFIX + "webapp.spnego-keytab-file"; 324 325 /** 326 * Flag to enable override of the default kerberos authentication filter with 327 * the RM authentication filter to allow authentication using delegation 328 * tokens(fallback to kerberos if the tokens are missing). Only applicable 329 * when the http authentication type is kerberos. 330 */ 331 public static final String RM_WEBAPP_DELEGATION_TOKEN_AUTH_FILTER = RM_PREFIX 332 + "webapp.delegation-token-auth-filter.enabled"; 333 public static final boolean DEFAULT_RM_WEBAPP_DELEGATION_TOKEN_AUTH_FILTER = 334 true; 335 336 /** How long to wait until a container is considered dead.*/ 337 public static final String RM_CONTAINER_ALLOC_EXPIRY_INTERVAL_MS = 338 RM_PREFIX + "rm.container-allocation.expiry-interval-ms"; 339 public static final int DEFAULT_RM_CONTAINER_ALLOC_EXPIRY_INTERVAL_MS = 600000; 340 341 /** Path to file with nodes to include.*/ 342 public static final String RM_NODES_INCLUDE_FILE_PATH = 343 RM_PREFIX + "nodes.include-path"; 344 public static final String DEFAULT_RM_NODES_INCLUDE_FILE_PATH = ""; 345 346 /** Path to file with nodes to exclude.*/ 347 public static final String RM_NODES_EXCLUDE_FILE_PATH = 348 RM_PREFIX + "nodes.exclude-path"; 349 public static final String DEFAULT_RM_NODES_EXCLUDE_FILE_PATH = ""; 350 351 /** Number of threads to handle resource tracker calls.*/ 352 public static final String RM_RESOURCE_TRACKER_CLIENT_THREAD_COUNT = 353 RM_PREFIX + "resource-tracker.client.thread-count"; 354 public static final int DEFAULT_RM_RESOURCE_TRACKER_CLIENT_THREAD_COUNT = 50; 355 356 /** The class to use as the resource scheduler.*/ 357 public static final String RM_SCHEDULER = 358 RM_PREFIX + "scheduler.class"; 359 360 public static final String DEFAULT_RM_SCHEDULER = 361 "org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler"; 362 363 /** RM set next Heartbeat interval for NM */ 364 public static final String RM_NM_HEARTBEAT_INTERVAL_MS = 365 RM_PREFIX + "nodemanagers.heartbeat-interval-ms"; 366 public static final long DEFAULT_RM_NM_HEARTBEAT_INTERVAL_MS = 1000; 367 368 /** Number of worker threads that write the history data. */ 369 public static final String RM_HISTORY_WRITER_MULTI_THREADED_DISPATCHER_POOL_SIZE = 370 RM_PREFIX + "history-writer.multi-threaded-dispatcher.pool-size"; 371 public static final int DEFAULT_RM_HISTORY_WRITER_MULTI_THREADED_DISPATCHER_POOL_SIZE = 372 10; 373 374 /** 375 * The setting that controls whether yarn system metrics is published on the 376 * timeline server or not by RM. 377 */ 378 public static final String RM_SYSTEM_METRICS_PUBLISHER_ENABLED = 379 RM_PREFIX + "system-metrics-publisher.enabled"; 380 public static final boolean DEFAULT_RM_SYSTEM_METRICS_PUBLISHER_ENABLED = false; 381 382 public static final String RM_SYSTEM_METRICS_PUBLISHER_DISPATCHER_POOL_SIZE = 383 RM_PREFIX + "system-metrics-publisher.dispatcher.pool-size"; 384 public static final int DEFAULT_RM_SYSTEM_METRICS_PUBLISHER_DISPATCHER_POOL_SIZE = 385 10; 386 387 //RM delegation token related keys 388 public static final String RM_DELEGATION_KEY_UPDATE_INTERVAL_KEY = 389 RM_PREFIX + "delegation.key.update-interval"; 390 public static final long RM_DELEGATION_KEY_UPDATE_INTERVAL_DEFAULT = 391 24*60*60*1000; // 1 day 392 public static final String RM_DELEGATION_TOKEN_RENEW_INTERVAL_KEY = 393 RM_PREFIX + "delegation.token.renew-interval"; 394 public static final long RM_DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT = 395 24*60*60*1000; // 1 day 396 public static final String RM_DELEGATION_TOKEN_MAX_LIFETIME_KEY = 397 RM_PREFIX + "delegation.token.max-lifetime"; 398 public static final long RM_DELEGATION_TOKEN_MAX_LIFETIME_DEFAULT = 399 7*24*60*60*1000; // 7 days 400 401 public static final String RECOVERY_ENABLED = RM_PREFIX + "recovery.enabled"; 402 public static final boolean DEFAULT_RM_RECOVERY_ENABLED = false; 403 404 public static final String YARN_FAIL_FAST = YARN_PREFIX + "fail-fast"; 405 public static final boolean DEFAULT_YARN_FAIL_FAST = false; 406 407 public static final String RM_FAIL_FAST = RM_PREFIX + "fail-fast"; 408 409 @Private 410 public static final String RM_WORK_PRESERVING_RECOVERY_ENABLED = RM_PREFIX 411 + "work-preserving-recovery.enabled"; 412 @Private 413 public static final boolean DEFAULT_RM_WORK_PRESERVING_RECOVERY_ENABLED = 414 true; 415 416 public static final String RM_WORK_PRESERVING_RECOVERY_SCHEDULING_WAIT_MS = 417 RM_PREFIX + "work-preserving-recovery.scheduling-wait-ms"; 418 public static final long DEFAULT_RM_WORK_PRESERVING_RECOVERY_SCHEDULING_WAIT_MS = 419 10000; 420 421 /** Zookeeper interaction configs */ 422 public static final String RM_ZK_PREFIX = RM_PREFIX + "zk-"; 423 424 public static final String RM_ZK_ADDRESS = RM_ZK_PREFIX + "address"; 425 426 public static final String RM_ZK_NUM_RETRIES = RM_ZK_PREFIX + "num-retries"; 427 public static final int DEFAULT_ZK_RM_NUM_RETRIES = 1000; 428 429 public static final String RM_ZK_RETRY_INTERVAL_MS = 430 RM_ZK_PREFIX + "retry-interval-ms"; 431 public static final int DEFAULT_RM_ZK_RETRY_INTERVAL_MS = 1000; 432 433 public static final String RM_ZK_TIMEOUT_MS = RM_ZK_PREFIX + "timeout-ms"; 434 public static final int DEFAULT_RM_ZK_TIMEOUT_MS = 10000; 435 436 public static final String RM_ZK_ACL = RM_ZK_PREFIX + "acl"; 437 public static final String DEFAULT_RM_ZK_ACL = "world:anyone:rwcda"; 438 439 public static final String RM_ZK_AUTH = RM_ZK_PREFIX + "auth"; 440 441 public static final String ZK_STATE_STORE_PREFIX = 442 RM_PREFIX + "zk-state-store."; 443 444 /** Parent znode path under which ZKRMStateStore will create znodes */ 445 public static final String ZK_RM_STATE_STORE_PARENT_PATH = 446 ZK_STATE_STORE_PREFIX + "parent-path"; 447 public static final String DEFAULT_ZK_RM_STATE_STORE_PARENT_PATH = "/rmstore"; 448 449 /** Root node ACLs for fencing */ 450 public static final String ZK_RM_STATE_STORE_ROOT_NODE_ACL = 451 ZK_STATE_STORE_PREFIX + "root-node.acl"; 452 453 /** HA related configs */ 454 public static final String RM_HA_PREFIX = RM_PREFIX + "ha."; 455 public static final String RM_HA_ENABLED = RM_HA_PREFIX + "enabled"; 456 public static final boolean DEFAULT_RM_HA_ENABLED = false; 457 458 public static final String RM_HA_IDS = RM_HA_PREFIX + "rm-ids"; 459 public static final String RM_HA_ID = RM_HA_PREFIX + "id"; 460 461 /** Store the related configuration files in File System */ 462 public static final String FS_BASED_RM_CONF_STORE = RM_PREFIX 463 + "configuration.file-system-based-store"; 464 public static final String DEFAULT_FS_BASED_RM_CONF_STORE = "/yarn/conf"; 465 466 public static final String RM_CONFIGURATION_PROVIDER_CLASS = RM_PREFIX 467 + "configuration.provider-class"; 468 public static final String DEFAULT_RM_CONFIGURATION_PROVIDER_CLASS = 469 "org.apache.hadoop.yarn.LocalConfigurationProvider"; 470 471 public static final String YARN_AUTHORIZATION_PROVIDER = YARN_PREFIX 472 + "authorization-provider"; 473 private static final List<String> RM_SERVICES_ADDRESS_CONF_KEYS_HTTP = 474 Collections.unmodifiableList(Arrays.asList( 475 RM_ADDRESS, 476 RM_SCHEDULER_ADDRESS, 477 RM_ADMIN_ADDRESS, 478 RM_RESOURCE_TRACKER_ADDRESS, 479 RM_WEBAPP_ADDRESS)); 480 481 private static final List<String> RM_SERVICES_ADDRESS_CONF_KEYS_HTTPS = 482 Collections.unmodifiableList(Arrays.asList( 483 RM_ADDRESS, 484 RM_SCHEDULER_ADDRESS, 485 RM_ADMIN_ADDRESS, 486 RM_RESOURCE_TRACKER_ADDRESS, 487 RM_WEBAPP_HTTPS_ADDRESS)); 488 489 public static final String AUTO_FAILOVER_PREFIX = 490 RM_HA_PREFIX + "automatic-failover."; 491 492 public static final String AUTO_FAILOVER_ENABLED = 493 AUTO_FAILOVER_PREFIX + "enabled"; 494 public static final boolean DEFAULT_AUTO_FAILOVER_ENABLED = true; 495 496 public static final String AUTO_FAILOVER_EMBEDDED = 497 AUTO_FAILOVER_PREFIX + "embedded"; 498 public static final boolean DEFAULT_AUTO_FAILOVER_EMBEDDED = true; 499 500 public static final String AUTO_FAILOVER_ZK_BASE_PATH = 501 AUTO_FAILOVER_PREFIX + "zk-base-path"; 502 public static final String DEFAULT_AUTO_FAILOVER_ZK_BASE_PATH = 503 "/yarn-leader-election"; 504 505 public static final String CLIENT_FAILOVER_PREFIX = 506 YARN_PREFIX + "client.failover-"; 507 public static final String CLIENT_FAILOVER_PROXY_PROVIDER = 508 CLIENT_FAILOVER_PREFIX + "proxy-provider"; 509 public static final String DEFAULT_CLIENT_FAILOVER_PROXY_PROVIDER = 510 "org.apache.hadoop.yarn.client.ConfiguredRMFailoverProxyProvider"; 511 512 public static final String CLIENT_FAILOVER_MAX_ATTEMPTS = 513 CLIENT_FAILOVER_PREFIX + "max-attempts"; 514 515 public static final String CLIENT_FAILOVER_SLEEPTIME_BASE_MS = 516 CLIENT_FAILOVER_PREFIX + "sleep-base-ms"; 517 518 public static final String CLIENT_FAILOVER_SLEEPTIME_MAX_MS = 519 CLIENT_FAILOVER_PREFIX + "sleep-max-ms"; 520 521 public static final String CLIENT_FAILOVER_RETRIES = 522 CLIENT_FAILOVER_PREFIX + "retries"; 523 public static final int DEFAULT_CLIENT_FAILOVER_RETRIES = 0; 524 525 public static final String CLIENT_FAILOVER_RETRIES_ON_SOCKET_TIMEOUTS = 526 CLIENT_FAILOVER_PREFIX + "retries-on-socket-timeouts"; 527 public static final int 528 DEFAULT_CLIENT_FAILOVER_RETRIES_ON_SOCKET_TIMEOUTS = 0; 529 530 //////////////////////////////// 531 // RM state store configs 532 //////////////////////////////// 533 /** The class to use as the persistent store.*/ 534 public static final String RM_STORE = RM_PREFIX + "store.class"; 535 536 /** URI for FileSystemRMStateStore */ 537 public static final String FS_RM_STATE_STORE_URI = RM_PREFIX 538 + "fs.state-store.uri"; 539 public static final String FS_RM_STATE_STORE_RETRY_POLICY_SPEC = RM_PREFIX 540 + "fs.state-store.retry-policy-spec"; 541 public static final String DEFAULT_FS_RM_STATE_STORE_RETRY_POLICY_SPEC = 542 "2000, 500"; 543 544 public static final String FS_RM_STATE_STORE_NUM_RETRIES = 545 RM_PREFIX + "fs.state-store.num-retries"; 546 public static final int DEFAULT_FS_RM_STATE_STORE_NUM_RETRIES = 0; 547 548 public static final String FS_RM_STATE_STORE_RETRY_INTERVAL_MS = 549 RM_PREFIX + "fs.state-store.retry-interval-ms"; 550 public static final long DEFAULT_FS_RM_STATE_STORE_RETRY_INTERVAL_MS = 551 1000L; 552 553 public static final String RM_LEVELDB_STORE_PATH = RM_PREFIX 554 + "leveldb-state-store.path"; 555 556 /** The maximum number of completed applications RM keeps. */ 557 public static final String RM_MAX_COMPLETED_APPLICATIONS = 558 RM_PREFIX + "max-completed-applications"; 559 public static final int DEFAULT_RM_MAX_COMPLETED_APPLICATIONS = 10000; 560 561 /** 562 * The maximum number of completed applications RM state store keeps, by 563 * default equals to DEFAULT_RM_MAX_COMPLETED_APPLICATIONS 564 */ 565 public static final String RM_STATE_STORE_MAX_COMPLETED_APPLICATIONS = 566 RM_PREFIX + "state-store.max-completed-applications"; 567 public static final int DEFAULT_RM_STATE_STORE_MAX_COMPLETED_APPLICATIONS = 568 DEFAULT_RM_MAX_COMPLETED_APPLICATIONS; 569 570 /** Default application name */ 571 public static final String DEFAULT_APPLICATION_NAME = "N/A"; 572 573 /** Default application type */ 574 public static final String DEFAULT_APPLICATION_TYPE = "YARN"; 575 576 /** Default application type length */ 577 public static final int APPLICATION_TYPE_LENGTH = 20; 578 579 /** Default queue name */ 580 public static final String DEFAULT_QUEUE_NAME = "default"; 581 582 /** 583 * Buckets (in minutes) for the number of apps running in each queue. 584 */ 585 public static final String RM_METRICS_RUNTIME_BUCKETS = 586 RM_PREFIX + "metrics.runtime.buckets"; 587 588 /** 589 * Default sizes of the runtime metric buckets in minutes. 590 */ 591 public static final String DEFAULT_RM_METRICS_RUNTIME_BUCKETS = 592 "60,300,1440"; 593 594 public static final String RM_AMRM_TOKEN_MASTER_KEY_ROLLING_INTERVAL_SECS = RM_PREFIX 595 + "am-rm-tokens.master-key-rolling-interval-secs"; 596 597 public static final long DEFAULT_RM_AMRM_TOKEN_MASTER_KEY_ROLLING_INTERVAL_SECS = 598 24 * 60 * 60; 599 600 public static final String RM_CONTAINER_TOKEN_MASTER_KEY_ROLLING_INTERVAL_SECS = 601 RM_PREFIX + "container-tokens.master-key-rolling-interval-secs"; 602 603 public static final long DEFAULT_RM_CONTAINER_TOKEN_MASTER_KEY_ROLLING_INTERVAL_SECS = 604 24 * 60 * 60; 605 606 public static final String RM_NMTOKEN_MASTER_KEY_ROLLING_INTERVAL_SECS = 607 RM_PREFIX + "nm-tokens.master-key-rolling-interval-secs"; 608 609 public static final long DEFAULT_RM_NMTOKEN_MASTER_KEY_ROLLING_INTERVAL_SECS = 610 24 * 60 * 60; 611 612 public static final String RM_NODEMANAGER_MINIMUM_VERSION = 613 RM_PREFIX + "nodemanager.minimum.version"; 614 615 public static final String DEFAULT_RM_NODEMANAGER_MINIMUM_VERSION = 616 "NONE"; 617 618 /** 619 * RM proxy users' prefix 620 */ 621 public static final String RM_PROXY_USER_PREFIX = RM_PREFIX + "proxyuser."; 622 623 //////////////////////////////// 624 // Node Manager Configs 625 //////////////////////////////// 626 627 /** Prefix for all node manager configs.*/ 628 public static final String NM_PREFIX = "yarn.nodemanager."; 629 630 /** Environment variables that will be sent to containers.*/ 631 public static final String NM_ADMIN_USER_ENV = NM_PREFIX + "admin-env"; 632 public static final String DEFAULT_NM_ADMIN_USER_ENV = "MALLOC_ARENA_MAX=$MALLOC_ARENA_MAX"; 633 634 /** Environment variables that containers may override rather than use NodeManager's default.*/ 635 public static final String NM_ENV_WHITELIST = NM_PREFIX + "env-whitelist"; 636 public static final String DEFAULT_NM_ENV_WHITELIST = StringUtils.join(",", 637 Arrays.asList(ApplicationConstants.Environment.JAVA_HOME.key(), 638 ApplicationConstants.Environment.HADOOP_COMMON_HOME.key(), 639 ApplicationConstants.Environment.HADOOP_HDFS_HOME.key(), 640 ApplicationConstants.Environment.HADOOP_CONF_DIR.key(), 641 ApplicationConstants.Environment.CLASSPATH_PREPEND_DISTCACHE.key(), 642 ApplicationConstants.Environment.HADOOP_YARN_HOME.key())); 643 644 /** address of node manager IPC.*/ 645 public static final String NM_ADDRESS = NM_PREFIX + "address"; 646 public static final int DEFAULT_NM_PORT = 0; 647 public static final String DEFAULT_NM_ADDRESS = "0.0.0.0:" 648 + DEFAULT_NM_PORT; 649 650 /** The actual bind address or the NM.*/ 651 public static final String NM_BIND_HOST = 652 NM_PREFIX + "bind-host"; 653 654 /** who will execute(launch) the containers.*/ 655 public static final String NM_CONTAINER_EXECUTOR = 656 NM_PREFIX + "container-executor.class"; 657 658 /** 659 * Adjustment to make to the container os scheduling priority. 660 * The valid values for this could vary depending on the platform. 661 * On Linux, higher values mean run the containers at a less 662 * favorable priority than the NM. 663 * The value specified is an int. 664 */ 665 public static final String NM_CONTAINER_EXECUTOR_SCHED_PRIORITY = 666 NM_PREFIX + "container-executor.os.sched.priority.adjustment"; 667 public static final int DEFAULT_NM_CONTAINER_EXECUTOR_SCHED_PRIORITY = 0; 668 669 /** Number of threads container manager uses.*/ 670 public static final String NM_CONTAINER_MGR_THREAD_COUNT = 671 NM_PREFIX + "container-manager.thread-count"; 672 public static final int DEFAULT_NM_CONTAINER_MGR_THREAD_COUNT = 20; 673 674 /** Number of threads used in cleanup.*/ 675 public static final String NM_DELETE_THREAD_COUNT = 676 NM_PREFIX + "delete.thread-count"; 677 public static final int DEFAULT_NM_DELETE_THREAD_COUNT = 4; 678 679 /** Keytab for NM.*/ 680 public static final String NM_KEYTAB = NM_PREFIX + "keytab"; 681 682 /**List of directories to store localized files in.*/ 683 public static final String NM_LOCAL_DIRS = NM_PREFIX + "local-dirs"; 684 public static final String DEFAULT_NM_LOCAL_DIRS = "/tmp/nm-local-dir"; 685 686 /** 687 * Number of files in each localized directories 688 * Avoid tuning this too low. 689 */ 690 public static final String NM_LOCAL_CACHE_MAX_FILES_PER_DIRECTORY = 691 NM_PREFIX + "local-cache.max-files-per-directory"; 692 public static final int DEFAULT_NM_LOCAL_CACHE_MAX_FILES_PER_DIRECTORY = 8192; 693 694 /** Address where the localizer IPC is.*/ 695 public static final String NM_LOCALIZER_ADDRESS = 696 NM_PREFIX + "localizer.address"; 697 public static final int DEFAULT_NM_LOCALIZER_PORT = 8040; 698 public static final String DEFAULT_NM_LOCALIZER_ADDRESS = "0.0.0.0:" + 699 DEFAULT_NM_LOCALIZER_PORT; 700 701 /** Interval in between cache cleanups.*/ 702 public static final String NM_LOCALIZER_CACHE_CLEANUP_INTERVAL_MS = 703 NM_PREFIX + "localizer.cache.cleanup.interval-ms"; 704 public static final long DEFAULT_NM_LOCALIZER_CACHE_CLEANUP_INTERVAL_MS = 705 10 * 60 * 1000; 706 707 /** 708 * Target size of localizer cache in MB, per nodemanager. It is a target 709 * retention size that only includes resources with PUBLIC and PRIVATE 710 * visibility and excludes resources with APPLICATION visibility 711 */ 712 public static final String NM_LOCALIZER_CACHE_TARGET_SIZE_MB = 713 NM_PREFIX + "localizer.cache.target-size-mb"; 714 public static final long DEFAULT_NM_LOCALIZER_CACHE_TARGET_SIZE_MB = 10 * 1024; 715 716 /** Number of threads to handle localization requests.*/ 717 public static final String NM_LOCALIZER_CLIENT_THREAD_COUNT = 718 NM_PREFIX + "localizer.client.thread-count"; 719 public static final int DEFAULT_NM_LOCALIZER_CLIENT_THREAD_COUNT = 5; 720 721 /** Number of threads to use for localization fetching.*/ 722 public static final String NM_LOCALIZER_FETCH_THREAD_COUNT = 723 NM_PREFIX + "localizer.fetch.thread-count"; 724 public static final int DEFAULT_NM_LOCALIZER_FETCH_THREAD_COUNT = 4; 725 726 /** Where to store container logs.*/ 727 public static final String NM_LOG_DIRS = NM_PREFIX + "log-dirs"; 728 public static final String DEFAULT_NM_LOG_DIRS = "/tmp/logs"; 729 730 public static final String NM_RESOURCEMANAGER_MINIMUM_VERSION = 731 NM_PREFIX + "resourcemanager.minimum.version"; 732 public static final String DEFAULT_NM_RESOURCEMANAGER_MINIMUM_VERSION = "NONE"; 733 734 /** Interval at which the delayed token removal thread runs */ 735 public static final String RM_DELAYED_DELEGATION_TOKEN_REMOVAL_INTERVAL_MS = 736 RM_PREFIX + "delayed.delegation-token.removal-interval-ms"; 737 public static final long DEFAULT_RM_DELAYED_DELEGATION_TOKEN_REMOVAL_INTERVAL_MS = 738 30000l; 739 740 /** Delegation Token renewer thread count */ 741 public static final String RM_DELEGATION_TOKEN_RENEWER_THREAD_COUNT = 742 RM_PREFIX + "delegation-token-renewer.thread-count"; 743 public static final int DEFAULT_RM_DELEGATION_TOKEN_RENEWER_THREAD_COUNT = 50; 744 745 public static final String RM_PROXY_USER_PRIVILEGES_ENABLED = RM_PREFIX 746 + "proxy-user-privileges.enabled"; 747 public static final boolean DEFAULT_RM_PROXY_USER_PRIVILEGES_ENABLED = false; 748 749 /** The expiry interval for node IP caching. -1 disables the caching */ 750 public static final String RM_NODE_IP_CACHE_EXPIRY_INTERVAL_SECS = RM_PREFIX 751 + "node-ip-cache.expiry-interval-secs"; 752 public static final int DEFAULT_RM_NODE_IP_CACHE_EXPIRY_INTERVAL_SECS = -1; 753 754 /** 755 * How many diagnostics/failure messages can be saved in RM for 756 * log aggregation. It also defines the number of diagnostics/failure 757 * messages can be shown in log aggregation web ui. 758 */ 759 public static final String RM_MAX_LOG_AGGREGATION_DIAGNOSTICS_IN_MEMORY = 760 RM_PREFIX + "max-log-aggregation-diagnostics-in-memory"; 761 public static final int DEFAULT_RM_MAX_LOG_AGGREGATION_DIAGNOSTICS_IN_MEMORY = 762 10; 763 764 /** Whether to enable log aggregation */ 765 public static final String LOG_AGGREGATION_ENABLED = YARN_PREFIX 766 + "log-aggregation-enable"; 767 public static final boolean DEFAULT_LOG_AGGREGATION_ENABLED = false; 768 769 /** 770 * How long to wait before deleting aggregated logs, -1 disables. 771 * Be careful set this too small and you will spam the name node. 772 */ 773 public static final String LOG_AGGREGATION_RETAIN_SECONDS = YARN_PREFIX 774 + "log-aggregation.retain-seconds"; 775 public static final long DEFAULT_LOG_AGGREGATION_RETAIN_SECONDS = -1; 776 777 /** 778 * How long to wait between aggregated log retention checks. If set to 779 * a value {@literal <=} 0 then the value is computed as one-tenth of the 780 * log retention setting. Be careful set this too small and you will spam 781 * the name node. 782 */ 783 public static final String LOG_AGGREGATION_RETAIN_CHECK_INTERVAL_SECONDS = 784 YARN_PREFIX + "log-aggregation.retain-check-interval-seconds"; 785 public static final long DEFAULT_LOG_AGGREGATION_RETAIN_CHECK_INTERVAL_SECONDS = -1; 786 787 /** 788 * How long for ResourceManager to wait for NodeManager to report its 789 * log aggregation status. If waiting time of which the log aggregation status 790 * is reported from NodeManager exceeds the configured value, RM will report 791 * log aggregation status for this NodeManager as TIME_OUT 792 */ 793 public static final String LOG_AGGREGATION_STATUS_TIME_OUT_MS = 794 YARN_PREFIX + "log-aggregation-status.time-out.ms"; 795 public static final long DEFAULT_LOG_AGGREGATION_STATUS_TIME_OUT_MS 796 = 10 * 60 * 1000; 797 798 /** 799 * Number of seconds to retain logs on the NodeManager. Only applicable if Log 800 * aggregation is disabled 801 */ 802 public static final String NM_LOG_RETAIN_SECONDS = NM_PREFIX 803 + "log.retain-seconds"; 804 public static final long DEFAULT_NM_LOG_RETAIN_SECONDS = 3 * 60 * 60; 805 806 /** 807 * Define how often NMs wake up and upload log files 808 */ 809 public static final String NM_LOG_AGGREGATION_ROLL_MONITORING_INTERVAL_SECONDS = 810 NM_PREFIX + "log-aggregation.roll-monitoring-interval-seconds"; 811 public static final long 812 DEFAULT_NM_LOG_AGGREGATION_ROLL_MONITORING_INTERVAL_SECONDS = -1; 813 /** 814 * Number of threads used in log cleanup. Only applicable if Log aggregation 815 * is disabled 816 */ 817 public static final String NM_LOG_DELETION_THREADS_COUNT = 818 NM_PREFIX + "log.deletion-threads-count"; 819 public static final int DEFAULT_NM_LOG_DELETE_THREAD_COUNT = 4; 820 821 /** Where to aggregate logs to.*/ 822 public static final String NM_REMOTE_APP_LOG_DIR = 823 NM_PREFIX + "remote-app-log-dir"; 824 public static final String DEFAULT_NM_REMOTE_APP_LOG_DIR = "/tmp/logs"; 825 826 /** 827 * The remote log dir will be created at 828 * NM_REMOTE_APP_LOG_DIR/${user}/NM_REMOTE_APP_LOG_DIR_SUFFIX/${appId} 829 */ 830 public static final String NM_REMOTE_APP_LOG_DIR_SUFFIX = 831 NM_PREFIX + "remote-app-log-dir-suffix"; 832 public static final String DEFAULT_NM_REMOTE_APP_LOG_DIR_SUFFIX="logs"; 833 834 public static final String YARN_LOG_SERVER_URL = 835 YARN_PREFIX + "log.server.url"; 836 837 public static final String YARN_TRACKING_URL_GENERATOR = 838 YARN_PREFIX + "tracking.url.generator"; 839 840 /** Amount of memory in MB that can be allocated for containers.*/ 841 public static final String NM_PMEM_MB = NM_PREFIX + "resource.memory-mb"; 842 public static final int DEFAULT_NM_PMEM_MB = 8 * 1024; 843 844 /** Amount of memory in MB that has been reserved for non-yarn use. */ 845 public static final String NM_SYSTEM_RESERVED_PMEM_MB = NM_PREFIX 846 + "resource.system-reserved-memory-mb"; 847 848 /** Specifies whether physical memory check is enabled. */ 849 public static final String NM_PMEM_CHECK_ENABLED = NM_PREFIX 850 + "pmem-check-enabled"; 851 public static final boolean DEFAULT_NM_PMEM_CHECK_ENABLED = true; 852 853 /** Specifies whether physical memory check is enabled. */ 854 public static final String NM_VMEM_CHECK_ENABLED = NM_PREFIX 855 + "vmem-check-enabled"; 856 public static final boolean DEFAULT_NM_VMEM_CHECK_ENABLED = true; 857 858 /** Conversion ratio for physical memory to virtual memory. */ 859 public static final String NM_VMEM_PMEM_RATIO = 860 NM_PREFIX + "vmem-pmem-ratio"; 861 public static final float DEFAULT_NM_VMEM_PMEM_RATIO = 2.1f; 862 863 /** Number of Virtual CPU Cores which can be allocated for containers.*/ 864 public static final String NM_VCORES = NM_PREFIX + "resource.cpu-vcores"; 865 public static final int DEFAULT_NM_VCORES = 8; 866 867 /** Count logical processors(like hyperthreads) as cores. */ 868 public static final String NM_COUNT_LOGICAL_PROCESSORS_AS_CORES = NM_PREFIX 869 + "resource.count-logical-processors-as-cores"; 870 public static final boolean DEFAULT_NM_COUNT_LOGICAL_PROCESSORS_AS_CORES = 871 false; 872 873 /** Multiplier to convert physical cores to vcores. */ 874 public static final String NM_PCORES_VCORES_MULTIPLIER = NM_PREFIX 875 + "resource.pcores-vcores-multiplier"; 876 public static final float DEFAULT_NM_PCORES_VCORES_MULTIPLIER = 1.0f; 877 878 /** Percentage of overall CPU which can be allocated for containers. */ 879 public static final String NM_RESOURCE_PERCENTAGE_PHYSICAL_CPU_LIMIT = 880 NM_PREFIX + "resource.percentage-physical-cpu-limit"; 881 public static final int DEFAULT_NM_RESOURCE_PERCENTAGE_PHYSICAL_CPU_LIMIT = 882 100; 883 884 /** Enable or disable node hardware capability detection. */ 885 public static final String NM_ENABLE_HARDWARE_CAPABILITY_DETECTION = 886 NM_PREFIX + "resource.detect-hardware-capabilities"; 887 public static final boolean DEFAULT_NM_ENABLE_HARDWARE_CAPABILITY_DETECTION = 888 false; 889 890 /** 891 * Prefix for disk configurations. Work in progress: This configuration 892 * parameter may be changed/removed in the future. 893 */ 894 @Private 895 public static final String NM_DISK_RESOURCE_PREFIX = NM_PREFIX 896 + "resource.disk."; 897 /** 898 * This setting controls if resource handling for disk operations is enabled. 899 * Work in progress: This configuration parameter may be changed/removed in 900 * the future 901 */ 902 @Private 903 public static final String NM_DISK_RESOURCE_ENABLED = NM_DISK_RESOURCE_PREFIX 904 + "enabled"; 905 /** Disk as a resource is disabled by default. **/ 906 @Private 907 public static final boolean DEFAULT_NM_DISK_RESOURCE_ENABLED = false; 908 909 public static final String NM_NETWORK_RESOURCE_PREFIX = NM_PREFIX 910 + "resource.network."; 911 912 /** 913 * This setting controls if resource handling for network bandwidth is 914 * enabled. Work in progress: This configuration parameter may be 915 * changed/removed in the future 916 */ 917 @Private 918 public static final String NM_NETWORK_RESOURCE_ENABLED = 919 NM_NETWORK_RESOURCE_PREFIX + "enabled"; 920 /** Network as a resource is disabled by default. **/ 921 @Private 922 public static final boolean DEFAULT_NM_NETWORK_RESOURCE_ENABLED = false; 923 924 /** 925 * Specifies the interface to be used for applying network throttling rules. 926 * Work in progress: This configuration parameter may be changed/removed in 927 * the future 928 */ 929 @Private 930 public static final String NM_NETWORK_RESOURCE_INTERFACE = 931 NM_NETWORK_RESOURCE_PREFIX + "interface"; 932 @Private 933 public static final String DEFAULT_NM_NETWORK_RESOURCE_INTERFACE = "eth0"; 934 935 /** 936 * Specifies the total available outbound bandwidth on the node. Work in 937 * progress: This configuration parameter may be changed/removed in the future 938 */ 939 @Private 940 public static final String NM_NETWORK_RESOURCE_OUTBOUND_BANDWIDTH_MBIT = 941 NM_NETWORK_RESOURCE_PREFIX + "outbound-bandwidth-mbit"; 942 @Private 943 public static final int DEFAULT_NM_NETWORK_RESOURCE_OUTBOUND_BANDWIDTH_MBIT = 944 1000; 945 946 /** 947 * Specifies the total outbound bandwidth available to YARN containers. 948 * defaults to NM_NETWORK_RESOURCE_OUTBOUND_BANDWIDTH_MBIT if not specified. 949 * Work in progress: This configuration parameter may be changed/removed in 950 * the future 951 */ 952 @Private 953 public static final String NM_NETWORK_RESOURCE_OUTBOUND_BANDWIDTH_YARN_MBIT = 954 NM_NETWORK_RESOURCE_PREFIX + "outbound-bandwidth-yarn-mbit"; 955 956 /** NM Webapp address.**/ 957 public static final String NM_WEBAPP_ADDRESS = NM_PREFIX + "webapp.address"; 958 public static final int DEFAULT_NM_WEBAPP_PORT = 8042; 959 public static final String DEFAULT_NM_WEBAPP_ADDRESS = "0.0.0.0:" + 960 DEFAULT_NM_WEBAPP_PORT; 961 962 /** NM Webapp https address.**/ 963 public static final String NM_WEBAPP_HTTPS_ADDRESS = NM_PREFIX 964 + "webapp.https.address"; 965 public static final int DEFAULT_NM_WEBAPP_HTTPS_PORT = 8044; 966 public static final String DEFAULT_NM_WEBAPP_HTTPS_ADDRESS = "0.0.0.0:" 967 + DEFAULT_NM_WEBAPP_HTTPS_PORT; 968 969 /** How often to monitor resource in a node.*/ 970 public static final String NM_RESOURCE_MON_INTERVAL_MS = 971 NM_PREFIX + "resource-monitor.interval-ms"; 972 public static final int DEFAULT_NM_RESOURCE_MON_INTERVAL_MS = 3000; 973 974 /** How often to monitor containers.*/ 975 public final static String NM_CONTAINER_MON_INTERVAL_MS = 976 NM_PREFIX + "container-monitor.interval-ms"; 977 @Deprecated 978 public final static int DEFAULT_NM_CONTAINER_MON_INTERVAL_MS = 3000; 979 980 /** Class that calculates current resource utilization.*/ 981 public static final String NM_MON_RESOURCE_CALCULATOR = 982 NM_PREFIX + "resource-calculator.class"; 983 /** Class that calculates containers current resource utilization.*/ 984 public static final String NM_CONTAINER_MON_RESOURCE_CALCULATOR = 985 NM_PREFIX + "container-monitor.resource-calculator.class"; 986 /** Class that calculates process tree resource utilization.*/ 987 public static final String NM_CONTAINER_MON_PROCESS_TREE = 988 NM_PREFIX + "container-monitor.process-tree.class"; 989 public static final String PROCFS_USE_SMAPS_BASED_RSS_ENABLED = NM_PREFIX + 990 "container-monitor.procfs-tree.smaps-based-rss.enabled"; 991 public static final boolean DEFAULT_PROCFS_USE_SMAPS_BASED_RSS_ENABLED = 992 false; 993 994 /** Enable/disable container metrics. */ 995 @Private 996 public static final String NM_CONTAINER_METRICS_ENABLE = 997 NM_PREFIX + "container-metrics.enable"; 998 @Private 999 public static final boolean DEFAULT_NM_CONTAINER_METRICS_ENABLE = true; 1000 1001 /** Container metrics flush period. -1 for flush on completion. */ 1002 @Private 1003 public static final String NM_CONTAINER_METRICS_PERIOD_MS = 1004 NM_PREFIX + "container-metrics.period-ms"; 1005 @Private 1006 public static final int DEFAULT_NM_CONTAINER_METRICS_PERIOD_MS = -1; 1007 1008 /** Prefix for all node manager disk health checker configs. */ 1009 private static final String NM_DISK_HEALTH_CHECK_PREFIX = 1010 "yarn.nodemanager.disk-health-checker."; 1011 /** 1012 * Enable/Disable disks' health checker. Default is true. An expert level 1013 * configuration property. 1014 */ 1015 public static final String NM_DISK_HEALTH_CHECK_ENABLE = 1016 NM_DISK_HEALTH_CHECK_PREFIX + "enable"; 1017 /** Frequency of running disks' health checker. */ 1018 public static final String NM_DISK_HEALTH_CHECK_INTERVAL_MS = 1019 NM_DISK_HEALTH_CHECK_PREFIX + "interval-ms"; 1020 /** By default, disks' health is checked every 2 minutes. */ 1021 public static final long DEFAULT_NM_DISK_HEALTH_CHECK_INTERVAL_MS = 1022 2 * 60 * 1000; 1023 1024 /** 1025 * The minimum fraction of number of disks to be healthy for the nodemanager 1026 * to launch new containers. This applies to nm-local-dirs and nm-log-dirs. 1027 */ 1028 public static final String NM_MIN_HEALTHY_DISKS_FRACTION = 1029 NM_DISK_HEALTH_CHECK_PREFIX + "min-healthy-disks"; 1030 /** 1031 * By default, at least 25% of disks are to be healthy to say that the node is 1032 * healthy in terms of disks. 1033 */ 1034 public static final float DEFAULT_NM_MIN_HEALTHY_DISKS_FRACTION = 0.25F; 1035 1036 /** 1037 * The maximum percentage of disk space that can be used after which a disk is 1038 * marked as offline. Values can range from 0.0 to 100.0. If the value is 1039 * greater than or equal to 100, NM will check for full disk. This applies to 1040 * nm-local-dirs and nm-log-dirs. 1041 */ 1042 public static final String NM_MAX_PER_DISK_UTILIZATION_PERCENTAGE = 1043 NM_DISK_HEALTH_CHECK_PREFIX + "max-disk-utilization-per-disk-percentage"; 1044 /** 1045 * By default, 90% of the disk can be used before it is marked as offline. 1046 */ 1047 public static final float DEFAULT_NM_MAX_PER_DISK_UTILIZATION_PERCENTAGE = 1048 90.0F; 1049 1050 /** 1051 * The minimum space that must be available on a local dir for it to be used. 1052 * This applies to nm-local-dirs and nm-log-dirs. 1053 */ 1054 public static final String NM_MIN_PER_DISK_FREE_SPACE_MB = 1055 NM_DISK_HEALTH_CHECK_PREFIX + "min-free-space-per-disk-mb"; 1056 /** 1057 * By default, all of the disk can be used before it is marked as offline. 1058 */ 1059 public static final long DEFAULT_NM_MIN_PER_DISK_FREE_SPACE_MB = 0; 1060 1061 /** Frequency of running node health script.*/ 1062 public static final String NM_HEALTH_CHECK_INTERVAL_MS = 1063 NM_PREFIX + "health-checker.interval-ms"; 1064 public static final long DEFAULT_NM_HEALTH_CHECK_INTERVAL_MS = 10 * 60 * 1000; 1065 1066 /** Health check script time out period.*/ 1067 public static final String NM_HEALTH_CHECK_SCRIPT_TIMEOUT_MS = 1068 NM_PREFIX + "health-checker.script.timeout-ms"; 1069 public static final long DEFAULT_NM_HEALTH_CHECK_SCRIPT_TIMEOUT_MS = 1070 2 * DEFAULT_NM_HEALTH_CHECK_INTERVAL_MS; 1071 1072 /** The health check script to run.*/ 1073 public static final String NM_HEALTH_CHECK_SCRIPT_PATH = 1074 NM_PREFIX + "health-checker.script.path"; 1075 1076 /** The arguments to pass to the health check script.*/ 1077 public static final String NM_HEALTH_CHECK_SCRIPT_OPTS = 1078 NM_PREFIX + "health-checker.script.opts"; 1079 1080 /** The JVM options used on forking ContainerLocalizer process 1081 by container executor. */ 1082 public static final String NM_CONTAINER_LOCALIZER_JAVA_OPTS_KEY = 1083 NM_PREFIX + "container-localizer.java.opts"; 1084 public static final String NM_CONTAINER_LOCALIZER_JAVA_OPTS_DEFAULT = 1085 "-Xmx256m"; 1086 1087 /** The Docker image name(For DockerContainerExecutor).*/ 1088 public static final String NM_DOCKER_CONTAINER_EXECUTOR_IMAGE_NAME = 1089 NM_PREFIX + "docker-container-executor.image-name"; 1090 1091 /** The name of the docker executor (For DockerContainerExecutor).*/ 1092 public static final String NM_DOCKER_CONTAINER_EXECUTOR_EXEC_NAME = 1093 NM_PREFIX + "docker-container-executor.exec-name"; 1094 1095 /** The default docker executor (For DockerContainerExecutor).*/ 1096 public static final String NM_DEFAULT_DOCKER_CONTAINER_EXECUTOR_EXEC_NAME = 1097 "/usr/bin/docker"; 1098 1099 /** The path to the Linux container executor.*/ 1100 public static final String NM_LINUX_CONTAINER_EXECUTOR_PATH = 1101 NM_PREFIX + "linux-container-executor.path"; 1102 1103 /** 1104 * The UNIX group that the linux-container-executor should run as. 1105 * This is intended to be set as part of container-executor.cfg. 1106 */ 1107 public static final String NM_LINUX_CONTAINER_GROUP = 1108 NM_PREFIX + "linux-container-executor.group"; 1109 1110 /** 1111 * If linux-container-executor should limit itself to one user 1112 * when running in non-secure mode. 1113 */ 1114 public static final String NM_NONSECURE_MODE_LIMIT_USERS= NM_PREFIX + 1115 "linux-container-executor.nonsecure-mode.limit-users"; 1116 1117 public static final boolean DEFAULT_NM_NONSECURE_MODE_LIMIT_USERS = true; 1118 1119 /** 1120 * The UNIX user that containers will run as when Linux-container-executor 1121 * is used in nonsecure mode (a use case for this is using cgroups). 1122 */ 1123 public static final String NM_NONSECURE_MODE_LOCAL_USER_KEY = NM_PREFIX + 1124 "linux-container-executor.nonsecure-mode.local-user"; 1125 1126 public static final String DEFAULT_NM_NONSECURE_MODE_LOCAL_USER = "nobody"; 1127 1128 /** 1129 * The allowed pattern for UNIX user names enforced by 1130 * Linux-container-executor when used in nonsecure mode (use case for this 1131 * is using cgroups). The default value is taken from /usr/sbin/adduser 1132 */ 1133 public static final String NM_NONSECURE_MODE_USER_PATTERN_KEY = NM_PREFIX + 1134 "linux-container-executor.nonsecure-mode.user-pattern"; 1135 1136 public static final String DEFAULT_NM_NONSECURE_MODE_USER_PATTERN = 1137 "^[_.A-Za-z0-9][-@_.A-Za-z0-9]{0,255}?[$]?$"; 1138 1139 /** The type of resource enforcement to use with the 1140 * linux container executor. 1141 */ 1142 public static final String NM_LINUX_CONTAINER_RESOURCES_HANDLER = 1143 NM_PREFIX + "linux-container-executor.resources-handler.class"; 1144 1145 /** The path the linux container executor should use for cgroups */ 1146 public static final String NM_LINUX_CONTAINER_CGROUPS_HIERARCHY = 1147 NM_PREFIX + "linux-container-executor.cgroups.hierarchy"; 1148 1149 /** Whether the linux container executor should mount cgroups if not found */ 1150 public static final String NM_LINUX_CONTAINER_CGROUPS_MOUNT = 1151 NM_PREFIX + "linux-container-executor.cgroups.mount"; 1152 1153 /** Where the linux container executor should mount cgroups if not found */ 1154 public static final String NM_LINUX_CONTAINER_CGROUPS_MOUNT_PATH = 1155 NM_PREFIX + "linux-container-executor.cgroups.mount-path"; 1156 1157 /** 1158 * Whether the apps should run in strict resource usage mode(not allowed to 1159 * use spare CPU) 1160 */ 1161 public static final String NM_LINUX_CONTAINER_CGROUPS_STRICT_RESOURCE_USAGE = 1162 NM_PREFIX + "linux-container-executor.cgroups.strict-resource-usage"; 1163 public static final boolean DEFAULT_NM_LINUX_CONTAINER_CGROUPS_STRICT_RESOURCE_USAGE = 1164 false; 1165 1166 1167 1168 /** 1169 * Interval of time the linux container executor should try cleaning up 1170 * cgroups entry when cleaning up a container. This is required due to what 1171 * it seems a race condition because the SIGTERM/SIGKILL is asynch. 1172 */ 1173 public static final String NM_LINUX_CONTAINER_CGROUPS_DELETE_TIMEOUT = 1174 NM_PREFIX + "linux-container-executor.cgroups.delete-timeout-ms"; 1175 1176 public static final long DEFAULT_NM_LINUX_CONTAINER_CGROUPS_DELETE_TIMEOUT = 1177 1000; 1178 1179 /** 1180 * Delay between attempts to remove linux cgroup. 1181 */ 1182 public static final String NM_LINUX_CONTAINER_CGROUPS_DELETE_DELAY = 1183 NM_PREFIX + "linux-container-executor.cgroups.delete-delay-ms"; 1184 1185 public static final long DEFAULT_NM_LINUX_CONTAINER_CGROUPS_DELETE_DELAY = 1186 20; 1187 1188 /** 1189 * Indicates if memory and CPU limits will be set for the Windows Job 1190 * Object for the containers launched by the default container executor. 1191 */ 1192 public static final String NM_WINDOWS_CONTAINER_MEMORY_LIMIT_ENABLED = 1193 NM_PREFIX + "windows-container.memory-limit.enabled"; 1194 public static final boolean DEFAULT_NM_WINDOWS_CONTAINER_MEMORY_LIMIT_ENABLED = false; 1195 1196 public static final String NM_WINDOWS_CONTAINER_CPU_LIMIT_ENABLED = 1197 NM_PREFIX + "windows-container.cpu-limit.enabled"; 1198 public static final boolean DEFAULT_NM_WINDOWS_CONTAINER_CPU_LIMIT_ENABLED = false; 1199 1200 /** 1201 /* The Windows group that the windows-secure-container-executor should run as. 1202 */ 1203 public static final String NM_WINDOWS_SECURE_CONTAINER_GROUP = 1204 NM_PREFIX + "windows-secure-container-executor.group"; 1205 1206 /** T-file compression types used to compress aggregated logs.*/ 1207 public static final String NM_LOG_AGG_COMPRESSION_TYPE = 1208 NM_PREFIX + "log-aggregation.compression-type"; 1209 public static final String DEFAULT_NM_LOG_AGG_COMPRESSION_TYPE = "none"; 1210 1211 /** The kerberos principal for the node manager.*/ 1212 public static final String NM_PRINCIPAL = 1213 NM_PREFIX + "principal"; 1214 1215 public static final String NM_AUX_SERVICES = 1216 NM_PREFIX + "aux-services"; 1217 1218 public static final String NM_AUX_SERVICE_FMT = 1219 NM_PREFIX + "aux-services.%s.class"; 1220 1221 public static final String NM_USER_HOME_DIR = 1222 NM_PREFIX + "user-home-dir"; 1223 1224 /**The kerberos principal to be used for spnego filter for NM.*/ 1225 public static final String NM_WEBAPP_SPNEGO_USER_NAME_KEY = 1226 NM_PREFIX + "webapp.spnego-principal"; 1227 1228 /**The kerberos keytab to be used for spnego filter for NM.*/ 1229 public static final String NM_WEBAPP_SPNEGO_KEYTAB_FILE_KEY = 1230 NM_PREFIX + "webapp.spnego-keytab-file"; 1231 1232 public static final String DEFAULT_NM_USER_HOME_DIR= "/home/"; 1233 1234 public static final String NM_RECOVERY_PREFIX = NM_PREFIX + "recovery."; 1235 public static final String NM_RECOVERY_ENABLED = 1236 NM_RECOVERY_PREFIX + "enabled"; 1237 public static final boolean DEFAULT_NM_RECOVERY_ENABLED = false; 1238 1239 public static final String NM_RECOVERY_DIR = NM_RECOVERY_PREFIX + "dir"; 1240 1241 public static final String NM_RECOVERY_SUPERVISED = 1242 NM_RECOVERY_PREFIX + "supervised"; 1243 public static final boolean DEFAULT_NM_RECOVERY_SUPERVISED = false; 1244 1245 public static final String NM_LOG_AGG_POLICY_CLASS = 1246 NM_PREFIX + "log-aggregation.policy.class"; 1247 1248 public static final String NM_LOG_AGG_POLICY_CLASS_PARAMETERS = NM_PREFIX 1249 + "log-aggregation.policy.parameters"; 1250 1251 //////////////////////////////// 1252 // Web Proxy Configs 1253 //////////////////////////////// 1254 public static final String PROXY_PREFIX = "yarn.web-proxy."; 1255 1256 /** The kerberos principal for the proxy.*/ 1257 public static final String PROXY_PRINCIPAL = 1258 PROXY_PREFIX + "principal"; 1259 1260 /** Keytab for Proxy.*/ 1261 public static final String PROXY_KEYTAB = PROXY_PREFIX + "keytab"; 1262 1263 /** The address for the web proxy.*/ 1264 public static final String PROXY_ADDRESS = 1265 PROXY_PREFIX + "address"; 1266 public static final int DEFAULT_PROXY_PORT = 9099; 1267 public static final String DEFAULT_PROXY_ADDRESS = 1268 "0.0.0.0:" + DEFAULT_PROXY_PORT; 1269 1270 /** 1271 * YARN Service Level Authorization 1272 */ 1273 public static final String 1274 YARN_SECURITY_SERVICE_AUTHORIZATION_RESOURCETRACKER_PROTOCOL = 1275 "security.resourcetracker.protocol.acl"; 1276 public static final String 1277 YARN_SECURITY_SERVICE_AUTHORIZATION_APPLICATIONCLIENT_PROTOCOL = 1278 "security.applicationclient.protocol.acl"; 1279 public static final String 1280 YARN_SECURITY_SERVICE_AUTHORIZATION_RESOURCEMANAGER_ADMINISTRATION_PROTOCOL = 1281 "security.resourcemanager-administration.protocol.acl"; 1282 public static final String 1283 YARN_SECURITY_SERVICE_AUTHORIZATION_APPLICATIONMASTER_PROTOCOL = 1284 "security.applicationmaster.protocol.acl"; 1285 1286 public static final String 1287 YARN_SECURITY_SERVICE_AUTHORIZATION_CONTAINER_MANAGEMENT_PROTOCOL = 1288 "security.containermanagement.protocol.acl"; 1289 public static final String 1290 YARN_SECURITY_SERVICE_AUTHORIZATION_RESOURCE_LOCALIZER = 1291 "security.resourcelocalizer.protocol.acl"; 1292 1293 public static final String 1294 YARN_SECURITY_SERVICE_AUTHORIZATION_APPLICATIONHISTORY_PROTOCOL = 1295 "security.applicationhistory.protocol.acl"; 1296 1297 /** No. of milliseconds to wait between sending a SIGTERM and SIGKILL 1298 * to a running container */ 1299 public static final String NM_SLEEP_DELAY_BEFORE_SIGKILL_MS = 1300 NM_PREFIX + "sleep-delay-before-sigkill.ms"; 1301 public static final long DEFAULT_NM_SLEEP_DELAY_BEFORE_SIGKILL_MS = 1302 250; 1303 1304 /** Max time to wait for a process to come up when trying to cleanup 1305 * container resources */ 1306 public static final String NM_PROCESS_KILL_WAIT_MS = 1307 NM_PREFIX + "process-kill-wait.ms"; 1308 public static final long DEFAULT_NM_PROCESS_KILL_WAIT_MS = 1309 2000; 1310 1311 /** Max time to wait to establish a connection to RM */ 1312 public static final String RESOURCEMANAGER_CONNECT_MAX_WAIT_MS = 1313 RM_PREFIX + "connect.max-wait.ms"; 1314 public static final long DEFAULT_RESOURCEMANAGER_CONNECT_MAX_WAIT_MS = 1315 15 * 60 * 1000; 1316 1317 /** Time interval between each attempt to connect to RM */ 1318 public static final String RESOURCEMANAGER_CONNECT_RETRY_INTERVAL_MS = 1319 RM_PREFIX + "connect.retry-interval.ms"; 1320 public static final long DEFAULT_RESOURCEMANAGER_CONNECT_RETRY_INTERVAL_MS 1321 = 30 * 1000; 1322 1323 public static final String DISPATCHER_DRAIN_EVENTS_TIMEOUT = 1324 YARN_PREFIX + "dispatcher.drain-events.timeout"; 1325 1326 public static final long DEFAULT_DISPATCHER_DRAIN_EVENTS_TIMEOUT = 300000; 1327 1328 /** 1329 * CLASSPATH for YARN applications. A comma-separated list of CLASSPATH 1330 * entries 1331 */ 1332 public static final String YARN_APPLICATION_CLASSPATH = YARN_PREFIX 1333 + "application.classpath"; 1334 1335 public static final String AMRM_PROXY_ENABLED = NM_PREFIX 1336 + "amrmproxy.enable"; 1337 public static final boolean DEFAULT_AMRM_PROXY_ENABLED = false; 1338 public static final String AMRM_PROXY_ADDRESS = NM_PREFIX 1339 + "amrmproxy.address"; 1340 public static final int DEFAULT_AMRM_PROXY_PORT = 8048; 1341 public static final String DEFAULT_AMRM_PROXY_ADDRESS = "0.0.0.0:" 1342 + DEFAULT_AMRM_PROXY_PORT; 1343 public static final String AMRM_PROXY_CLIENT_THREAD_COUNT = NM_PREFIX 1344 + "amrmproxy.client.thread-count"; 1345 public static final int DEFAULT_AMRM_PROXY_CLIENT_THREAD_COUNT = 25; 1346 public static final String AMRM_PROXY_INTERCEPTOR_CLASS_PIPELINE = 1347 NM_PREFIX + "amrmproxy.interceptor-class.pipeline"; 1348 public static final String DEFAULT_AMRM_PROXY_INTERCEPTOR_CLASS_PIPELINE = 1349 "org.apache.hadoop.yarn.server.nodemanager.amrmproxy." 1350 + "DefaultRequestInterceptor"; 1351 1352 /** 1353 * Default platform-agnostic CLASSPATH for YARN applications. A 1354 * comma-separated list of CLASSPATH entries. The parameter expansion marker 1355 * will be replaced with real parameter expansion marker ('%' for Windows and 1356 * '$' for Linux) by NodeManager on container launch. For example: {{VAR}} 1357 * will be replaced as $VAR on Linux, and %VAR% on Windows. 1358 */ 1359 @Public 1360 @Unstable 1361 public static final String[] DEFAULT_YARN_CROSS_PLATFORM_APPLICATION_CLASSPATH= { 1362 ApplicationConstants.Environment.HADOOP_CONF_DIR.$$(), 1363 ApplicationConstants.Environment.HADOOP_COMMON_HOME.$$() 1364 + "/share/hadoop/common/*", 1365 ApplicationConstants.Environment.HADOOP_COMMON_HOME.$$() 1366 + "/share/hadoop/common/lib/*", 1367 ApplicationConstants.Environment.HADOOP_HDFS_HOME.$$() 1368 + "/share/hadoop/hdfs/*", 1369 ApplicationConstants.Environment.HADOOP_HDFS_HOME.$$() 1370 + "/share/hadoop/hdfs/lib/*", 1371 ApplicationConstants.Environment.HADOOP_YARN_HOME.$$() 1372 + "/share/hadoop/yarn/*", 1373 ApplicationConstants.Environment.HADOOP_YARN_HOME.$$() 1374 + "/share/hadoop/yarn/lib/*" }; 1375 /** 1376 * <p> 1377 * Default platform-specific CLASSPATH for YARN applications. A 1378 * comma-separated list of CLASSPATH entries constructed based on the client 1379 * OS environment expansion syntax. 1380 * </p> 1381 * <p> 1382 * Note: Use {@link #DEFAULT_YARN_CROSS_PLATFORM_APPLICATION_CLASSPATH} for 1383 * cross-platform practice i.e. submit an application from a Windows client to 1384 * a Linux/Unix server or vice versa. 1385 * </p> 1386 */ 1387 public static final String[] DEFAULT_YARN_APPLICATION_CLASSPATH = { 1388 ApplicationConstants.Environment.HADOOP_CONF_DIR.$(), 1389 ApplicationConstants.Environment.HADOOP_COMMON_HOME.$() 1390 + "/share/hadoop/common/*", 1391 ApplicationConstants.Environment.HADOOP_COMMON_HOME.$() 1392 + "/share/hadoop/common/lib/*", 1393 ApplicationConstants.Environment.HADOOP_HDFS_HOME.$() 1394 + "/share/hadoop/hdfs/*", 1395 ApplicationConstants.Environment.HADOOP_HDFS_HOME.$() 1396 + "/share/hadoop/hdfs/lib/*", 1397 ApplicationConstants.Environment.HADOOP_YARN_HOME.$() 1398 + "/share/hadoop/yarn/*", 1399 ApplicationConstants.Environment.HADOOP_YARN_HOME.$() 1400 + "/share/hadoop/yarn/lib/*" }; 1401 1402 /** Container temp directory */ 1403 public static final String DEFAULT_CONTAINER_TEMP_DIR = "./tmp"; 1404 1405 public static final String IS_MINI_YARN_CLUSTER = YARN_PREFIX 1406 + "is.minicluster"; 1407 1408 public static final String YARN_MC_PREFIX = YARN_PREFIX + "minicluster."; 1409 1410 /** Whether to use fixed ports with the minicluster. */ 1411 public static final String YARN_MINICLUSTER_FIXED_PORTS = 1412 YARN_MC_PREFIX + "fixed.ports"; 1413 1414 /** 1415 * Default is false to be able to run tests concurrently without port 1416 * conflicts. 1417 */ 1418 public static final boolean DEFAULT_YARN_MINICLUSTER_FIXED_PORTS = false; 1419 1420 /** 1421 * Whether the NM should use RPC to connect to the RM. Default is false. 1422 * Can be set to true only when using fixed ports. 1423 */ 1424 public static final String YARN_MINICLUSTER_USE_RPC = YARN_MC_PREFIX + "use-rpc"; 1425 public static final boolean DEFAULT_YARN_MINICLUSTER_USE_RPC = false; 1426 1427 /** 1428 * Whether users are explicitly trying to control resource monitoring 1429 * configuration for the MiniYARNCluster. Disabled by default. 1430 */ 1431 public static final String YARN_MINICLUSTER_CONTROL_RESOURCE_MONITORING = 1432 YARN_MC_PREFIX + "control-resource-monitoring"; 1433 public static final boolean 1434 DEFAULT_YARN_MINICLUSTER_CONTROL_RESOURCE_MONITORING = false; 1435 1436 /** Allow changing the memory for the NodeManager in the MiniYARNCluster */ 1437 public static final String YARN_MINICLUSTER_NM_PMEM_MB = 1438 YARN_MC_PREFIX + YarnConfiguration.NM_PMEM_MB; 1439 public static final int DEFAULT_YARN_MINICLUSTER_NM_PMEM_MB = 4 * 1024; 1440 1441 /** The log directory for the containers */ 1442 public static final String YARN_APP_CONTAINER_LOG_DIR = 1443 YARN_PREFIX + "app.container.log.dir"; 1444 1445 public static final String YARN_APP_CONTAINER_LOG_SIZE = 1446 YARN_PREFIX + "app.container.log.filesize"; 1447 1448 public static final String YARN_APP_CONTAINER_LOG_BACKUPS = 1449 YARN_PREFIX + "app.container.log.backups"; 1450 1451 //////////////////////////////// 1452 // Timeline Service Configs 1453 //////////////////////////////// 1454 1455 public static final String TIMELINE_SERVICE_PREFIX = 1456 YARN_PREFIX + "timeline-service."; 1457 1458 1459 // mark app-history related configs @Private as application history is going 1460 // to be integrated into the timeline service 1461 @Private 1462 public static final String APPLICATION_HISTORY_PREFIX = 1463 TIMELINE_SERVICE_PREFIX + "generic-application-history."; 1464 1465 /** 1466 * The setting that controls whether application history service is 1467 * enabled or not. 1468 */ 1469 @Private 1470 public static final String APPLICATION_HISTORY_ENABLED = 1471 APPLICATION_HISTORY_PREFIX + "enabled"; 1472 @Private 1473 public static final boolean DEFAULT_APPLICATION_HISTORY_ENABLED = false; 1474 1475 /** Application history store class */ 1476 @Private 1477 public static final String APPLICATION_HISTORY_STORE = 1478 APPLICATION_HISTORY_PREFIX + "store-class"; 1479 1480 /** Save container meta-info in the application history store. */ 1481 @Private 1482 public static final String 1483 APPLICATION_HISTORY_SAVE_NON_AM_CONTAINER_META_INFO = 1484 APPLICATION_HISTORY_PREFIX + "save-non-am-container-meta-info"; 1485 @Private 1486 public static final boolean 1487 DEFAULT_APPLICATION_HISTORY_SAVE_NON_AM_CONTAINER_META_INFO = true; 1488 1489 /** URI for FileSystemApplicationHistoryStore */ 1490 @Private 1491 public static final String FS_APPLICATION_HISTORY_STORE_URI = 1492 APPLICATION_HISTORY_PREFIX + "fs-history-store.uri"; 1493 1494 /** T-file compression types used to compress history data.*/ 1495 @Private 1496 public static final String FS_APPLICATION_HISTORY_STORE_COMPRESSION_TYPE = 1497 APPLICATION_HISTORY_PREFIX + "fs-history-store.compression-type"; 1498 @Private 1499 public static final String DEFAULT_FS_APPLICATION_HISTORY_STORE_COMPRESSION_TYPE = 1500 "none"; 1501 1502 /** The setting that controls whether timeline service is enabled or not. */ 1503 public static final String TIMELINE_SERVICE_ENABLED = 1504 TIMELINE_SERVICE_PREFIX + "enabled"; 1505 public static final boolean DEFAULT_TIMELINE_SERVICE_ENABLED = false; 1506 1507 /** host:port address for timeline service RPC APIs. */ 1508 public static final String TIMELINE_SERVICE_ADDRESS = 1509 TIMELINE_SERVICE_PREFIX + "address"; 1510 public static final int DEFAULT_TIMELINE_SERVICE_PORT = 10200; 1511 public static final String DEFAULT_TIMELINE_SERVICE_ADDRESS = "0.0.0.0:" 1512 + DEFAULT_TIMELINE_SERVICE_PORT; 1513 1514 /** The listening endpoint for the timeline service application.*/ 1515 public static final String TIMELINE_SERVICE_BIND_HOST = 1516 TIMELINE_SERVICE_PREFIX + "bind-host"; 1517 1518 /** The number of threads to handle client RPC API requests. */ 1519 public static final String TIMELINE_SERVICE_HANDLER_THREAD_COUNT = 1520 TIMELINE_SERVICE_PREFIX + "handler-thread-count"; 1521 public static final int DEFAULT_TIMELINE_SERVICE_CLIENT_THREAD_COUNT = 10; 1522 1523 1524 /** The address of the timeline service web application.*/ 1525 public static final String TIMELINE_SERVICE_WEBAPP_ADDRESS = 1526 TIMELINE_SERVICE_PREFIX + "webapp.address"; 1527 1528 public static final int DEFAULT_TIMELINE_SERVICE_WEBAPP_PORT = 8188; 1529 public static final String DEFAULT_TIMELINE_SERVICE_WEBAPP_ADDRESS = 1530 "0.0.0.0:" + DEFAULT_TIMELINE_SERVICE_WEBAPP_PORT; 1531 1532 /** The https address of the timeline service web application.*/ 1533 public static final String TIMELINE_SERVICE_WEBAPP_HTTPS_ADDRESS = 1534 TIMELINE_SERVICE_PREFIX + "webapp.https.address"; 1535 1536 public static final int DEFAULT_TIMELINE_SERVICE_WEBAPP_HTTPS_PORT = 8190; 1537 public static final String DEFAULT_TIMELINE_SERVICE_WEBAPP_HTTPS_ADDRESS = 1538 "0.0.0.0:" + DEFAULT_TIMELINE_SERVICE_WEBAPP_HTTPS_PORT; 1539 1540 /** 1541 * Defines the max number of applications could be fetched using 1542 * REST API or application history protocol and shown in timeline 1543 * server web ui. 1544 */ 1545 public static final String APPLICATION_HISTORY_MAX_APPS = 1546 APPLICATION_HISTORY_PREFIX + "max-applications"; 1547 public static final long DEFAULT_APPLICATION_HISTORY_MAX_APPS = 10000; 1548 1549 /** Timeline service store class */ 1550 public static final String TIMELINE_SERVICE_STORE = 1551 TIMELINE_SERVICE_PREFIX + "store-class"; 1552 1553 /** Timeline service enable data age off */ 1554 public static final String TIMELINE_SERVICE_TTL_ENABLE = 1555 TIMELINE_SERVICE_PREFIX + "ttl-enable"; 1556 1557 /** Timeline service length of time to retain data */ 1558 public static final String TIMELINE_SERVICE_TTL_MS = 1559 TIMELINE_SERVICE_PREFIX + "ttl-ms"; 1560 1561 public static final long DEFAULT_TIMELINE_SERVICE_TTL_MS = 1562 1000 * 60 * 60 * 24 * 7; 1563 1564 /** Timeline service rolling period. Valid values are daily, half_daily, 1565 * quarter_daily, and hourly. */ 1566 public static final String TIMELINE_SERVICE_ROLLING_PERIOD = 1567 TIMELINE_SERVICE_PREFIX + "rolling-period"; 1568 1569 /** Roll a new database each hour. */ 1570 public static final String DEFAULT_TIMELINE_SERVICE_ROLLING_PERIOD = 1571 "hourly"; 1572 1573 /** Implementation specific configuration prefix for Timeline Service 1574 * leveldb. 1575 */ 1576 public static final String TIMELINE_SERVICE_LEVELDB_PREFIX = 1577 TIMELINE_SERVICE_PREFIX + "leveldb-timeline-store."; 1578 1579 /** Timeline service leveldb path */ 1580 public static final String TIMELINE_SERVICE_LEVELDB_PATH = 1581 TIMELINE_SERVICE_LEVELDB_PREFIX + "path"; 1582 1583 /** Timeline service leveldb read cache (uncompressed blocks). This is 1584 * per rolling instance so should be tuned if using rolling leveldb 1585 * timeline store */ 1586 public static final String TIMELINE_SERVICE_LEVELDB_READ_CACHE_SIZE = 1587 TIMELINE_SERVICE_LEVELDB_PREFIX + "read-cache-size"; 1588 1589 /** Default leveldb read cache size if no configuration is specified. */ 1590 public static final long DEFAULT_TIMELINE_SERVICE_LEVELDB_READ_CACHE_SIZE = 1591 100 * 1024 * 1024; 1592 1593 /** Timeline service leveldb write buffer size. */ 1594 public static final String TIMELINE_SERVICE_LEVELDB_WRITE_BUFFER_SIZE = 1595 TIMELINE_SERVICE_LEVELDB_PREFIX + "write-buffer-size"; 1596 1597 /** Default leveldb write buffer size if no configuration is specified. This 1598 * is per rolling instance so should be tuned if using rolling leveldb 1599 * timeline store. */ 1600 public static final int DEFAULT_TIMELINE_SERVICE_LEVELDB_WRITE_BUFFER_SIZE = 1601 16 * 1024 * 1024; 1602 1603 /** Timeline service leveldb write batch size. This value can be tuned down 1604 * to reduce lock time for ttl eviction. */ 1605 public static final String 1606 TIMELINE_SERVICE_LEVELDB_WRITE_BATCH_SIZE = 1607 TIMELINE_SERVICE_LEVELDB_PREFIX + "write-batch-size"; 1608 1609 /** Default leveldb write batch size is no configuration is specified */ 1610 public static final int 1611 DEFAULT_TIMELINE_SERVICE_LEVELDB_WRITE_BATCH_SIZE = 10000; 1612 1613 /** Timeline service leveldb start time read cache (number of entities) */ 1614 public static final String 1615 TIMELINE_SERVICE_LEVELDB_START_TIME_READ_CACHE_SIZE = 1616 TIMELINE_SERVICE_LEVELDB_PREFIX + "start-time-read-cache-size"; 1617 1618 public static final int 1619 DEFAULT_TIMELINE_SERVICE_LEVELDB_START_TIME_READ_CACHE_SIZE = 10000; 1620 1621 /** Timeline service leveldb start time write cache (number of entities) */ 1622 public static final String 1623 TIMELINE_SERVICE_LEVELDB_START_TIME_WRITE_CACHE_SIZE = 1624 TIMELINE_SERVICE_LEVELDB_PREFIX + "start-time-write-cache-size"; 1625 1626 public static final int 1627 DEFAULT_TIMELINE_SERVICE_LEVELDB_START_TIME_WRITE_CACHE_SIZE = 10000; 1628 1629 /** Timeline service leveldb interval to wait between deletion rounds */ 1630 public static final String TIMELINE_SERVICE_LEVELDB_TTL_INTERVAL_MS = 1631 TIMELINE_SERVICE_LEVELDB_PREFIX + "ttl-interval-ms"; 1632 1633 public static final long DEFAULT_TIMELINE_SERVICE_LEVELDB_TTL_INTERVAL_MS = 1634 1000 * 60 * 5; 1635 1636 /** Timeline service leveldb number of concurrent open files. Tuned this 1637 * configuration to stay within system limits. This is per rolling instance 1638 * so should be tuned if using rolling leveldb timeline store. */ 1639 public static final String TIMELINE_SERVICE_LEVELDB_MAX_OPEN_FILES = 1640 TIMELINE_SERVICE_LEVELDB_PREFIX + "max-open-files"; 1641 1642 /** Default leveldb max open files if no configuration is specified. */ 1643 public static final int DEFAULT_TIMELINE_SERVICE_LEVELDB_MAX_OPEN_FILES = 1644 1000; 1645 1646 /** The Kerberos principal for the timeline server.*/ 1647 public static final String TIMELINE_SERVICE_PRINCIPAL = 1648 TIMELINE_SERVICE_PREFIX + "principal"; 1649 1650 /** The Kerberos keytab for the timeline server.*/ 1651 public static final String TIMELINE_SERVICE_KEYTAB = 1652 TIMELINE_SERVICE_PREFIX + "keytab"; 1653 1654 /** Enables cross origin support for timeline server.*/ 1655 public static final String TIMELINE_SERVICE_HTTP_CROSS_ORIGIN_ENABLED = 1656 TIMELINE_SERVICE_PREFIX + "http-cross-origin.enabled"; 1657 1658 /** Default value for cross origin support for timeline server.*/ 1659 public static final boolean 1660 TIMELINE_SERVICE_HTTP_CROSS_ORIGIN_ENABLED_DEFAULT = false; 1661 1662 /** Timeline client settings */ 1663 public static final String TIMELINE_SERVICE_CLIENT_PREFIX = 1664 TIMELINE_SERVICE_PREFIX + "client."; 1665 1666 /** Timeline client call, max retries (-1 means no limit) */ 1667 public static final String TIMELINE_SERVICE_CLIENT_MAX_RETRIES = 1668 TIMELINE_SERVICE_CLIENT_PREFIX + "max-retries"; 1669 1670 public static final int DEFAULT_TIMELINE_SERVICE_CLIENT_MAX_RETRIES = 30; 1671 1672 /** Timeline client call, retry interval */ 1673 public static final String TIMELINE_SERVICE_CLIENT_RETRY_INTERVAL_MS = 1674 TIMELINE_SERVICE_CLIENT_PREFIX + "retry-interval-ms"; 1675 1676 public static final long 1677 DEFAULT_TIMELINE_SERVICE_CLIENT_RETRY_INTERVAL_MS = 1000; 1678 1679 /** Timeline client policy for whether connections are fatal */ 1680 public static final String TIMELINE_SERVICE_CLIENT_BEST_EFFORT = 1681 TIMELINE_SERVICE_CLIENT_PREFIX + "best-effort"; 1682 1683 public static final boolean 1684 DEFAULT_TIMELINE_SERVICE_CLIENT_BEST_EFFORT = false; 1685 1686 /** Flag to enable recovery of timeline service */ 1687 public static final String TIMELINE_SERVICE_RECOVERY_ENABLED = 1688 TIMELINE_SERVICE_PREFIX + "recovery.enabled"; 1689 public static final boolean DEFAULT_TIMELINE_SERVICE_RECOVERY_ENABLED = false; 1690 1691 /** Timeline service state store class */ 1692 public static final String TIMELINE_SERVICE_STATE_STORE_CLASS = 1693 TIMELINE_SERVICE_PREFIX + "state-store-class"; 1694 1695 public static final String TIMELINE_SERVICE_LEVELDB_STATE_STORE_PREFIX = 1696 TIMELINE_SERVICE_PREFIX + "leveldb-state-store."; 1697 1698 /** Timeline service state store leveldb path */ 1699 public static final String TIMELINE_SERVICE_LEVELDB_STATE_STORE_PATH = 1700 TIMELINE_SERVICE_LEVELDB_STATE_STORE_PREFIX + "path"; 1701 1702 // Timeline delegation token related keys 1703 public static final String TIMELINE_DELEGATION_KEY_UPDATE_INTERVAL = 1704 TIMELINE_SERVICE_PREFIX + "delegation.key.update-interval"; 1705 public static final long DEFAULT_TIMELINE_DELEGATION_KEY_UPDATE_INTERVAL = 1706 24*60*60*1000; // 1 day 1707 public static final String TIMELINE_DELEGATION_TOKEN_RENEW_INTERVAL = 1708 TIMELINE_SERVICE_PREFIX + "delegation.token.renew-interval"; 1709 public static final long DEFAULT_TIMELINE_DELEGATION_TOKEN_RENEW_INTERVAL = 1710 24*60*60*1000; // 1 day 1711 public static final String TIMELINE_DELEGATION_TOKEN_MAX_LIFETIME = 1712 TIMELINE_SERVICE_PREFIX + "delegation.token.max-lifetime"; 1713 public static final long DEFAULT_TIMELINE_DELEGATION_TOKEN_MAX_LIFETIME = 1714 7*24*60*60*1000; // 7 days 1715 1716 // /////////////////////////////// 1717 // Shared Cache Configs 1718 // /////////////////////////////// 1719 public static final String SHARED_CACHE_PREFIX = "yarn.sharedcache."; 1720 1721 // common configs 1722 /** whether the shared cache is enabled/disabled */ 1723 public static final String SHARED_CACHE_ENABLED = 1724 SHARED_CACHE_PREFIX + "enabled"; 1725 public static final boolean DEFAULT_SHARED_CACHE_ENABLED = false; 1726 1727 /** The config key for the shared cache root directory. */ 1728 public static final String SHARED_CACHE_ROOT = 1729 SHARED_CACHE_PREFIX + "root-dir"; 1730 public static final String DEFAULT_SHARED_CACHE_ROOT = "/sharedcache"; 1731 1732 /** The config key for the level of nested directories before getting to the 1733 * checksum directory. */ 1734 public static final String SHARED_CACHE_NESTED_LEVEL = 1735 SHARED_CACHE_PREFIX + "nested-level"; 1736 public static final int DEFAULT_SHARED_CACHE_NESTED_LEVEL = 3; 1737 1738 // Shared Cache Manager Configs 1739 1740 public static final String SCM_STORE_PREFIX = SHARED_CACHE_PREFIX + "store."; 1741 1742 public static final String SCM_STORE_CLASS = SCM_STORE_PREFIX + "class"; 1743 public static final String DEFAULT_SCM_STORE_CLASS = 1744 "org.apache.hadoop.yarn.server.sharedcachemanager.store.InMemorySCMStore"; 1745 1746 public static final String SCM_APP_CHECKER_CLASS = SHARED_CACHE_PREFIX 1747 + "app-checker.class"; 1748 public static final String DEFAULT_SCM_APP_CHECKER_CLASS = 1749 "org.apache.hadoop.yarn.server.sharedcachemanager.RemoteAppChecker"; 1750 1751 /** The address of the SCM admin interface. */ 1752 public static final String SCM_ADMIN_ADDRESS = 1753 SHARED_CACHE_PREFIX + "admin.address"; 1754 public static final int DEFAULT_SCM_ADMIN_PORT = 8047; 1755 public static final String DEFAULT_SCM_ADMIN_ADDRESS = 1756 "0.0.0.0:" + DEFAULT_SCM_ADMIN_PORT; 1757 1758 /** Number of threads used to handle SCM admin interface. */ 1759 public static final String SCM_ADMIN_CLIENT_THREAD_COUNT = 1760 SHARED_CACHE_PREFIX + "admin.thread-count"; 1761 public static final int DEFAULT_SCM_ADMIN_CLIENT_THREAD_COUNT = 1; 1762 1763 /** The address of the SCM web application. */ 1764 public static final String SCM_WEBAPP_ADDRESS = 1765 SHARED_CACHE_PREFIX + "webapp.address"; 1766 public static final int DEFAULT_SCM_WEBAPP_PORT = 8788; 1767 public static final String DEFAULT_SCM_WEBAPP_ADDRESS = 1768 "0.0.0.0:" + DEFAULT_SCM_WEBAPP_PORT; 1769 1770 // In-memory SCM store configuration 1771 1772 public static final String IN_MEMORY_STORE_PREFIX = 1773 SCM_STORE_PREFIX + "in-memory."; 1774 1775 /** 1776 * A resource in the InMemorySCMStore is considered stale if the time since 1777 * the last reference exceeds the staleness period. This value is specified in 1778 * minutes. 1779 */ 1780 public static final String IN_MEMORY_STALENESS_PERIOD_MINS = 1781 IN_MEMORY_STORE_PREFIX + "staleness-period-mins"; 1782 public static final int DEFAULT_IN_MEMORY_STALENESS_PERIOD_MINS = 1783 7 * 24 * 60; 1784 1785 /** 1786 * Initial delay before the in-memory store runs its first check to remove 1787 * dead initial applications. Specified in minutes. 1788 */ 1789 public static final String IN_MEMORY_INITIAL_DELAY_MINS = 1790 IN_MEMORY_STORE_PREFIX + "initial-delay-mins"; 1791 public static final int DEFAULT_IN_MEMORY_INITIAL_DELAY_MINS = 10; 1792 1793 /** 1794 * The frequency at which the in-memory store checks to remove dead initial 1795 * applications. Specified in minutes. 1796 */ 1797 public static final String IN_MEMORY_CHECK_PERIOD_MINS = 1798 IN_MEMORY_STORE_PREFIX + "check-period-mins"; 1799 public static final int DEFAULT_IN_MEMORY_CHECK_PERIOD_MINS = 12 * 60; 1800 1801 // SCM Cleaner service configuration 1802 1803 private static final String SCM_CLEANER_PREFIX = SHARED_CACHE_PREFIX 1804 + "cleaner."; 1805 1806 /** 1807 * The frequency at which a cleaner task runs. Specified in minutes. 1808 */ 1809 public static final String SCM_CLEANER_PERIOD_MINS = 1810 SCM_CLEANER_PREFIX + "period-mins"; 1811 public static final int DEFAULT_SCM_CLEANER_PERIOD_MINS = 24 * 60; 1812 1813 /** 1814 * Initial delay before the first cleaner task is scheduled. Specified in 1815 * minutes. 1816 */ 1817 public static final String SCM_CLEANER_INITIAL_DELAY_MINS = 1818 SCM_CLEANER_PREFIX + "initial-delay-mins"; 1819 public static final int DEFAULT_SCM_CLEANER_INITIAL_DELAY_MINS = 10; 1820 1821 /** 1822 * The time to sleep between processing each shared cache resource. Specified 1823 * in milliseconds. 1824 */ 1825 public static final String SCM_CLEANER_RESOURCE_SLEEP_MS = 1826 SCM_CLEANER_PREFIX + "resource-sleep-ms"; 1827 public static final long DEFAULT_SCM_CLEANER_RESOURCE_SLEEP_MS = 0L; 1828 1829 /** The address of the node manager interface in the SCM. */ 1830 public static final String SCM_UPLOADER_SERVER_ADDRESS = SHARED_CACHE_PREFIX 1831 + "uploader.server.address"; 1832 public static final int DEFAULT_SCM_UPLOADER_SERVER_PORT = 8046; 1833 public static final String DEFAULT_SCM_UPLOADER_SERVER_ADDRESS = "0.0.0.0:" 1834 + DEFAULT_SCM_UPLOADER_SERVER_PORT; 1835 1836 /** 1837 * The number of SCM threads used to handle notify requests from the node 1838 * manager. 1839 */ 1840 public static final String SCM_UPLOADER_SERVER_THREAD_COUNT = 1841 SHARED_CACHE_PREFIX + "uploader.server.thread-count"; 1842 public static final int DEFAULT_SCM_UPLOADER_SERVER_THREAD_COUNT = 50; 1843 1844 /** The address of the client interface in the SCM. */ 1845 public static final String SCM_CLIENT_SERVER_ADDRESS = 1846 SHARED_CACHE_PREFIX + "client-server.address"; 1847 public static final int DEFAULT_SCM_CLIENT_SERVER_PORT = 8045; 1848 public static final String DEFAULT_SCM_CLIENT_SERVER_ADDRESS = "0.0.0.0:" 1849 + DEFAULT_SCM_CLIENT_SERVER_PORT; 1850 1851 /** The number of threads used to handle shared cache manager requests. */ 1852 public static final String SCM_CLIENT_SERVER_THREAD_COUNT = 1853 SHARED_CACHE_PREFIX + "client-server.thread-count"; 1854 public static final int DEFAULT_SCM_CLIENT_SERVER_THREAD_COUNT = 50; 1855 1856 /** the checksum algorithm implementation **/ 1857 public static final String SHARED_CACHE_CHECKSUM_ALGO_IMPL = 1858 SHARED_CACHE_PREFIX + "checksum.algo.impl"; 1859 public static final String DEFAULT_SHARED_CACHE_CHECKSUM_ALGO_IMPL = 1860 "org.apache.hadoop.yarn.sharedcache.ChecksumSHA256Impl"; 1861 1862 // node manager (uploader) configs 1863 /** 1864 * The replication factor for the node manager uploader for the shared cache. 1865 */ 1866 public static final String SHARED_CACHE_NM_UPLOADER_REPLICATION_FACTOR = 1867 SHARED_CACHE_PREFIX + "nm.uploader.replication.factor"; 1868 public static final int DEFAULT_SHARED_CACHE_NM_UPLOADER_REPLICATION_FACTOR = 1869 10; 1870 1871 public static final String SHARED_CACHE_NM_UPLOADER_THREAD_COUNT = 1872 SHARED_CACHE_PREFIX + "nm.uploader.thread-count"; 1873 public static final int DEFAULT_SHARED_CACHE_NM_UPLOADER_THREAD_COUNT = 20; 1874 1875 //////////////////////////////// 1876 // Other Configs 1877 //////////////////////////////// 1878 1879 /** 1880 * Use YARN_CLIENT_APPLICATION_CLIENT_PROTOCOL_POLL_INTERVAL_MS instead. 1881 * The interval of the yarn client's querying application state after 1882 * application submission. The unit is millisecond. 1883 */ 1884 @Deprecated 1885 public static final String YARN_CLIENT_APP_SUBMISSION_POLL_INTERVAL_MS = 1886 YARN_PREFIX + "client.app-submission.poll-interval"; 1887 1888 /** 1889 * The interval that the yarn client library uses to poll the completion 1890 * status of the asynchronous API of application client protocol. 1891 */ 1892 public static final String YARN_CLIENT_APPLICATION_CLIENT_PROTOCOL_POLL_INTERVAL_MS = 1893 YARN_PREFIX + "client.application-client-protocol.poll-interval-ms"; 1894 public static final long DEFAULT_YARN_CLIENT_APPLICATION_CLIENT_PROTOCOL_POLL_INTERVAL_MS = 1895 200; 1896 1897 /** 1898 * The duration that the yarn client library waits, cumulatively across polls, 1899 * for an expected state change to occur. Defaults to -1, which indicates no 1900 * limit. 1901 */ 1902 public static final String YARN_CLIENT_APPLICATION_CLIENT_PROTOCOL_POLL_TIMEOUT_MS = 1903 YARN_PREFIX + "client.application-client-protocol.poll-timeout-ms"; 1904 public static final long DEFAULT_YARN_CLIENT_APPLICATION_CLIENT_PROTOCOL_POLL_TIMEOUT_MS = 1905 -1; 1906 1907 /** 1908 * Max number of threads in NMClientAsync to process container management 1909 * events 1910 */ 1911 public static final String NM_CLIENT_ASYNC_THREAD_POOL_MAX_SIZE = 1912 YARN_PREFIX + "client.nodemanager-client-async.thread-pool-max-size"; 1913 public static final int DEFAULT_NM_CLIENT_ASYNC_THREAD_POOL_MAX_SIZE = 500; 1914 1915 /** 1916 * Maximum number of proxy connections to cache for node managers. If set 1917 * to a value greater than zero then the cache is enabled and the NMClient 1918 * and MRAppMaster will cache the specified number of node manager proxies. 1919 * There will be at max one proxy per node manager. Ex. configuring it to a 1920 * value of 5 will make sure that client will at max have 5 proxies cached 1921 * with 5 different node managers. These connections for these proxies will 1922 * be timed out if idle for more than the system wide idle timeout period. 1923 * Note that this could cause issues on large clusters as many connections 1924 * could linger simultaneously and lead to a large number of connection 1925 * threads. The token used for authentication will be used only at 1926 * connection creation time. If a new token is received then the earlier 1927 * connection should be closed in order to use the new token. This and 1928 * {@link YarnConfiguration#NM_CLIENT_ASYNC_THREAD_POOL_MAX_SIZE} are related 1929 * and should be in sync (no need for them to be equal). 1930 * If the value of this property is zero then the connection cache is 1931 * disabled and connections will use a zero idle timeout to prevent too 1932 * many connection threads on large clusters. 1933 */ 1934 public static final String NM_CLIENT_MAX_NM_PROXIES = 1935 YARN_PREFIX + "client.max-cached-nodemanagers-proxies"; 1936 public static final int DEFAULT_NM_CLIENT_MAX_NM_PROXIES = 0; 1937 1938 /** Max time to wait to establish a connection to NM */ 1939 public static final String CLIENT_NM_CONNECT_MAX_WAIT_MS = 1940 YARN_PREFIX + "client.nodemanager-connect.max-wait-ms"; 1941 public static final long DEFAULT_CLIENT_NM_CONNECT_MAX_WAIT_MS = 1942 3 * 60 * 1000; 1943 1944 /** Time interval between each attempt to connect to NM */ 1945 public static final String CLIENT_NM_CONNECT_RETRY_INTERVAL_MS = 1946 YARN_PREFIX + "client.nodemanager-connect.retry-interval-ms"; 1947 public static final long DEFAULT_CLIENT_NM_CONNECT_RETRY_INTERVAL_MS 1948 = 10 * 1000; 1949 1950 public static final String YARN_HTTP_POLICY_KEY = YARN_PREFIX + "http.policy"; 1951 public static final String YARN_HTTP_POLICY_DEFAULT = HttpConfig.Policy.HTTP_ONLY 1952 .name(); 1953 1954 /** 1955 * Node-labels configurations 1956 */ 1957 public static final String NODE_LABELS_PREFIX = YARN_PREFIX + "node-labels."; 1958 1959 /** URI for NodeLabelManager */ 1960 public static final String FS_NODE_LABELS_STORE_ROOT_DIR = NODE_LABELS_PREFIX 1961 + "fs-store.root-dir"; 1962 public static final String FS_NODE_LABELS_STORE_RETRY_POLICY_SPEC = 1963 NODE_LABELS_PREFIX + "fs-store.retry-policy-spec"; 1964 public static final String DEFAULT_FS_NODE_LABELS_STORE_RETRY_POLICY_SPEC = 1965 "2000, 500"; 1966 1967 /** 1968 * Flag to indicate if the node labels feature enabled, by default it's 1969 * disabled 1970 */ 1971 public static final String NODE_LABELS_ENABLED = NODE_LABELS_PREFIX 1972 + "enabled"; 1973 public static final boolean DEFAULT_NODE_LABELS_ENABLED = false; 1974 1975 public static final String NODELABEL_CONFIGURATION_TYPE = 1976 NODE_LABELS_PREFIX + "configuration-type"; 1977 1978 public static final String CENTALIZED_NODELABEL_CONFIGURATION_TYPE = 1979 "centralized"; 1980 1981 public static final String DISTRIBUTED_NODELABEL_CONFIGURATION_TYPE = 1982 "distributed"; 1983 1984 public static final String DEFAULT_NODELABEL_CONFIGURATION_TYPE = 1985 CENTALIZED_NODELABEL_CONFIGURATION_TYPE; 1986 1987 public static final String MAX_CLUSTER_LEVEL_APPLICATION_PRIORITY = 1988 YARN_PREFIX + "cluster.max-application-priority"; 1989 1990 public static final int DEFAULT_CLUSTER_LEVEL_APPLICATION_PRIORITY = 0; 1991 1992 @Private 1993 public static boolean isDistributedNodeLabelConfiguration(Configuration conf) { 1994 return DISTRIBUTED_NODELABEL_CONFIGURATION_TYPE.equals(conf.get( 1995 NODELABEL_CONFIGURATION_TYPE, DEFAULT_NODELABEL_CONFIGURATION_TYPE)); 1996 } 1997 1998 private static final String NM_NODE_LABELS_PREFIX = NM_PREFIX 1999 + "node-labels."; 2000 2001 public static final String NM_NODE_LABELS_PROVIDER_CONFIG = 2002 NM_NODE_LABELS_PREFIX + "provider"; 2003 2004 // whitelist names for the yarn.nodemanager.node-labels.provider 2005 public static final String CONFIG_NODE_LABELS_PROVIDER = "config"; 2006 2007 private static final String NM_NODE_LABELS_PROVIDER_PREFIX = 2008 NM_NODE_LABELS_PREFIX + "provider."; 2009 2010 // If -1 is configured then no timer task should be created 2011 public static final String NM_NODE_LABELS_PROVIDER_FETCH_INTERVAL_MS = 2012 NM_NODE_LABELS_PROVIDER_PREFIX + "fetch-interval-ms"; 2013 2014 public static final String NM_NODE_LABELS_PROVIDER_FETCH_TIMEOUT_MS = 2015 NM_NODE_LABELS_PROVIDER_PREFIX + "fetch-timeout-ms"; 2016 2017 // once in 10 mins 2018 public static final long DEFAULT_NM_NODE_LABELS_PROVIDER_FETCH_INTERVAL_MS = 2019 10 * 60 * 1000; 2020 2021 // Twice of default interval time 2022 public static final long DEFAULT_NM_NODE_LABELS_PROVIDER_FETCH_TIMEOUT_MS = 2023 DEFAULT_NM_NODE_LABELS_PROVIDER_FETCH_INTERVAL_MS * 2; 2024 2025 public static final String NM_PROVIDER_CONFIGURED_NODE_LABELS = 2026 NM_NODE_LABELS_PROVIDER_PREFIX + "configured-node-labels"; 2027 2028 public YarnConfiguration() { 2029 super(); 2030 } 2031 2032 public YarnConfiguration(Configuration conf) { 2033 super(conf); 2034 if (! (conf instanceof YarnConfiguration)) { 2035 this.reloadConfiguration(); 2036 } 2037 } 2038 2039 @Private 2040 public static List<String> getServiceAddressConfKeys(Configuration conf) { 2041 return useHttps(conf) ? RM_SERVICES_ADDRESS_CONF_KEYS_HTTPS 2042 : RM_SERVICES_ADDRESS_CONF_KEYS_HTTP; 2043 } 2044 2045 /** 2046 * Get the socket address for <code>name</code> property as a 2047 * <code>InetSocketAddress</code>. On a HA cluster, 2048 * this fetches the address corresponding to the RM identified by 2049 * {@link #RM_HA_ID}. 2050 * @param name property name. 2051 * @param defaultAddress the default value 2052 * @param defaultPort the default port 2053 * @return InetSocketAddress 2054 */ 2055 @Override 2056 public InetSocketAddress getSocketAddr( 2057 String name, String defaultAddress, int defaultPort) { 2058 String address; 2059 if (HAUtil.isHAEnabled(this) && getServiceAddressConfKeys(this).contains(name)) { 2060 address = HAUtil.getConfValueForRMInstance(name, defaultAddress, this); 2061 } else { 2062 address = get(name, defaultAddress); 2063 } 2064 return NetUtils.createSocketAddr(address, defaultPort, name); 2065 } 2066 2067 @Override 2068 public InetSocketAddress updateConnectAddr(String name, 2069 InetSocketAddress addr) { 2070 String prefix = name; 2071 if (HAUtil.isHAEnabled(this) && getServiceAddressConfKeys(this).contains(name)) { 2072 prefix = HAUtil.addSuffix(prefix, HAUtil.getRMHAId(this)); 2073 } 2074 return super.updateConnectAddr(prefix, addr); 2075 } 2076 2077 @Private 2078 public static int getRMDefaultPortNumber(String addressPrefix, 2079 Configuration conf) { 2080 if (addressPrefix.equals(YarnConfiguration.RM_ADDRESS)) { 2081 return YarnConfiguration.DEFAULT_RM_PORT; 2082 } else if (addressPrefix.equals(YarnConfiguration.RM_SCHEDULER_ADDRESS)) { 2083 return YarnConfiguration.DEFAULT_RM_SCHEDULER_PORT; 2084 } else if (addressPrefix.equals(YarnConfiguration.RM_WEBAPP_ADDRESS)) { 2085 return YarnConfiguration.DEFAULT_RM_WEBAPP_PORT; 2086 } else if (addressPrefix.equals(YarnConfiguration.RM_WEBAPP_HTTPS_ADDRESS)) { 2087 return YarnConfiguration.DEFAULT_RM_WEBAPP_HTTPS_PORT; 2088 } else if (addressPrefix 2089 .equals(YarnConfiguration.RM_RESOURCE_TRACKER_ADDRESS)) { 2090 return YarnConfiguration.DEFAULT_RM_RESOURCE_TRACKER_PORT; 2091 } else if (addressPrefix.equals(YarnConfiguration.RM_ADMIN_ADDRESS)) { 2092 return YarnConfiguration.DEFAULT_RM_ADMIN_PORT; 2093 } else { 2094 throw new HadoopIllegalArgumentException( 2095 "Invalid RM RPC address Prefix: " + addressPrefix 2096 + ". The valid value should be one of " 2097 + getServiceAddressConfKeys(conf)); 2098 } 2099 } 2100 2101 public static boolean useHttps(Configuration conf) { 2102 return HttpConfig.Policy.HTTPS_ONLY == HttpConfig.Policy.fromString(conf 2103 .get(YARN_HTTP_POLICY_KEY, 2104 YARN_HTTP_POLICY_DEFAULT)); 2105 } 2106 2107 public static boolean shouldRMFailFast(Configuration conf) { 2108 return conf.getBoolean(YarnConfiguration.RM_FAIL_FAST, 2109 conf.getBoolean(YarnConfiguration.YARN_FAIL_FAST, 2110 YarnConfiguration.DEFAULT_YARN_FAIL_FAST)); 2111 } 2112 2113 @Private 2114 public static String getClusterId(Configuration conf) { 2115 String clusterId = conf.get(YarnConfiguration.RM_CLUSTER_ID); 2116 if (clusterId == null) { 2117 throw new HadoopIllegalArgumentException("Configuration doesn't specify " + 2118 YarnConfiguration.RM_CLUSTER_ID); 2119 } 2120 return clusterId; 2121 } 2122 2123 /* For debugging. mp configurations to system output as XML format. */ 2124 public static void main(String[] args) throws Exception { 2125 new YarnConfiguration(new Configuration()).writeXml(System.out); 2126 } 2127}