SecureMode.apt.vm 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  1. ~~ Licensed under the Apache License, Version 2.0 (the "License");
  2. ~~ you may not use this file except in compliance with the License.
  3. ~~ You may obtain a copy of the License at
  4. ~~
  5. ~~ http://www.apache.org/licenses/LICENSE-2.0
  6. ~~
  7. ~~ Unless required by applicable law or agreed to in writing, software
  8. ~~ distributed under the License is distributed on an "AS IS" BASIS,
  9. ~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. ~~ See the License for the specific language governing permissions and
  11. ~~ limitations under the License. See accompanying LICENSE file.
  12. ---
  13. Hadoop in Secure Mode
  14. ---
  15. ---
  16. ${maven.build.timestamp}
  17. %{toc|section=0|fromDepth=0|toDepth=3}
  18. Hadoop in Secure Mode
  19. * Introduction
  20. This document describes how to configure authentication for Hadoop in
  21. secure mode.
  22. By default Hadoop runs in non-secure mode in which no actual
  23. authentication is required.
  24. By configuring Hadoop runs in secure mode,
  25. each user and service needs to be authenticated by Kerberos
  26. in order to use Hadoop services.
  27. Security features of Hadoop consist of
  28. {{{Authentication}authentication}},
  29. {{{./ServiceLevelAuth.html}service level authorization}},
  30. {{{./HttpAuthentication.html}authentication for Web consoles}}
  31. and {{{Data confidentiality}data confidenciality}}.
  32. * Authentication
  33. ** End User Accounts
  34. When service level authentication is turned on,
  35. end users using Hadoop in secure mode needs to be authenticated by Kerberos.
  36. The simplest way to do authentication is using <<<kinit>>> command of Kerberos.
  37. ** User Accounts for Hadoop Daemons
  38. Ensure that HDFS and YARN daemons run as different Unix users,
  39. e.g. <<<hdfs>>> and <<<yarn>>>.
  40. Also, ensure that the MapReduce JobHistory server runs as
  41. different user such as <<<mapred>>>.
  42. It's recommended to have them share a Unix group, for e.g. <<<hadoop>>>.
  43. See also "{{Mapping from user to group}}" for group management.
  44. *---------------+----------------------------------------------------------------------+
  45. || User:Group || Daemons |
  46. *---------------+----------------------------------------------------------------------+
  47. | hdfs:hadoop | NameNode, Secondary NameNode, JournalNode, DataNode |
  48. *---------------+----------------------------------------------------------------------+
  49. | yarn:hadoop | ResourceManager, NodeManager |
  50. *---------------+----------------------------------------------------------------------+
  51. | mapred:hadoop | MapReduce JobHistory Server |
  52. *---------------+----------------------------------------------------------------------+
  53. ** Kerberos principals for Hadoop Daemons and Users
  54. For running hadoop service daemons in Hadoop in secure mode,
  55. Kerberos principals are required.
  56. Each service reads auhenticate information saved in keytab file with appropriate permission.
  57. HTTP web-consoles should be served by principal different from RPC's one.
  58. Subsections below shows the examples of credentials for Hadoop services.
  59. *** HDFS
  60. The NameNode keytab file, on the NameNode host, should look like the
  61. following:
  62. ----
  63. $ klist -e -k -t /etc/security/keytab/nn.service.keytab
  64. Keytab name: FILE:/etc/security/keytab/nn.service.keytab
  65. KVNO Timestamp Principal
  66. 4 07/18/11 21:08:09 nn/full.qualified.domain.name@REALM.TLD (AES-256 CTS mode with 96-bit SHA-1 HMAC)
  67. 4 07/18/11 21:08:09 nn/full.qualified.domain.name@REALM.TLD (AES-128 CTS mode with 96-bit SHA-1 HMAC)
  68. 4 07/18/11 21:08:09 nn/full.qualified.domain.name@REALM.TLD (ArcFour with HMAC/md5)
  69. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (AES-256 CTS mode with 96-bit SHA-1 HMAC)
  70. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (AES-128 CTS mode with 96-bit SHA-1 HMAC)
  71. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (ArcFour with HMAC/md5)
  72. ----
  73. The Secondary NameNode keytab file, on that host, should look like the
  74. following:
  75. ----
  76. $ klist -e -k -t /etc/security/keytab/sn.service.keytab
  77. Keytab name: FILE:/etc/security/keytab/sn.service.keytab
  78. KVNO Timestamp Principal
  79. 4 07/18/11 21:08:09 sn/full.qualified.domain.name@REALM.TLD (AES-256 CTS mode with 96-bit SHA-1 HMAC)
  80. 4 07/18/11 21:08:09 sn/full.qualified.domain.name@REALM.TLD (AES-128 CTS mode with 96-bit SHA-1 HMAC)
  81. 4 07/18/11 21:08:09 sn/full.qualified.domain.name@REALM.TLD (ArcFour with HMAC/md5)
  82. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (AES-256 CTS mode with 96-bit SHA-1 HMAC)
  83. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (AES-128 CTS mode with 96-bit SHA-1 HMAC)
  84. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (ArcFour with HMAC/md5)
  85. ----
  86. The DataNode keytab file, on each host, should look like the following:
  87. ----
  88. $ klist -e -k -t /etc/security/keytab/dn.service.keytab
  89. Keytab name: FILE:/etc/security/keytab/dn.service.keytab
  90. KVNO Timestamp Principal
  91. 4 07/18/11 21:08:09 dn/full.qualified.domain.name@REALM.TLD (AES-256 CTS mode with 96-bit SHA-1 HMAC)
  92. 4 07/18/11 21:08:09 dn/full.qualified.domain.name@REALM.TLD (AES-128 CTS mode with 96-bit SHA-1 HMAC)
  93. 4 07/18/11 21:08:09 dn/full.qualified.domain.name@REALM.TLD (ArcFour with HMAC/md5)
  94. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (AES-256 CTS mode with 96-bit SHA-1 HMAC)
  95. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (AES-128 CTS mode with 96-bit SHA-1 HMAC)
  96. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (ArcFour with HMAC/md5)
  97. ----
  98. *** YARN
  99. The ResourceManager keytab file, on the ResourceManager host, should look
  100. like the following:
  101. ----
  102. $ klist -e -k -t /etc/security/keytab/rm.service.keytab
  103. Keytab name: FILE:/etc/security/keytab/rm.service.keytab
  104. KVNO Timestamp Principal
  105. 4 07/18/11 21:08:09 rm/full.qualified.domain.name@REALM.TLD (AES-256 CTS mode with 96-bit SHA-1 HMAC)
  106. 4 07/18/11 21:08:09 rm/full.qualified.domain.name@REALM.TLD (AES-128 CTS mode with 96-bit SHA-1 HMAC)
  107. 4 07/18/11 21:08:09 rm/full.qualified.domain.name@REALM.TLD (ArcFour with HMAC/md5)
  108. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (AES-256 CTS mode with 96-bit SHA-1 HMAC)
  109. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (AES-128 CTS mode with 96-bit SHA-1 HMAC)
  110. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (ArcFour with HMAC/md5)
  111. ----
  112. The NodeManager keytab file, on each host, should look like the following:
  113. ----
  114. $ klist -e -k -t /etc/security/keytab/nm.service.keytab
  115. Keytab name: FILE:/etc/security/keytab/nm.service.keytab
  116. KVNO Timestamp Principal
  117. 4 07/18/11 21:08:09 nm/full.qualified.domain.name@REALM.TLD (AES-256 CTS mode with 96-bit SHA-1 HMAC)
  118. 4 07/18/11 21:08:09 nm/full.qualified.domain.name@REALM.TLD (AES-128 CTS mode with 96-bit SHA-1 HMAC)
  119. 4 07/18/11 21:08:09 nm/full.qualified.domain.name@REALM.TLD (ArcFour with HMAC/md5)
  120. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (AES-256 CTS mode with 96-bit SHA-1 HMAC)
  121. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (AES-128 CTS mode with 96-bit SHA-1 HMAC)
  122. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (ArcFour with HMAC/md5)
  123. ----
  124. *** MapReduce JobHistory Server
  125. The MapReduce JobHistory Server keytab file, on that host, should look
  126. like the following:
  127. ----
  128. $ klist -e -k -t /etc/security/keytab/jhs.service.keytab
  129. Keytab name: FILE:/etc/security/keytab/jhs.service.keytab
  130. KVNO Timestamp Principal
  131. 4 07/18/11 21:08:09 jhs/full.qualified.domain.name@REALM.TLD (AES-256 CTS mode with 96-bit SHA-1 HMAC)
  132. 4 07/18/11 21:08:09 jhs/full.qualified.domain.name@REALM.TLD (AES-128 CTS mode with 96-bit SHA-1 HMAC)
  133. 4 07/18/11 21:08:09 jhs/full.qualified.domain.name@REALM.TLD (ArcFour with HMAC/md5)
  134. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (AES-256 CTS mode with 96-bit SHA-1 HMAC)
  135. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (AES-128 CTS mode with 96-bit SHA-1 HMAC)
  136. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (ArcFour with HMAC/md5)
  137. ----
  138. ** Mapping from Kerberos principal to OS user account
  139. Hadoop maps Kerberos principal to OS user account using
  140. the rule specified by <<<hadoop.security.auth_to_local>>>
  141. which works in the same way as the <<<auth_to_local>>> in
  142. {{{http://web.mit.edu/Kerberos/krb5-latest/doc/admin/conf_files/krb5_conf.html}Kerberos configuration file (krb5.conf)}}.
  143. In addition, Hadoop <<<auth_to_local>>> mapping supports the <</L>> flag that
  144. lowercases the returned name.
  145. By default, it picks the first component of principal name as a user name
  146. if the realms matches to the <<<default_realm>>> (usually defined in /etc/krb5.conf).
  147. For example, <<<host/full.qualified.domain.name@REALM.TLD>>> is mapped to <<<host>>>
  148. by default rule.
  149. ** Mapping from user to group
  150. Though files on HDFS are associated to owner and group,
  151. Hadoop does not have the definition of group by itself.
  152. Mapping from user to group is done by OS or LDAP.
  153. You can change a way of mapping by
  154. specifying the name of mapping provider as a value of
  155. <<<hadoop.security.group.mapping>>>
  156. See {{{../hadoop-hdfs/HdfsPermissionsGuide.html}HDFS Permissions Guide}} for details.
  157. Practically you need to manage SSO environment using Kerberos with LDAP
  158. for Hadoop in secure mode.
  159. ** Proxy user
  160. Some products such as Apache Oozie which access the services of Hadoop
  161. on behalf of end users need to be able to impersonate end users.
  162. You can configure proxy user using properties
  163. <<<hadoop.proxyuser.${superuser}.hosts>>> along with either or both of
  164. <<<hadoop.proxyuser.${superuser}.groups>>>
  165. and <<<hadoop.proxyuser.${superuser}.users>>>.
  166. For example, by specifying as below in core-site.xml,
  167. user named <<<oozie>>> accessing from any host
  168. can impersonate any user belonging to any group.
  169. ----
  170. <property>
  171. <name>hadoop.proxyuser.oozie.hosts</name>
  172. <value>*</value>
  173. </property>
  174. <property>
  175. <name>hadoop.proxyuser.oozie.groups</name>
  176. <value>*</value>
  177. </property>
  178. ----
  179. User named <<<oozie>>> accessing from any host
  180. can impersonate user1 and user2 by specifying as below in core-site.xml.
  181. ----
  182. <property>
  183. <name>hadoop.proxyuser.oozie.hosts</name>
  184. <value>*</value>
  185. </property>
  186. <property>
  187. <name>hadoop.proxyuser.oozie.users</name>
  188. <value>user1,user2</value>
  189. </property>
  190. ----
  191. The <<<hadoop.proxyuser.${superuser}.hosts>>> accepts list of ip addresses,
  192. ip address ranges in CIDR format and/or host names.
  193. For example, by specifying as below in core-site.xml,
  194. user named <<<oozie>>> accessing from hosts in the range
  195. 10.222.0.0-15 and 10.113.221.221
  196. can impersonate any user belonging to any group.
  197. ----
  198. <property>
  199. <name>hadoop.proxyuser.oozie.hosts</name>
  200. <value>10.222.0.0/16,10.113.221.221</value>
  201. </property>
  202. <property>
  203. <name>hadoop.proxyuser.oozie.groups</name>
  204. <value>*</value>
  205. </property>
  206. ----
  207. ** Secure DataNode
  208. Because the data transfer protocol of DataNode
  209. does not use the RPC framework of Hadoop,
  210. DataNode must authenticate itself by
  211. using privileged ports which are specified by
  212. <<<dfs.datanode.address>>> and <<<dfs.datanode.http.address>>>.
  213. This authentication is based on the assumption
  214. that the attacker won't be able to get root privileges.
  215. When you execute <<<hdfs datanode>>> command as root,
  216. server process binds privileged port at first,
  217. then drops privilege and runs as the user account specified by
  218. <<<HADOOP_SECURE_DN_USER>>>.
  219. This startup process uses jsvc installed to <<<JSVC_HOME>>>.
  220. You must specify <<<HADOOP_SECURE_DN_USER>>> and <<<JSVC_HOME>>>
  221. as environment variables on start up (in hadoop-env.sh).
  222. * Data confidentiality
  223. ** Data Encryption on RPC
  224. The data transfered between hadoop services and clients.
  225. Setting <<<hadoop.rpc.protection>>> to <<<"privacy">>> in the core-site.xml
  226. activate data encryption.
  227. ** Data Encryption on Block data transfer.
  228. You need to set <<<dfs.encrypt.data.transfer>>> to <<<"true">>> in the hdfs-site.xml
  229. in order to activate data encryption for data transfer protocol of DataNode.
  230. ** Data Encryption on HTTP
  231. Data transfer between Web-console and clients are protected by using SSL(HTTPS).
  232. * Configuration
  233. ** Permissions for both HDFS and local fileSystem paths
  234. The following table lists various paths on HDFS and local filesystems (on
  235. all nodes) and recommended permissions:
  236. *-------------------+-------------------+------------------+------------------+
  237. || Filesystem || Path || User:Group || Permissions |
  238. *-------------------+-------------------+------------------+------------------+
  239. | local | <<<dfs.namenode.name.dir>>> | hdfs:hadoop | drwx------ |
  240. *-------------------+-------------------+------------------+------------------+
  241. | local | <<<dfs.datanode.data.dir>>> | hdfs:hadoop | drwx------ |
  242. *-------------------+-------------------+------------------+------------------+
  243. | local | $HADOOP_LOG_DIR | hdfs:hadoop | drwxrwxr-x |
  244. *-------------------+-------------------+------------------+------------------+
  245. | local | $YARN_LOG_DIR | yarn:hadoop | drwxrwxr-x |
  246. *-------------------+-------------------+------------------+------------------+
  247. | local | <<<yarn.nodemanager.local-dirs>>> | yarn:hadoop | drwxr-xr-x |
  248. *-------------------+-------------------+------------------+------------------+
  249. | local | <<<yarn.nodemanager.log-dirs>>> | yarn:hadoop | drwxr-xr-x |
  250. *-------------------+-------------------+------------------+------------------+
  251. | local | container-executor | root:hadoop | --Sr-s--- |
  252. *-------------------+-------------------+------------------+------------------+
  253. | local | <<<conf/container-executor.cfg>>> | root:hadoop | r-------- |
  254. *-------------------+-------------------+------------------+------------------+
  255. | hdfs | / | hdfs:hadoop | drwxr-xr-x |
  256. *-------------------+-------------------+------------------+------------------+
  257. | hdfs | /tmp | hdfs:hadoop | drwxrwxrwxt |
  258. *-------------------+-------------------+------------------+------------------+
  259. | hdfs | /user | hdfs:hadoop | drwxr-xr-x |
  260. *-------------------+-------------------+------------------+------------------+
  261. | hdfs | <<<yarn.nodemanager.remote-app-log-dir>>> | yarn:hadoop | drwxrwxrwxt |
  262. *-------------------+-------------------+------------------+------------------+
  263. | hdfs | <<<mapreduce.jobhistory.intermediate-done-dir>>> | mapred:hadoop | |
  264. | | | | drwxrwxrwxt |
  265. *-------------------+-------------------+------------------+------------------+
  266. | hdfs | <<<mapreduce.jobhistory.done-dir>>> | mapred:hadoop | |
  267. | | | | drwxr-x--- |
  268. *-------------------+-------------------+------------------+------------------+
  269. ** Common Configurations
  270. In order to turn on RPC authentication in hadoop,
  271. set the value of <<<hadoop.security.authentication>>> property to
  272. <<<"kerberos">>>, and set security related settings listed below appropriately.
  273. The following properties should be in the <<<core-site.xml>>> of all the
  274. nodes in the cluster.
  275. *-------------------------+-------------------------+------------------------+
  276. || Parameter || Value || Notes |
  277. *-------------------------+-------------------------+------------------------+
  278. | <<<hadoop.security.authentication>>> | <kerberos> | |
  279. | | | <<<simple>>> : No authentication. (default) \
  280. | | | <<<kerberos>>> : Enable authentication by Kerberos. |
  281. *-------------------------+-------------------------+------------------------+
  282. | <<<hadoop.security.authorization>>> | <true> | |
  283. | | | Enable {{{./ServiceLevelAuth.html}RPC service-level authorization}}. |
  284. *-------------------------+-------------------------+------------------------+
  285. | <<<hadoop.rpc.protection>>> | <authentication> |
  286. | | | <authentication> : authentication only (default) \
  287. | | | <integrity> : integrity check in addition to authentication \
  288. | | | <privacy> : data encryption in addition to integrity |
  289. *-------------------------+-------------------------+------------------------+
  290. | <<<hadoop.security.auth_to_local>>> | | |
  291. | | <<<RULE:>>><exp1>\
  292. | | <<<RULE:>>><exp2>\
  293. | | <...>\
  294. | | DEFAULT |
  295. | | | The value is string containing new line characters.
  296. | | | See
  297. | | | {{{http://web.mit.edu/Kerberos/krb5-latest/doc/admin/conf_files/krb5_conf.html}Kerberos documentation}}
  298. | | | for format for <exp>.
  299. *-------------------------+-------------------------+------------------------+
  300. | <<<hadoop.proxyuser.>>><superuser><<<.hosts>>> | | |
  301. | | | comma separated hosts from which <superuser> access are allowd to impersonation. |
  302. | | | <<<*>>> means wildcard. |
  303. *-------------------------+-------------------------+------------------------+
  304. | <<<hadoop.proxyuser.>>><superuser><<<.groups>>> | | |
  305. | | | comma separated groups to which users impersonated by <superuser> belongs. |
  306. | | | <<<*>>> means wildcard. |
  307. *-------------------------+-------------------------+------------------------+
  308. Configuration for <<<conf/core-site.xml>>>
  309. ** NameNode
  310. *-------------------------+-------------------------+------------------------+
  311. || Parameter || Value || Notes |
  312. *-------------------------+-------------------------+------------------------+
  313. | <<<dfs.block.access.token.enable>>> | <true> | |
  314. | | | Enable HDFS block access tokens for secure operations. |
  315. *-------------------------+-------------------------+------------------------+
  316. | <<<dfs.https.enable>>> | <true> | |
  317. | | | This value is deprecated. Use dfs.http.policy |
  318. *-------------------------+-------------------------+------------------------+
  319. | <<<dfs.http.policy>>> | <HTTP_ONLY> or <HTTPS_ONLY> or <HTTP_AND_HTTPS> | |
  320. | | | HTTPS_ONLY turns off http access. This option takes precedence over |
  321. | | | the deprecated configuration dfs.https.enable and hadoop.ssl.enabled. |
  322. *-------------------------+-------------------------+------------------------+
  323. | <<<dfs.namenode.https-address>>> | <nn_host_fqdn:50470> | |
  324. *-------------------------+-------------------------+------------------------+
  325. | <<<dfs.https.port>>> | <50470> | |
  326. *-------------------------+-------------------------+------------------------+
  327. | <<<dfs.namenode.keytab.file>>> | </etc/security/keytab/nn.service.keytab> | |
  328. | | | Kerberos keytab file for the NameNode. |
  329. *-------------------------+-------------------------+------------------------+
  330. | <<<dfs.namenode.kerberos.principal>>> | nn/_HOST@REALM.TLD | |
  331. | | | Kerberos principal name for the NameNode. |
  332. *-------------------------+-------------------------+------------------------+
  333. | <<<dfs.namenode.kerberos.https.principal>>> | host/_HOST@REALM.TLD | |
  334. | | | HTTPS Kerberos principal name for the NameNode. |
  335. *-------------------------+-------------------------+------------------------+
  336. Configuration for <<<conf/hdfs-site.xml>>>
  337. ** Secondary NameNode
  338. *-------------------------+-------------------------+------------------------+
  339. || Parameter || Value || Notes |
  340. *-------------------------+-------------------------+------------------------+
  341. | <<<dfs.namenode.secondary.http-address>>> | <c_nn_host_fqdn:50090> | |
  342. *-------------------------+-------------------------+------------------------+
  343. | <<<dfs.namenode.secondary.https-port>>> | <50470> | |
  344. *-------------------------+-------------------------+------------------------+
  345. | <<<dfs.namenode.secondary.keytab.file>>> | | |
  346. | | </etc/security/keytab/sn.service.keytab> | |
  347. | | | Kerberos keytab file for the NameNode. |
  348. *-------------------------+-------------------------+------------------------+
  349. | <<<dfs.namenode.secondary.kerberos.principal>>> | sn/_HOST@REALM.TLD | |
  350. | | | Kerberos principal name for the Secondary NameNode. |
  351. *-------------------------+-------------------------+------------------------+
  352. | <<<dfs.namenode.secondary.kerberos.https.principal>>> | | |
  353. | | host/_HOST@REALM.TLD | |
  354. | | | HTTPS Kerberos principal name for the Secondary NameNode. |
  355. *-------------------------+-------------------------+------------------------+
  356. Configuration for <<<conf/hdfs-site.xml>>>
  357. ** DataNode
  358. *-------------------------+-------------------------+------------------------+
  359. || Parameter || Value || Notes |
  360. *-------------------------+-------------------------+------------------------+
  361. | <<<dfs.datanode.data.dir.perm>>> | 700 | |
  362. *-------------------------+-------------------------+------------------------+
  363. | <<<dfs.datanode.address>>> | <0.0.0.0:1004> | |
  364. | | | Secure DataNode must use privileged port |
  365. | | | in order to assure that the server was started securely. |
  366. | | | This means that the server must be started via jsvc. |
  367. *-------------------------+-------------------------+------------------------+
  368. | <<<dfs.datanode.http.address>>> | <0.0.0.0:1006> | |
  369. | | | Secure DataNode must use privileged port |
  370. | | | in order to assure that the server was started securely. |
  371. | | | This means that the server must be started via jsvc. |
  372. *-------------------------+-------------------------+------------------------+
  373. | <<<dfs.datanode.https.address>>> | <0.0.0.0:50470> | |
  374. *-------------------------+-------------------------+------------------------+
  375. | <<<dfs.datanode.keytab.file>>> | </etc/security/keytab/dn.service.keytab> | |
  376. | | | Kerberos keytab file for the DataNode. |
  377. *-------------------------+-------------------------+------------------------+
  378. | <<<dfs.datanode.kerberos.principal>>> | dn/_HOST@REALM.TLD | |
  379. | | | Kerberos principal name for the DataNode. |
  380. *-------------------------+-------------------------+------------------------+
  381. | <<<dfs.datanode.kerberos.https.principal>>> | | |
  382. | | host/_HOST@REALM.TLD | |
  383. | | | HTTPS Kerberos principal name for the DataNode. |
  384. *-------------------------+-------------------------+------------------------+
  385. | <<<dfs.encrypt.data.transfer>>> | <false> | |
  386. | | | set to <<<true>>> when using data encryption |
  387. *-------------------------+-------------------------+------------------------+
  388. Configuration for <<<conf/hdfs-site.xml>>>
  389. ** WebHDFS
  390. *-------------------------+-------------------------+------------------------+
  391. || Parameter || Value || Notes |
  392. *-------------------------+-------------------------+------------------------+
  393. | <<<dfs.web.authentication.kerberos.principal>>> | http/_HOST@REALM.TLD | |
  394. | | | Kerberos keytab file for the WebHDFS. |
  395. *-------------------------+-------------------------+------------------------+
  396. | <<<dfs.web.authentication.kerberos.keytab>>> | </etc/security/keytab/http.service.keytab> | |
  397. | | | Kerberos principal name for WebHDFS. |
  398. *-------------------------+-------------------------+------------------------+
  399. Configuration for <<<conf/hdfs-site.xml>>>
  400. ** ResourceManager
  401. *-------------------------+-------------------------+------------------------+
  402. || Parameter || Value || Notes |
  403. *-------------------------+-------------------------+------------------------+
  404. | <<<yarn.resourcemanager.keytab>>> | | |
  405. | | </etc/security/keytab/rm.service.keytab> | |
  406. | | | Kerberos keytab file for the ResourceManager. |
  407. *-------------------------+-------------------------+------------------------+
  408. | <<<yarn.resourcemanager.principal>>> | rm/_HOST@REALM.TLD | |
  409. | | | Kerberos principal name for the ResourceManager. |
  410. *-------------------------+-------------------------+------------------------+
  411. Configuration for <<<conf/yarn-site.xml>>>
  412. ** NodeManager
  413. *-------------------------+-------------------------+------------------------+
  414. || Parameter || Value || Notes |
  415. *-------------------------+-------------------------+------------------------+
  416. | <<<yarn.nodemanager.keytab>>> | </etc/security/keytab/nm.service.keytab> | |
  417. | | | Kerberos keytab file for the NodeManager. |
  418. *-------------------------+-------------------------+------------------------+
  419. | <<<yarn.nodemanager.principal>>> | nm/_HOST@REALM.TLD | |
  420. | | | Kerberos principal name for the NodeManager. |
  421. *-------------------------+-------------------------+------------------------+
  422. | <<<yarn.nodemanager.container-executor.class>>> | | |
  423. | | <<<org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor>>> |
  424. | | | Use LinuxContainerExecutor. |
  425. *-------------------------+-------------------------+------------------------+
  426. | <<<yarn.nodemanager.linux-container-executor.group>>> | <hadoop> | |
  427. | | | Unix group of the NodeManager. |
  428. *-------------------------+-------------------------+------------------------+
  429. | <<<yarn.nodemanager.linux-container-executor.path>>> | </path/to/bin/container-executor> | |
  430. | | | The path to the executable of Linux container executor. |
  431. *-------------------------+-------------------------+------------------------+
  432. Configuration for <<<conf/yarn-site.xml>>>
  433. ** Configuration for WebAppProxy
  434. The <<<WebAppProxy>>> provides a proxy between the web applications
  435. exported by an application and an end user. If security is enabled
  436. it will warn users before accessing a potentially unsafe web application.
  437. Authentication and authorization using the proxy is handled just like
  438. any other privileged web application.
  439. *-------------------------+-------------------------+------------------------+
  440. || Parameter || Value || Notes |
  441. *-------------------------+-------------------------+------------------------+
  442. | <<<yarn.web-proxy.address>>> | | |
  443. | | <<<WebAppProxy>>> host:port for proxy to AM web apps. | |
  444. | | | <host:port> if this is the same as <<<yarn.resourcemanager.webapp.address>>>|
  445. | | | or it is not defined then the <<<ResourceManager>>> will run the proxy|
  446. | | | otherwise a standalone proxy server will need to be launched.|
  447. *-------------------------+-------------------------+------------------------+
  448. | <<<yarn.web-proxy.keytab>>> | | |
  449. | | </etc/security/keytab/web-app.service.keytab> | |
  450. | | | Kerberos keytab file for the WebAppProxy. |
  451. *-------------------------+-------------------------+------------------------+
  452. | <<<yarn.web-proxy.principal>>> | wap/_HOST@REALM.TLD | |
  453. | | | Kerberos principal name for the WebAppProxy. |
  454. *-------------------------+-------------------------+------------------------+
  455. Configuration for <<<conf/yarn-site.xml>>>
  456. ** LinuxContainerExecutor
  457. A <<<ContainerExecutor>>> used by YARN framework which define how any
  458. <container> launched and controlled.
  459. The following are the available in Hadoop YARN:
  460. *--------------------------------------+--------------------------------------+
  461. || ContainerExecutor || Description |
  462. *--------------------------------------+--------------------------------------+
  463. | <<<DefaultContainerExecutor>>> | |
  464. | | The default executor which YARN uses to manage container execution. |
  465. | | The container process has the same Unix user as the NodeManager. |
  466. *--------------------------------------+--------------------------------------+
  467. | <<<LinuxContainerExecutor>>> | |
  468. | | Supported only on GNU/Linux, this executor runs the containers as either the |
  469. | | YARN user who submitted the application (when full security is enabled) or |
  470. | | as a dedicated user (defaults to nobody) when full security is not enabled. |
  471. | | When full security is enabled, this executor requires all user accounts to be |
  472. | | created on the cluster nodes where the containers are launched. It uses |
  473. | | a <setuid> executable that is included in the Hadoop distribution. |
  474. | | The NodeManager uses this executable to launch and kill containers. |
  475. | | The setuid executable switches to the user who has submitted the |
  476. | | application and launches or kills the containers. For maximum security, |
  477. | | this executor sets up restricted permissions and user/group ownership of |
  478. | | local files and directories used by the containers such as the shared |
  479. | | objects, jars, intermediate files, log files etc. Particularly note that, |
  480. | | because of this, except the application owner and NodeManager, no other |
  481. | | user can access any of the local files/directories including those |
  482. | | localized as part of the distributed cache. |
  483. *--------------------------------------+--------------------------------------+
  484. To build the LinuxContainerExecutor executable run:
  485. ----
  486. $ mvn package -Dcontainer-executor.conf.dir=/etc/hadoop/
  487. ----
  488. The path passed in <<<-Dcontainer-executor.conf.dir>>> should be the
  489. path on the cluster nodes where a configuration file for the setuid
  490. executable should be located. The executable should be installed in
  491. $HADOOP_YARN_HOME/bin.
  492. The executable must have specific permissions: 6050 or --Sr-s---
  493. permissions user-owned by <root> (super-user) and group-owned by a
  494. special group (e.g. <<<hadoop>>>) of which the NodeManager Unix user is
  495. the group member and no ordinary application user is. If any application
  496. user belongs to this special group, security will be compromised. This
  497. special group name should be specified for the configuration property
  498. <<<yarn.nodemanager.linux-container-executor.group>>> in both
  499. <<<conf/yarn-site.xml>>> and <<<conf/container-executor.cfg>>>.
  500. For example, let's say that the NodeManager is run as user <yarn> who is
  501. part of the groups users and <hadoop>, any of them being the primary group.
  502. Let also be that <users> has both <yarn> and another user
  503. (application submitter) <alice> as its members, and <alice> does not
  504. belong to <hadoop>. Going by the above description, the setuid/setgid
  505. executable should be set 6050 or --Sr-s--- with user-owner as <yarn> and
  506. group-owner as <hadoop> which has <yarn> as its member (and not <users>
  507. which has <alice> also as its member besides <yarn>).
  508. The LinuxTaskController requires that paths including and leading up to
  509. the directories specified in <<<yarn.nodemanager.local-dirs>>> and
  510. <<<yarn.nodemanager.log-dirs>>> to be set 755 permissions as described
  511. above in the table on permissions on directories.
  512. * <<<conf/container-executor.cfg>>>
  513. The executable requires a configuration file called
  514. <<<container-executor.cfg>>> to be present in the configuration
  515. directory passed to the mvn target mentioned above.
  516. The configuration file must be owned by the user running NodeManager
  517. (user <<<yarn>>> in the above example), group-owned by anyone and
  518. should have the permissions 0400 or r--------.
  519. The executable requires following configuration items to be present
  520. in the <<<conf/container-executor.cfg>>> file. The items should be
  521. mentioned as simple key=value pairs, one per-line:
  522. *-------------------------+-------------------------+------------------------+
  523. || Parameter || Value || Notes |
  524. *-------------------------+-------------------------+------------------------+
  525. | <<<yarn.nodemanager.linux-container-executor.group>>> | <hadoop> | |
  526. | | | Unix group of the NodeManager. The group owner of the |
  527. | | |<container-executor> binary should be this group. Should be same as the |
  528. | | | value with which the NodeManager is configured. This configuration is |
  529. | | | required for validating the secure access of the <container-executor> |
  530. | | | binary. |
  531. *-------------------------+-------------------------+------------------------+
  532. | <<<banned.users>>> | hfds,yarn,mapred,bin | Banned users. |
  533. *-------------------------+-------------------------+------------------------+
  534. | <<<allowed.system.users>>> | foo,bar | Allowed system users. |
  535. *-------------------------+-------------------------+------------------------+
  536. | <<<min.user.id>>> | 1000 | Prevent other super-users. |
  537. *-------------------------+-------------------------+------------------------+
  538. Configuration for <<<conf/yarn-site.xml>>>
  539. To re-cap, here are the local file-sysytem permissions required for the
  540. various paths related to the <<<LinuxContainerExecutor>>>:
  541. *-------------------+-------------------+------------------+------------------+
  542. || Filesystem || Path || User:Group || Permissions |
  543. *-------------------+-------------------+------------------+------------------+
  544. | local | container-executor | root:hadoop | --Sr-s--- |
  545. *-------------------+-------------------+------------------+------------------+
  546. | local | <<<conf/container-executor.cfg>>> | root:hadoop | r-------- |
  547. *-------------------+-------------------+------------------+------------------+
  548. | local | <<<yarn.nodemanager.local-dirs>>> | yarn:hadoop | drwxr-xr-x |
  549. *-------------------+-------------------+------------------+------------------+
  550. | local | <<<yarn.nodemanager.log-dirs>>> | yarn:hadoop | drwxr-xr-x |
  551. *-------------------+-------------------+------------------+------------------+
  552. ** MapReduce JobHistory Server
  553. *-------------------------+-------------------------+------------------------+
  554. || Parameter || Value || Notes |
  555. *-------------------------+-------------------------+------------------------+
  556. | <<<mapreduce.jobhistory.address>>> | | |
  557. | | MapReduce JobHistory Server <host:port> | Default port is 10020. |
  558. *-------------------------+-------------------------+------------------------+
  559. | <<<mapreduce.jobhistory.keytab>>> | |
  560. | | </etc/security/keytab/jhs.service.keytab> | |
  561. | | | Kerberos keytab file for the MapReduce JobHistory Server. |
  562. *-------------------------+-------------------------+------------------------+
  563. | <<<mapreduce.jobhistory.principal>>> | jhs/_HOST@REALM.TLD | |
  564. | | | Kerberos principal name for the MapReduce JobHistory Server. |
  565. *-------------------------+-------------------------+------------------------+
  566. Configuration for <<<conf/mapred-site.xml>>>