config.yaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. # Copyright 2020 Crown Copyright
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. apiVersion: v1
  15. kind: ConfigMap
  16. metadata:
  17. name: {{ template "hdfs.fullname" . }}
  18. labels:
  19. {{ include "hdfs.labels" . | indent 4 }}
  20. data:
  21. core-site.xml: |-
  22. <?xml version="1.0" encoding="UTF-8"?>
  23. <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
  24. <configuration>
  25. <property>
  26. <name>fs.defaultFS</name>
  27. <value>hdfs://{{ template "hdfs.fullname" . }}-namenode-0.{{ template "hdfs.fullname" . }}-namenodes:{{ .Values.namenode.ports.clientRpc }}</value>
  28. </property>
  29. {{- range $k, $v := .Values.config.coreSite }}
  30. <property>
  31. <name>{{$k}}</name>
  32. <value>{{$v}}</value>
  33. </property>
  34. {{- end }}
  35. </configuration>
  36. hdfs-site.xml: |-
  37. <?xml version="1.0" encoding="UTF-8"?>
  38. <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
  39. <configuration>
  40. <property>
  41. <name>dfs.namenode.name.dir</name>
  42. <value>{{- template "hdfs.namenode.volumes" .Values.namenode.dataVolumes.count -}}</value>
  43. </property>
  44. <property>
  45. <name>dfs.datanode.data.dir</name>
  46. <value>{{- template "hdfs.datanode.volumes" .Values.datanode.dataVolumes.count -}}</value>
  47. </property>
  48. {{- range $k, $v := .Values.config.hdfsSite }}
  49. <property>
  50. <name>{{$k}}</name>
  51. <value>{{$v}}</value>
  52. </property>
  53. {{- end }}
  54. {{- if .Values.config.rackAwareness }}
  55. {{- if .Values.config.rackAwareness.nodeTopologyLabel }}
  56. <property>
  57. <name>net.topology.script.file.name</name>
  58. <value>/scripts/resolve-rack.sh</value>
  59. </property>
  60. <property>
  61. <name>net.topology.script.number.args</name>
  62. <value>1</value>
  63. </property>
  64. {{- end }}
  65. {{- end }}
  66. <property>
  67. <name>dfs.namenode.rpc-address</name>
  68. <value>{{ template "hdfs.fullname" . }}-namenode-0.{{ template "hdfs.fullname" . }}-namenodes:{{ .Values.namenode.ports.clientRpc }}</value>
  69. </property>
  70. <property>
  71. <name>dfs.namenode.rpc-bind-host</name>
  72. <value>0.0.0.0</value>
  73. </property>
  74. <property>
  75. <name>dfs.namenode.servicerpc-address</name>
  76. <value>{{ template "hdfs.fullname" . }}-namenode-0.{{ template "hdfs.fullname" . }}-namenodes:{{ .Values.namenode.ports.serviceRpc }}</value>
  77. </property>
  78. <property>
  79. <name>dfs.namenode.servicerpc-bind-host</name>
  80. <value>0.0.0.0</value>
  81. </property>
  82. <property>
  83. <name>dfs.namenode.lifeline.rpc-address</name>
  84. <value>{{ template "hdfs.fullname" . }}-namenode-0.{{ template "hdfs.fullname" . }}-namenodes:{{ .Values.namenode.ports.lifelineRpc }}</value>
  85. </property>
  86. <property>
  87. <name>dfs.namenode.lifeline.rpc-bind-host</name>
  88. <value>0.0.0.0</value>
  89. </property>
  90. <property>
  91. <name>dfs.namenode.http-address</name>
  92. <value>0.0.0.0:{{ .Values.namenode.ports.http }}</value>
  93. </property>
  94. <property>
  95. <name>dfs.namenode.https-address</name>
  96. <value>0.0.0.0:{{ .Values.namenode.ports.https }}</value>
  97. </property>
  98. <property>
  99. <name>dfs.datanode.http.address</name>
  100. <value>0.0.0.0:{{ .Values.datanode.ports.http }}</value>
  101. </property>
  102. <property>
  103. <name>dfs.datanode.https.address</name>
  104. <value>0.0.0.0:{{ .Values.datanode.ports.https }}</value>
  105. </property>
  106. <property>
  107. <name>dfs.datanode.address</name>
  108. <value>0.0.0.0:{{ .Values.datanode.ports.data }}</value>
  109. </property>
  110. <property>
  111. <name>dfs.datanode.ipc.address</name>
  112. <value>0.0.0.0:{{ .Values.datanode.ports.ipc }}</value>
  113. </property>
  114. </configuration>
  115. hadoop-policy.xml: |-
  116. <?xml version="1.0"?>
  117. <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
  118. <configuration>
  119. <property>
  120. <name>security.client.protocol.acl</name>
  121. <value>*</value>
  122. <description>ACL for ClientProtocol, which is used by user code
  123. via the DistributedFileSystem.
  124. The ACL is a comma-separated list of user and group names. The user and
  125. group list is separated by a blank. For e.g. "alice,bob users,wheel".
  126. A special value of "*" means all users are allowed.</description>
  127. </property>
  128. <property>
  129. <name>security.client.datanode.protocol.acl</name>
  130. <value>*</value>
  131. <description>ACL for ClientDatanodeProtocol, the client-to-datanode protocol
  132. for block recovery.
  133. The ACL is a comma-separated list of user and group names. The user and
  134. group list is separated by a blank. For e.g. "alice,bob users,wheel".
  135. A special value of "*" means all users are allowed.</description>
  136. </property>
  137. <property>
  138. <name>security.datanode.protocol.acl</name>
  139. <value>hadoop</value>
  140. <description>ACL for DatanodeProtocol, which is used by datanodes to
  141. communicate with the namenode.
  142. The ACL is a comma-separated list of user and group names. The user and
  143. group list is separated by a blank. For e.g. "alice,bob users,wheel".
  144. A special value of "*" means all users are allowed.</description>
  145. </property>
  146. <property>
  147. <name>security.inter.datanode.protocol.acl</name>
  148. <value>hadoop</value>
  149. <description>ACL for InterDatanodeProtocol, the inter-datanode protocol
  150. for updating generation timestamp.
  151. The ACL is a comma-separated list of user and group names. The user and
  152. group list is separated by a blank. For e.g. "alice,bob users,wheel".
  153. A special value of "*" means all users are allowed.</description>
  154. </property>
  155. <property>
  156. <name>security.namenode.protocol.acl</name>
  157. <value>hadoop</value>
  158. <description>ACL for NamenodeProtocol, the protocol used by the secondary
  159. namenode to communicate with the namenode.
  160. The ACL is a comma-separated list of user and group names. The user and
  161. group list is separated by a blank. For e.g. "alice,bob users,wheel".
  162. A special value of "*" means all users are allowed.</description>
  163. </property>
  164. <property>
  165. <name>security.admin.operations.protocol.acl</name>
  166. <value>hadoop</value>
  167. <description>ACL for AdminOperationsProtocol. Used for admin commands.
  168. The ACL is a comma-separated list of user and group names. The user and
  169. group list is separated by a blank. For e.g. "alice,bob users,wheel".
  170. A special value of "*" means all users are allowed.</description>
  171. </property>
  172. <property>
  173. <name>security.refresh.user.mappings.protocol.acl</name>
  174. <value>hadoop</value>
  175. <description>ACL for RefreshUserMappingsProtocol. Used to refresh
  176. users mappings. The ACL is a comma-separated list of user and
  177. group names. The user and group list is separated by a blank. For
  178. e.g. "alice,bob users,wheel". A special value of "*" means all
  179. users are allowed.</description>
  180. </property>
  181. <property>
  182. <name>security.refresh.policy.protocol.acl</name>
  183. <value>hadoop</value>
  184. <description>ACL for RefreshAuthorizationPolicyProtocol, used by the
  185. dfsadmin and mradmin commands to refresh the security policy in-effect.
  186. The ACL is a comma-separated list of user and group names. The user and
  187. group list is separated by a blank. For e.g. "alice,bob users,wheel".
  188. A special value of "*" means all users are allowed.</description>
  189. </property>
  190. <property>
  191. <name>security.ha.service.protocol.acl</name>
  192. <value>hadoop</value>
  193. <description>ACL for HAService protocol used by HAAdmin to manage the
  194. active and stand-by states of namenode.</description>
  195. </property>
  196. <property>
  197. <name>security.zkfc.protocol.acl</name>
  198. <value>hadoop</value>
  199. <description>ACL for access to the ZK Failover Controller
  200. </description>
  201. </property>
  202. <property>
  203. <name>security.qjournal.service.protocol.acl</name>
  204. <value>hadoop</value>
  205. <description>ACL for QJournalProtocol, used by the NN to communicate with
  206. JNs when using the QuorumJournalManager for edit logs.</description>
  207. </property>
  208. <property>
  209. <name>security.interqjournal.service.protocol.acl</name>
  210. <value>hadoop</value>
  211. <description>ACL for InterQJournalProtocol, used by the JN to
  212. communicate with other JN
  213. </description>
  214. </property>
  215. </configuration>
  216. log4j.properties: |-
  217. # Define some default values that can be overridden by system properties
  218. hadoop.root.logger=INFO,console
  219. hadoop.log.dir=.
  220. hadoop.log.file=hadoop.log
  221. # Define the root logger to the system property "hadoop.root.logger"
  222. log4j.rootLogger=${hadoop.root.logger}, EventCounter
  223. # Logging Threshold
  224. log4j.threshold=ALL
  225. # Null Appender
  226. log4j.appender.NullAppender=org.apache.log4j.varia.NullAppender
  227. # Console Appender
  228. log4j.appender.console=org.apache.log4j.ConsoleAppender
  229. log4j.appender.console.target=System.err
  230. log4j.appender.console.layout=org.apache.log4j.PatternLayout
  231. log4j.appender.console.layout.ConversionPattern=%d{ISO8601} %p %c{2}: %m%n
  232. # HDFS block state change log from block manager
  233. # Uncomment the following to log normal block state change
  234. # messages from BlockManager in NameNode.
  235. #log4j.logger.BlockStateChange=DEBUG
  236. # Security appender
  237. hadoop.security.logger=INFO,RFAS
  238. hadoop.security.log.maxfilesize=256MB
  239. hadoop.security.log.maxbackupindex=20
  240. log4j.category.SecurityLogger=${hadoop.security.logger}
  241. hadoop.security.log.file=security.audit
  242. log4j.appender.RFAS=org.apache.log4j.RollingFileAppender
  243. log4j.appender.RFAS.File=${hadoop.log.dir}/${hadoop.security.log.file}
  244. log4j.appender.RFAS.layout=org.apache.log4j.PatternLayout
  245. log4j.appender.RFAS.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n
  246. log4j.appender.RFAS.MaxFileSize=${hadoop.security.log.maxfilesize}
  247. log4j.appender.RFAS.MaxBackupIndex=${hadoop.security.log.maxbackupindex}
  248. # hdfs audit logging
  249. hdfs.audit.logger=INFO,RFAAUDIT
  250. hdfs.audit.log.maxfilesize=256MB
  251. hdfs.audit.log.maxbackupindex=20
  252. log4j.logger.org.apache.hadoop.hdfs.server.namenode.FSNamesystem.audit=${hdfs.audit.logger}
  253. log4j.additivity.org.apache.hadoop.hdfs.server.namenode.FSNamesystem.audit=false
  254. log4j.appender.RFAAUDIT=org.apache.log4j.RollingFileAppender
  255. log4j.appender.RFAAUDIT.File=${hadoop.log.dir}/hdfs-audit.log
  256. log4j.appender.RFAAUDIT.layout=org.apache.log4j.PatternLayout
  257. log4j.appender.RFAAUDIT.layout.ConversionPattern=%d{ISO8601} %p %c{2}: %m%n
  258. log4j.appender.RFAAUDIT.MaxFileSize=${hdfs.audit.log.maxfilesize}
  259. log4j.appender.RFAAUDIT.MaxBackupIndex=${hdfs.audit.log.maxbackupindex}
  260. # NameNode metrics logging.
  261. # The default is to retain two namenode-metrics.log files up to 64MB each.
  262. namenode.metrics.logger=INFO,NNMETRICSRFA
  263. log4j.logger.NameNodeMetricsLog=${namenode.metrics.logger}
  264. log4j.additivity.NameNodeMetricsLog=false
  265. log4j.appender.NNMETRICSRFA=org.apache.log4j.RollingFileAppender
  266. log4j.appender.NNMETRICSRFA.File=${hadoop.log.dir}/namenode-metrics.log
  267. log4j.appender.NNMETRICSRFA.layout=org.apache.log4j.PatternLayout
  268. log4j.appender.NNMETRICSRFA.layout.ConversionPattern=%d{ISO8601} %m%n
  269. log4j.appender.NNMETRICSRFA.MaxBackupIndex=1
  270. log4j.appender.NNMETRICSRFA.MaxFileSize=64MB
  271. # DataNode metrics logging.
  272. # The default is to retain two datanode-metrics.log files up to 64MB each.
  273. datanode.metrics.logger=INFO,DNMETRICSRFA
  274. log4j.logger.DataNodeMetricsLog=${datanode.metrics.logger}
  275. log4j.additivity.DataNodeMetricsLog=false
  276. log4j.appender.DNMETRICSRFA=org.apache.log4j.RollingFileAppender
  277. log4j.appender.DNMETRICSRFA.File=${hadoop.log.dir}/datanode-metrics.log
  278. log4j.appender.DNMETRICSRFA.layout=org.apache.log4j.PatternLayout
  279. log4j.appender.DNMETRICSRFA.layout.ConversionPattern=%d{ISO8601} %m%n
  280. log4j.appender.DNMETRICSRFA.MaxBackupIndex=1
  281. log4j.appender.DNMETRICSRFA.MaxFileSize=64MB
  282. # Custom Logging levels
  283. #log4j.logger.org.apache.hadoop.hdfs.server.namenode.FSNamesystem.audit=DEBUG
  284. # AWS SDK & S3A FileSystem
  285. #log4j.logger.com.amazonaws=ERROR
  286. log4j.logger.com.amazonaws.http.AmazonHttpClient=ERROR
  287. #log4j.logger.org.apache.hadoop.fs.s3a.S3AFileSystem=WARN
  288. # Event Counter Appender
  289. # Sends counts of logging messages at different severity levels to Hadoop Metrics.
  290. log4j.appender.EventCounter=org.apache.hadoop.log.metrics.EventCounter
  291. # Log levels of third-party libraries
  292. log4j.logger.org.apache.commons.beanutils=WARN
  293. log4j.logger.org.apache.hadoop.security.ForwardAuthentication=DEBUG