[120] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
---|
| 2 | <html> |
---|
| 3 | <head> |
---|
| 4 | <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
---|
| 5 | <meta content="Apache Forrest" name="Generator"> |
---|
| 6 | <meta name="Forrest-version" content="0.8"> |
---|
| 7 | <meta name="Forrest-skin-name" content="pelt"> |
---|
| 8 | <title>Capacity Scheduler Guide</title> |
---|
| 9 | <link type="text/css" href="skin/basic.css" rel="stylesheet"> |
---|
| 10 | <link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet"> |
---|
| 11 | <link media="print" type="text/css" href="skin/print.css" rel="stylesheet"> |
---|
| 12 | <link type="text/css" href="skin/profile.css" rel="stylesheet"> |
---|
| 13 | <script src="skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="skin/fontsize.js" language="javascript" type="text/javascript"></script> |
---|
| 14 | <link rel="shortcut icon" href="images/favicon.ico"> |
---|
| 15 | </head> |
---|
| 16 | <body onload="init()"> |
---|
| 17 | <script type="text/javascript">ndeSetTextSize();</script> |
---|
| 18 | <div id="top"> |
---|
| 19 | <!--+ |
---|
| 20 | |breadtrail |
---|
| 21 | +--> |
---|
| 22 | <div class="breadtrail"> |
---|
| 23 | <a href="http://www.apache.org/">Apache</a> > <a href="http://hadoop.apache.org/">Hadoop</a> > <a href="http://hadoop.apache.org/core/">Core</a><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script> |
---|
| 24 | </div> |
---|
| 25 | <!--+ |
---|
| 26 | |header |
---|
| 27 | +--> |
---|
| 28 | <div class="header"> |
---|
| 29 | <!--+ |
---|
| 30 | |start group logo |
---|
| 31 | +--> |
---|
| 32 | <div class="grouplogo"> |
---|
| 33 | <a href="http://hadoop.apache.org/"><img class="logoImage" alt="Hadoop" src="images/hadoop-logo.jpg" title="Apache Hadoop"></a> |
---|
| 34 | </div> |
---|
| 35 | <!--+ |
---|
| 36 | |end group logo |
---|
| 37 | +--> |
---|
| 38 | <!--+ |
---|
| 39 | |start Project Logo |
---|
| 40 | +--> |
---|
| 41 | <div class="projectlogo"> |
---|
| 42 | <a href="http://hadoop.apache.org/core/"><img class="logoImage" alt="Hadoop" src="images/core-logo.gif" title="Scalable Computing Platform"></a> |
---|
| 43 | </div> |
---|
| 44 | <!--+ |
---|
| 45 | |end Project Logo |
---|
| 46 | +--> |
---|
| 47 | <!--+ |
---|
| 48 | |start Search |
---|
| 49 | +--> |
---|
| 50 | <div class="searchbox"> |
---|
| 51 | <form action="http://www.google.com/search" method="get" class="roundtopsmall"> |
---|
| 52 | <input value="hadoop.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google"> |
---|
| 53 | <input name="Search" value="Search" type="submit"> |
---|
| 54 | </form> |
---|
| 55 | </div> |
---|
| 56 | <!--+ |
---|
| 57 | |end search |
---|
| 58 | +--> |
---|
| 59 | <!--+ |
---|
| 60 | |start Tabs |
---|
| 61 | +--> |
---|
| 62 | <ul id="tabs"> |
---|
| 63 | <li> |
---|
| 64 | <a class="unselected" href="http://hadoop.apache.org/core/">Project</a> |
---|
| 65 | </li> |
---|
| 66 | <li> |
---|
| 67 | <a class="unselected" href="http://wiki.apache.org/hadoop">Wiki</a> |
---|
| 68 | </li> |
---|
| 69 | <li class="current"> |
---|
| 70 | <a class="selected" href="index.html">Hadoop 0.20 Documentation</a> |
---|
| 71 | </li> |
---|
| 72 | </ul> |
---|
| 73 | <!--+ |
---|
| 74 | |end Tabs |
---|
| 75 | +--> |
---|
| 76 | </div> |
---|
| 77 | </div> |
---|
| 78 | <div id="main"> |
---|
| 79 | <div id="publishedStrip"> |
---|
| 80 | <!--+ |
---|
| 81 | |start Subtabs |
---|
| 82 | +--> |
---|
| 83 | <div id="level2tabs"></div> |
---|
| 84 | <!--+ |
---|
| 85 | |end Endtabs |
---|
| 86 | +--> |
---|
| 87 | <script type="text/javascript"><!-- |
---|
| 88 | document.write("Last Published: " + document.lastModified); |
---|
| 89 | // --></script> |
---|
| 90 | </div> |
---|
| 91 | <!--+ |
---|
| 92 | |breadtrail |
---|
| 93 | +--> |
---|
| 94 | <div class="breadtrail"> |
---|
| 95 | |
---|
| 96 | |
---|
| 97 | </div> |
---|
| 98 | <!--+ |
---|
| 99 | |start Menu, mainarea |
---|
| 100 | +--> |
---|
| 101 | <!--+ |
---|
| 102 | |start Menu |
---|
| 103 | +--> |
---|
| 104 | <div id="menu"> |
---|
| 105 | <div onclick="SwitchMenu('menu_1.1', 'skin/')" id="menu_1.1Title" class="menutitle">Getting Started</div> |
---|
| 106 | <div id="menu_1.1" class="menuitemgroup"> |
---|
| 107 | <div class="menuitem"> |
---|
| 108 | <a href="index.html">Overview</a> |
---|
| 109 | </div> |
---|
| 110 | <div class="menuitem"> |
---|
| 111 | <a href="quickstart.html">Quick Start</a> |
---|
| 112 | </div> |
---|
| 113 | <div class="menuitem"> |
---|
| 114 | <a href="cluster_setup.html">Cluster Setup</a> |
---|
| 115 | </div> |
---|
| 116 | <div class="menuitem"> |
---|
| 117 | <a href="mapred_tutorial.html">Map/Reduce Tutorial</a> |
---|
| 118 | </div> |
---|
| 119 | </div> |
---|
| 120 | <div onclick="SwitchMenu('menu_selected_1.2', 'skin/')" id="menu_selected_1.2Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">Programming Guides</div> |
---|
| 121 | <div id="menu_selected_1.2" class="selectedmenuitemgroup" style="display: block;"> |
---|
| 122 | <div class="menuitem"> |
---|
| 123 | <a href="commands_manual.html">Commands</a> |
---|
| 124 | </div> |
---|
| 125 | <div class="menuitem"> |
---|
| 126 | <a href="distcp.html">DistCp</a> |
---|
| 127 | </div> |
---|
| 128 | <div class="menuitem"> |
---|
| 129 | <a href="native_libraries.html">Native Libraries</a> |
---|
| 130 | </div> |
---|
| 131 | <div class="menuitem"> |
---|
| 132 | <a href="streaming.html">Streaming</a> |
---|
| 133 | </div> |
---|
| 134 | <div class="menuitem"> |
---|
| 135 | <a href="fair_scheduler.html">Fair Scheduler</a> |
---|
| 136 | </div> |
---|
| 137 | <div class="menupage"> |
---|
| 138 | <div class="menupagetitle">Capacity Scheduler</div> |
---|
| 139 | </div> |
---|
| 140 | <div class="menuitem"> |
---|
| 141 | <a href="service_level_auth.html">Service Level Authorization</a> |
---|
| 142 | </div> |
---|
| 143 | <div class="menuitem"> |
---|
| 144 | <a href="vaidya.html">Vaidya</a> |
---|
| 145 | </div> |
---|
| 146 | <div class="menuitem"> |
---|
| 147 | <a href="hadoop_archives.html">Archives</a> |
---|
| 148 | </div> |
---|
| 149 | </div> |
---|
| 150 | <div onclick="SwitchMenu('menu_1.3', 'skin/')" id="menu_1.3Title" class="menutitle">HDFS</div> |
---|
| 151 | <div id="menu_1.3" class="menuitemgroup"> |
---|
| 152 | <div class="menuitem"> |
---|
| 153 | <a href="hdfs_user_guide.html">User Guide</a> |
---|
| 154 | </div> |
---|
| 155 | <div class="menuitem"> |
---|
| 156 | <a href="hdfs_design.html">Architecture</a> |
---|
| 157 | </div> |
---|
| 158 | <div class="menuitem"> |
---|
| 159 | <a href="hdfs_shell.html">File System Shell Guide</a> |
---|
| 160 | </div> |
---|
| 161 | <div class="menuitem"> |
---|
| 162 | <a href="hdfs_permissions_guide.html">Permissions Guide</a> |
---|
| 163 | </div> |
---|
| 164 | <div class="menuitem"> |
---|
| 165 | <a href="hdfs_quota_admin_guide.html">Quotas Guide</a> |
---|
| 166 | </div> |
---|
| 167 | <div class="menuitem"> |
---|
| 168 | <a href="SLG_user_guide.html">Synthetic Load Generator Guide</a> |
---|
| 169 | </div> |
---|
| 170 | <div class="menuitem"> |
---|
| 171 | <a href="libhdfs.html">C API libhdfs</a> |
---|
| 172 | </div> |
---|
| 173 | </div> |
---|
| 174 | <div onclick="SwitchMenu('menu_1.4', 'skin/')" id="menu_1.4Title" class="menutitle">HOD</div> |
---|
| 175 | <div id="menu_1.4" class="menuitemgroup"> |
---|
| 176 | <div class="menuitem"> |
---|
| 177 | <a href="hod_user_guide.html">User Guide</a> |
---|
| 178 | </div> |
---|
| 179 | <div class="menuitem"> |
---|
| 180 | <a href="hod_admin_guide.html">Admin Guide</a> |
---|
| 181 | </div> |
---|
| 182 | <div class="menuitem"> |
---|
| 183 | <a href="hod_config_guide.html">Config Guide</a> |
---|
| 184 | </div> |
---|
| 185 | </div> |
---|
| 186 | <div onclick="SwitchMenu('menu_1.5', 'skin/')" id="menu_1.5Title" class="menutitle">Miscellaneous</div> |
---|
| 187 | <div id="menu_1.5" class="menuitemgroup"> |
---|
| 188 | <div class="menuitem"> |
---|
| 189 | <a href="api/index.html">API Docs</a> |
---|
| 190 | </div> |
---|
| 191 | <div class="menuitem"> |
---|
| 192 | <a href="jdiff/changes.html">API Changes</a> |
---|
| 193 | </div> |
---|
| 194 | <div class="menuitem"> |
---|
| 195 | <a href="http://wiki.apache.org/hadoop/">Wiki</a> |
---|
| 196 | </div> |
---|
| 197 | <div class="menuitem"> |
---|
| 198 | <a href="http://wiki.apache.org/hadoop/FAQ">FAQ</a> |
---|
| 199 | </div> |
---|
| 200 | <div class="menuitem"> |
---|
| 201 | <a href="releasenotes.html">Release Notes</a> |
---|
| 202 | </div> |
---|
| 203 | <div class="menuitem"> |
---|
| 204 | <a href="changes.html">Change Log</a> |
---|
| 205 | </div> |
---|
| 206 | </div> |
---|
| 207 | <div id="credit"></div> |
---|
| 208 | <div id="roundbottom"> |
---|
| 209 | <img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div> |
---|
| 210 | <!--+ |
---|
| 211 | |alternative credits |
---|
| 212 | +--> |
---|
| 213 | <div id="credit2"></div> |
---|
| 214 | </div> |
---|
| 215 | <!--+ |
---|
| 216 | |end Menu |
---|
| 217 | +--> |
---|
| 218 | <!--+ |
---|
| 219 | |start content |
---|
| 220 | +--> |
---|
| 221 | <div id="content"> |
---|
| 222 | <div title="Portable Document Format" class="pdflink"> |
---|
| 223 | <a class="dida" href="capacity_scheduler.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br> |
---|
| 224 | PDF</a> |
---|
| 225 | </div> |
---|
| 226 | <h1>Capacity Scheduler Guide</h1> |
---|
| 227 | <div id="minitoc-area"> |
---|
| 228 | <ul class="minitoc"> |
---|
| 229 | <li> |
---|
| 230 | <a href="#Purpose">Purpose</a> |
---|
| 231 | </li> |
---|
| 232 | <li> |
---|
| 233 | <a href="#Features">Features</a> |
---|
| 234 | </li> |
---|
| 235 | <li> |
---|
| 236 | <a href="#Picking+a+task+to+run">Picking a task to run</a> |
---|
| 237 | </li> |
---|
| 238 | <li> |
---|
| 239 | <a href="#Installation">Installation</a> |
---|
| 240 | </li> |
---|
| 241 | <li> |
---|
| 242 | <a href="#Configuration">Configuration</a> |
---|
| 243 | <ul class="minitoc"> |
---|
| 244 | <li> |
---|
| 245 | <a href="#Using+the+Capacity+Scheduler">Using the Capacity Scheduler</a> |
---|
| 246 | </li> |
---|
| 247 | <li> |
---|
| 248 | <a href="#Setting+up+queues">Setting up queues</a> |
---|
| 249 | </li> |
---|
| 250 | <li> |
---|
| 251 | <a href="#Configuring+properties+for+queues">Configuring properties for queues</a> |
---|
| 252 | </li> |
---|
| 253 | <li> |
---|
| 254 | <a href="#Memory+management">Memory management</a> |
---|
| 255 | </li> |
---|
| 256 | <li> |
---|
| 257 | <a href="#Job+Initialization+Parameters">Job Initialization Parameters</a> |
---|
| 258 | </li> |
---|
| 259 | <li> |
---|
| 260 | <a href="#Reviewing+the+configuration+of+the+Capacity+Scheduler">Reviewing the configuration of the Capacity Scheduler</a> |
---|
| 261 | </li> |
---|
| 262 | </ul> |
---|
| 263 | </li> |
---|
| 264 | </ul> |
---|
| 265 | </div> |
---|
| 266 | |
---|
| 267 | |
---|
| 268 | <a name="N1000D"></a><a name="Purpose"></a> |
---|
| 269 | <h2 class="h3">Purpose</h2> |
---|
| 270 | <div class="section"> |
---|
| 271 | <p>This document describes the Capacity Scheduler, a pluggable |
---|
| 272 | Map/Reduce scheduler for Hadoop which provides a way to share |
---|
| 273 | large clusters.</p> |
---|
| 274 | </div> |
---|
| 275 | |
---|
| 276 | |
---|
| 277 | <a name="N10017"></a><a name="Features"></a> |
---|
| 278 | <h2 class="h3">Features</h2> |
---|
| 279 | <div class="section"> |
---|
| 280 | <p>The Capacity Scheduler supports the following features:</p> |
---|
| 281 | <ul> |
---|
| 282 | |
---|
| 283 | <li> |
---|
| 284 | Support for multiple queues, where a job is submitted to a queue. |
---|
| 285 | </li> |
---|
| 286 | |
---|
| 287 | <li> |
---|
| 288 | Queues are allocated a fraction of the capacity of the grid in the |
---|
| 289 | sense that a certain capacity of resources will be at their |
---|
| 290 | disposal. All jobs submitted to a queue will have access to the |
---|
| 291 | capacity allocated to the queue. |
---|
| 292 | </li> |
---|
| 293 | |
---|
| 294 | <li> |
---|
| 295 | Free resources can be allocated to any queue beyond it's capacity. |
---|
| 296 | When there is demand for these resources from queues running below |
---|
| 297 | capacity at a future point in time, as tasks scheduled on these |
---|
| 298 | resources complete, they will be assigned to jobs on queues |
---|
| 299 | running below the capacity. |
---|
| 300 | </li> |
---|
| 301 | |
---|
| 302 | <li> |
---|
| 303 | Queues optionally support job priorities (disabled by default). |
---|
| 304 | </li> |
---|
| 305 | |
---|
| 306 | <li> |
---|
| 307 | Within a queue, jobs with higher priority will have access to the |
---|
| 308 | queue's resources before jobs with lower priority. However, once a |
---|
| 309 | job is running, it will not be preempted for a higher priority job, |
---|
| 310 | though new tasks from the higher priority job will be |
---|
| 311 | preferentially scheduled. |
---|
| 312 | </li> |
---|
| 313 | |
---|
| 314 | <li> |
---|
| 315 | In order to prevent one or more users from monopolizing its |
---|
| 316 | resources, each queue enforces a limit on the percentage of |
---|
| 317 | resources allocated to a user at any given time, if there is |
---|
| 318 | competition for them. |
---|
| 319 | </li> |
---|
| 320 | |
---|
| 321 | <li> |
---|
| 322 | Support for memory-intensive jobs, wherein a job can optionally |
---|
| 323 | specify higher memory-requirements than the default, and the tasks |
---|
| 324 | of the job will only be run on TaskTrackers that have enough memory |
---|
| 325 | to spare. |
---|
| 326 | </li> |
---|
| 327 | |
---|
| 328 | </ul> |
---|
| 329 | </div> |
---|
| 330 | |
---|
| 331 | |
---|
| 332 | <a name="N10039"></a><a name="Picking+a+task+to+run"></a> |
---|
| 333 | <h2 class="h3">Picking a task to run</h2> |
---|
| 334 | <div class="section"> |
---|
| 335 | <p>Note that many of these steps can be, and will be, enhanced over time |
---|
| 336 | to provide better algorithms.</p> |
---|
| 337 | <p>Whenever a TaskTracker is free, the Capacity Scheduler picks |
---|
| 338 | a queue which has most free space (whose ratio of # of running slots to |
---|
| 339 | capacity is the lowest).</p> |
---|
| 340 | <p>Once a queue is selected, the Scheduler picks a job in the queue. Jobs |
---|
| 341 | are sorted based on when they're submitted and their priorities (if the |
---|
| 342 | queue supports priorities). Jobs are considered in order, and a job is |
---|
| 343 | selected if its user is within the user-quota for the queue, i.e., the |
---|
| 344 | user is not already using queue resources above his/her limit. The |
---|
| 345 | Scheduler also makes sure that there is enough free memory in the |
---|
| 346 | TaskTracker to tun the job's task, in case the job has special memory |
---|
| 347 | requirements.</p> |
---|
| 348 | <p>Once a job is selected, the Scheduler picks a task to run. This logic |
---|
| 349 | to pick a task remains unchanged from earlier versions.</p> |
---|
| 350 | </div> |
---|
| 351 | |
---|
| 352 | |
---|
| 353 | <a name="N1004C"></a><a name="Installation"></a> |
---|
| 354 | <h2 class="h3">Installation</h2> |
---|
| 355 | <div class="section"> |
---|
| 356 | <p>The Capacity Scheduler is available as a JAR file in the Hadoop |
---|
| 357 | tarball under the <em>contrib/capacity-scheduler</em> directory. The name of |
---|
| 358 | the JAR file would be on the lines of hadoop-*-capacity-scheduler.jar.</p> |
---|
| 359 | <p>You can also build the Scheduler from source by executing |
---|
| 360 | <em>ant package</em>, in which case it would be available under |
---|
| 361 | <em>build/contrib/capacity-scheduler</em>.</p> |
---|
| 362 | <p>To run the Capacity Scheduler in your Hadoop installation, you need |
---|
| 363 | to put it on the <em>CLASSPATH</em>. The easiest way is to copy the |
---|
| 364 | <span class="codefrag">hadoop-*-capacity-scheduler.jar</span> from |
---|
| 365 | to <span class="codefrag">HADOOP_HOME/lib</span>. Alternatively, you can modify |
---|
| 366 | <em>HADOOP_CLASSPATH</em> to include this jar, in |
---|
| 367 | <span class="codefrag">conf/hadoop-env.sh</span>.</p> |
---|
| 368 | </div> |
---|
| 369 | |
---|
| 370 | |
---|
| 371 | <a name="N10074"></a><a name="Configuration"></a> |
---|
| 372 | <h2 class="h3">Configuration</h2> |
---|
| 373 | <div class="section"> |
---|
| 374 | <a name="N1007A"></a><a name="Using+the+Capacity+Scheduler"></a> |
---|
| 375 | <h3 class="h4">Using the Capacity Scheduler</h3> |
---|
| 376 | <p> |
---|
| 377 | To make the Hadoop framework use the Capacity Scheduler, set up |
---|
| 378 | the following property in the site configuration:</p> |
---|
| 379 | <table class="ForrestTable" cellspacing="1" cellpadding="4"> |
---|
| 380 | |
---|
| 381 | <tr> |
---|
| 382 | |
---|
| 383 | <td colspan="1" rowspan="1">Property</td> |
---|
| 384 | <td colspan="1" rowspan="1">Value</td> |
---|
| 385 | |
---|
| 386 | </tr> |
---|
| 387 | |
---|
| 388 | <tr> |
---|
| 389 | |
---|
| 390 | <td colspan="1" rowspan="1">mapred.jobtracker.taskScheduler</td> |
---|
| 391 | <td colspan="1" rowspan="1">org.apache.hadoop.mapred.CapacityTaskScheduler</td> |
---|
| 392 | |
---|
| 393 | </tr> |
---|
| 394 | |
---|
| 395 | </table> |
---|
| 396 | <a name="N100A1"></a><a name="Setting+up+queues"></a> |
---|
| 397 | <h3 class="h4">Setting up queues</h3> |
---|
| 398 | <p> |
---|
| 399 | You can define multiple queues to which users can submit jobs with |
---|
| 400 | the Capacity Scheduler. To define multiple queues, you should edit |
---|
| 401 | the site configuration for Hadoop and modify the |
---|
| 402 | <em>mapred.queue.names</em> property. |
---|
| 403 | </p> |
---|
| 404 | <p> |
---|
| 405 | You can also configure ACLs for controlling which users or groups |
---|
| 406 | have access to the queues. |
---|
| 407 | </p> |
---|
| 408 | <p> |
---|
| 409 | For more details, refer to |
---|
| 410 | <a href="cluster_setup.html#Configuring+the+Hadoop+Daemons">Cluster |
---|
| 411 | Setup</a> documentation. |
---|
| 412 | </p> |
---|
| 413 | <a name="N100B8"></a><a name="Configuring+properties+for+queues"></a> |
---|
| 414 | <h3 class="h4">Configuring properties for queues</h3> |
---|
| 415 | <p>The Capacity Scheduler can be configured with several properties |
---|
| 416 | for each queue that control the behavior of the Scheduler. This |
---|
| 417 | configuration is in the <em>conf/capacity-scheduler.xml</em>. By |
---|
| 418 | default, the configuration is set up for one queue, named |
---|
| 419 | <em>default</em>.</p> |
---|
| 420 | <p>To specify a property for a queue that is defined in the site |
---|
| 421 | configuration, you should use the property name as |
---|
| 422 | <em>mapred.capacity-scheduler.queue.<queue-name>.<property-name></em>. |
---|
| 423 | </p> |
---|
| 424 | <p>For example, to define the property <em>capacity</em> |
---|
| 425 | for queue named <em>research</em>, you should specify the property |
---|
| 426 | name as |
---|
| 427 | <em>mapred.capacity-scheduler.queue.research.capacity</em>. |
---|
| 428 | </p> |
---|
| 429 | <p>The properties defined for queues and their descriptions are |
---|
| 430 | listed in the table below:</p> |
---|
| 431 | <table class="ForrestTable" cellspacing="1" cellpadding="4"> |
---|
| 432 | |
---|
| 433 | <tr> |
---|
| 434 | <th colspan="1" rowspan="1">Name</th><th colspan="1" rowspan="1">Description</th> |
---|
| 435 | </tr> |
---|
| 436 | |
---|
| 437 | <tr> |
---|
| 438 | <td colspan="1" rowspan="1">mapred.capacity-scheduler.queue.<queue-name>.capacity</td> |
---|
| 439 | <td colspan="1" rowspan="1">Percentage of the number of slots in the cluster that are made |
---|
| 440 | to be available for jobs in this queue. The sum of capacities |
---|
| 441 | for all queues should be less than or equal 100.</td> |
---|
| 442 | |
---|
| 443 | </tr> |
---|
| 444 | |
---|
| 445 | <tr> |
---|
| 446 | <td colspan="1" rowspan="1">mapred.capacity-scheduler.queue.<queue-name>.supports-priority</td> |
---|
| 447 | <td colspan="1" rowspan="1">If true, priorities of jobs will be taken into account in scheduling |
---|
| 448 | decisions.</td> |
---|
| 449 | |
---|
| 450 | </tr> |
---|
| 451 | |
---|
| 452 | <tr> |
---|
| 453 | <td colspan="1" rowspan="1">mapred.capacity-scheduler.queue.<queue-name>.minimum-user-limit-percent</td> |
---|
| 454 | <td colspan="1" rowspan="1">Each queue enforces a limit on the percentage of resources |
---|
| 455 | allocated to a user at any given time, if there is competition |
---|
| 456 | for them. This user limit can vary between a minimum and maximum |
---|
| 457 | value. The former depends on the number of users who have submitted |
---|
| 458 | jobs, and the latter is set to this property value. For example, |
---|
| 459 | suppose the value of this property is 25. If two users have |
---|
| 460 | submitted jobs to a queue, no single user can use more than 50% |
---|
| 461 | of the queue resources. If a third user submits a job, no single |
---|
| 462 | user can use more than 33% of the queue resources. With 4 or more |
---|
| 463 | users, no user can use more than 25% of the queue's resources. A |
---|
| 464 | value of 100 implies no user limits are imposed.</td> |
---|
| 465 | |
---|
| 466 | </tr> |
---|
| 467 | |
---|
| 468 | </table> |
---|
| 469 | <a name="N1010E"></a><a name="Memory+management"></a> |
---|
| 470 | <h3 class="h4">Memory management</h3> |
---|
| 471 | <p>The Capacity Scheduler supports scheduling of tasks on a |
---|
| 472 | <span class="codefrag">TaskTracker</span>(TT) based on a job's memory requirements |
---|
| 473 | and the availability of RAM and Virtual Memory (VMEM) on the TT node. |
---|
| 474 | See the <a href="mapred_tutorial.html#Memory+monitoring">Hadoop |
---|
| 475 | Map/Reduce tutorial</a> for details on how the TT monitors |
---|
| 476 | memory usage.</p> |
---|
| 477 | <p>Currently the memory based scheduling is only supported |
---|
| 478 | in Linux platform.</p> |
---|
| 479 | <p>Memory-based scheduling works as follows:</p> |
---|
| 480 | <ol> |
---|
| 481 | |
---|
| 482 | <li>The absence of any one or more of three config parameters |
---|
| 483 | or -1 being set as value of any of the parameters, |
---|
| 484 | <span class="codefrag">mapred.tasktracker.vmem.reserved</span>, |
---|
| 485 | <span class="codefrag">mapred.task.default.maxvmem</span>, or |
---|
| 486 | <span class="codefrag">mapred.task.limit.maxvmem</span>, disables memory-based |
---|
| 487 | scheduling, just as it disables memory monitoring for a TT. These |
---|
| 488 | config parameters are described in the |
---|
| 489 | <a href="mapred_tutorial.html#Memory+monitoring">Hadoop Map/Reduce |
---|
| 490 | tutorial</a>. The value of |
---|
| 491 | <span class="codefrag">mapred.tasktracker.vmem.reserved</span> is |
---|
| 492 | obtained from the TT via its heartbeat. |
---|
| 493 | </li> |
---|
| 494 | |
---|
| 495 | <li>If all the three mandatory parameters are set, the Scheduler |
---|
| 496 | enables VMEM-based scheduling. First, the Scheduler computes the free |
---|
| 497 | VMEM on the TT. This is the difference between the available VMEM on the |
---|
| 498 | TT (the node's total VMEM minus the offset, both of which are sent by |
---|
| 499 | the TT on each heartbeat)and the sum of VMs already allocated to |
---|
| 500 | running tasks (i.e., sum of the VMEM task-limits). Next, the Scheduler |
---|
| 501 | looks at the VMEM requirements for the job that's first in line to |
---|
| 502 | run. If the job's VMEM requirements are less than the available VMEM on |
---|
| 503 | the node, the job's task can be scheduled. If not, the Scheduler |
---|
| 504 | ensures that the TT does not get a task to run (provided the job |
---|
| 505 | has tasks to run). This way, the Scheduler ensures that jobs with |
---|
| 506 | high memory requirements are not starved, as eventually, the TT |
---|
| 507 | will have enough VMEM available. If the high-mem job does not have |
---|
| 508 | any task to run, the Scheduler moves on to the next job. |
---|
| 509 | </li> |
---|
| 510 | |
---|
| 511 | <li>In addition to VMEM, the Capacity Scheduler can also consider |
---|
| 512 | RAM on the TT node. RAM is considered the same way as VMEM. TTs report |
---|
| 513 | the total RAM available on their node, and an offset. If both are |
---|
| 514 | set, the Scheduler computes the available RAM on the node. Next, |
---|
| 515 | the Scheduler figures out the RAM requirements of the job, if any. |
---|
| 516 | As with VMEM, users can optionally specify a RAM limit for their job |
---|
| 517 | (<span class="codefrag">mapred.task.maxpmem</span>, described in the Map/Reduce |
---|
| 518 | tutorial). The Scheduler also maintains a limit for this value |
---|
| 519 | (<span class="codefrag">mapred.capacity-scheduler.task.default-pmem-percentage-in-vmem</span>, |
---|
| 520 | described below). All these three values must be set for the |
---|
| 521 | Scheduler to schedule tasks based on RAM constraints. |
---|
| 522 | </li> |
---|
| 523 | |
---|
| 524 | <li>The Scheduler ensures that jobs cannot ask for RAM or VMEM higher |
---|
| 525 | than configured limits. If this happens, the job is failed when it |
---|
| 526 | is submitted. |
---|
| 527 | </li> |
---|
| 528 | |
---|
| 529 | </ol> |
---|
| 530 | <p>As described above, the additional scheduler-based config |
---|
| 531 | parameters are as follows:</p> |
---|
| 532 | <table class="ForrestTable" cellspacing="1" cellpadding="4"> |
---|
| 533 | |
---|
| 534 | <tr> |
---|
| 535 | <th colspan="1" rowspan="1">Name</th><th colspan="1" rowspan="1">Description</th> |
---|
| 536 | </tr> |
---|
| 537 | |
---|
| 538 | <tr> |
---|
| 539 | <td colspan="1" rowspan="1">mapred.capacity-scheduler.task.default-pmem-percentage-in-vmem</td> |
---|
| 540 | <td colspan="1" rowspan="1">A percentage of the default VMEM limit for jobs |
---|
| 541 | (<span class="codefrag">mapred.task.default.maxvmem</span>). This is the default |
---|
| 542 | RAM task-limit associated with a task. Unless overridden by a |
---|
| 543 | job's setting, this number defines the RAM task-limit.</td> |
---|
| 544 | |
---|
| 545 | </tr> |
---|
| 546 | |
---|
| 547 | <tr> |
---|
| 548 | <td colspan="1" rowspan="1">mapred.capacity-scheduler.task.limit.maxpmem</td> |
---|
| 549 | <td colspan="1" rowspan="1">Configuration which provides an upper limit to maximum physical |
---|
| 550 | memory which can be specified by a job. If a job requires more |
---|
| 551 | physical memory than what is specified in this limit then the same |
---|
| 552 | is rejected.</td> |
---|
| 553 | |
---|
| 554 | </tr> |
---|
| 555 | |
---|
| 556 | </table> |
---|
| 557 | <a name="N10175"></a><a name="Job+Initialization+Parameters"></a> |
---|
| 558 | <h3 class="h4">Job Initialization Parameters</h3> |
---|
| 559 | <p>Capacity scheduler lazily initializes the jobs before they are |
---|
| 560 | scheduled, for reducing the memory footprint on jobtracker. |
---|
| 561 | Following are the parameters, by which you can control the laziness |
---|
| 562 | of the job initialization. The following parameters can be |
---|
| 563 | configured in capacity-scheduler.xml |
---|
| 564 | </p> |
---|
| 565 | <table class="ForrestTable" cellspacing="1" cellpadding="4"> |
---|
| 566 | |
---|
| 567 | <tr> |
---|
| 568 | <th colspan="1" rowspan="1">Name</th><th colspan="1" rowspan="1">Description</th> |
---|
| 569 | </tr> |
---|
| 570 | |
---|
| 571 | <tr> |
---|
| 572 | |
---|
| 573 | <td colspan="1" rowspan="1"> |
---|
| 574 | mapred.capacity-scheduler.queue.<queue-name>.maximum-initialized-jobs-per-user |
---|
| 575 | </td> |
---|
| 576 | <td colspan="1" rowspan="1"> |
---|
| 577 | Maximum number of jobs which are allowed to be pre-initialized for |
---|
| 578 | a particular user in the queue. Once a job is scheduled, i.e. |
---|
| 579 | it starts running, then that job is not considered |
---|
| 580 | while scheduler computes the maximum job a user is allowed to |
---|
| 581 | initialize. |
---|
| 582 | </td> |
---|
| 583 | |
---|
| 584 | </tr> |
---|
| 585 | |
---|
| 586 | <tr> |
---|
| 587 | |
---|
| 588 | <td colspan="1" rowspan="1"> |
---|
| 589 | mapred.capacity-scheduler.init-poll-interval |
---|
| 590 | </td> |
---|
| 591 | <td colspan="1" rowspan="1"> |
---|
| 592 | Amount of time in miliseconds which is used to poll the scheduler |
---|
| 593 | job queue to look for jobs to be initialized. |
---|
| 594 | </td> |
---|
| 595 | |
---|
| 596 | </tr> |
---|
| 597 | |
---|
| 598 | <tr> |
---|
| 599 | |
---|
| 600 | <td colspan="1" rowspan="1"> |
---|
| 601 | mapred.capacity-scheduler.init-worker-threads |
---|
| 602 | </td> |
---|
| 603 | <td colspan="1" rowspan="1"> |
---|
| 604 | Number of worker threads which would be used by Initialization |
---|
| 605 | poller to initialize jobs in a set of queue. If number mentioned |
---|
| 606 | in property is equal to number of job queues then a thread is |
---|
| 607 | assigned jobs from one queue. If the number configured is lesser than |
---|
| 608 | number of queues, then a thread can get jobs from more than one queue |
---|
| 609 | which it initializes in a round robin fashion. If the number configured |
---|
| 610 | is greater than number of queues, then number of threads spawned |
---|
| 611 | would be equal to number of job queues. |
---|
| 612 | </td> |
---|
| 613 | |
---|
| 614 | </tr> |
---|
| 615 | |
---|
| 616 | </table> |
---|
| 617 | <a name="N101B3"></a><a name="Reviewing+the+configuration+of+the+Capacity+Scheduler"></a> |
---|
| 618 | <h3 class="h4">Reviewing the configuration of the Capacity Scheduler</h3> |
---|
| 619 | <p> |
---|
| 620 | Once the installation and configuration is completed, you can review |
---|
| 621 | it after starting the Map/Reduce cluster from the admin UI. |
---|
| 622 | </p> |
---|
| 623 | <ul> |
---|
| 624 | |
---|
| 625 | <li>Start the Map/Reduce cluster as usual.</li> |
---|
| 626 | |
---|
| 627 | <li>Open the JobTracker web UI.</li> |
---|
| 628 | |
---|
| 629 | <li>The queues you have configured should be listed under the <em>Scheduling |
---|
| 630 | Information</em> section of the page.</li> |
---|
| 631 | |
---|
| 632 | <li>The properties for the queues should be visible in the <em>Scheduling |
---|
| 633 | Information</em> column against each queue.</li> |
---|
| 634 | |
---|
| 635 | </ul> |
---|
| 636 | </div> |
---|
| 637 | |
---|
| 638 | </div> |
---|
| 639 | <!--+ |
---|
| 640 | |end content |
---|
| 641 | +--> |
---|
| 642 | <div class="clearboth"> </div> |
---|
| 643 | </div> |
---|
| 644 | <div id="footer"> |
---|
| 645 | <!--+ |
---|
| 646 | |start bottomstrip |
---|
| 647 | +--> |
---|
| 648 | <div class="lastmodified"> |
---|
| 649 | <script type="text/javascript"><!-- |
---|
| 650 | document.write("Last Published: " + document.lastModified); |
---|
| 651 | // --></script> |
---|
| 652 | </div> |
---|
| 653 | <div class="copyright"> |
---|
| 654 | Copyright © |
---|
| 655 | 2008 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a> |
---|
| 656 | </div> |
---|
| 657 | <!--+ |
---|
| 658 | |end bottomstrip |
---|
| 659 | +--> |
---|
| 660 | </div> |
---|
| 661 | </body> |
---|
| 662 | </html> |
---|