| <?xml version="1.0" encoding="UTF-8"?> |
| <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| |
| --> |
| |
| <!-- Put site-specific property overrides in this file. --> |
| |
| <configuration> |
| <property> |
| <name>dfs.datanode.synconclose</name> |
| <value>true</value> |
| </property> |
| <property> |
| <name>dfs.namenode.name.dir</name> |
| <value>{{ worker_data_dirs[0] }}/hadoop/name</value> |
| </property> |
| {% if not hdfs_ha %} |
| <property> |
| <name>dfs.namenode.checkpoint.dir</name> |
| <value>{{ worker_data_dirs[0] }}/hadoop/namesecondary</value> |
| </property> |
| {% endif%} |
| <property> |
| <name>dfs.datanode.data.dir</name> |
| <value>{% for dir in worker_data_dirs -%} |
| {{ dir }}/hadoop/data |
| {%- if not loop.last -%} , {%- endif -%} |
| {%- endfor %}</value> |
| </property> |
| <property> |
| <name>dfs.client.read.shortcircuit</name> |
| <value>true</value> |
| </property> |
| <property> |
| <name>dfs.domain.socket.path</name> |
| <value>/var/lib/hadoop-hdfs/dn_socket</value> |
| </property> |
| <property> |
| <name>dfs.nameservices</name> |
| <value>{{ nameservice_id }}</value> |
| </property> |
| {% if not hdfs_ha %} |
| <property> |
| <name>dfs.namenode.secondary.http-address.{{ nameservice_id }}</name> |
| <value>{{ groups['namenode'][0] }}:50090</value> |
| </property> |
| <property> |
| <name>dfs.namenode.secondary.https-address.{{ nameservice_id }}</name> |
| <value>{{ groups['namenode'][0] }}:50091</value> |
| </property> |
| {% else %} |
| {% set nn_list = [] %} |
| {% for item in groups['namenode'] %}{{ nn_list.append('nn' + loop.index|string() ) }}{% endfor %} |
| <property> |
| <name>dfs.ha.namenodes.{{ nameservice_id }}</name> |
| <value>{{ nn_list | join(',') }}</value> |
| </property> |
| {% endif %} |
| {% for nn_host in groups['namenode'] %}{% set nn_id = 'nn' + loop.index|string() %} |
| {% if hdfs_ha %}{% set nnid_suffix = '.' + nn_id %} |
| {% else %}{% set nnid_suffix = '' %} |
| {% endif %} |
| <property> |
| <name>dfs.namenode.rpc-address.{{ nameservice_id }}{{ nnid_suffix }}</name> |
| <value>{{ nn_host }}:8020</value> |
| </property> |
| <property> |
| <name>dfs.namenode.http-address.{{ nameservice_id }}{{ nnid_suffix }}</name> |
| <value>{{ nn_host }}:50070</value> |
| </property> |
| <property> |
| <name>dfs.namenode.https-address.{{ nameservice_id }}{{ nnid_suffix }}</name> |
| <value>{{ nn_host }}:50071</value> |
| </property> |
| {% endfor %} |
| <property> |
| <name>dfs.client.failover.proxy.provider.{{ nameservice_id }}</name> |
| <value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value> |
| </property> |
| {% if hdfs_ha %} |
| <property> |
| <name>dfs.namenode.shared.edits.dir</name> |
| <value>qjournal://{{ journal_quorum }}/{{ nameservice_id }}</value> |
| </property> |
| <property> |
| <name>dfs.ha.fencing.methods</name> |
| <value>shell(/usr/bin/true)</value> |
| </property> |
| <property> |
| <name>dfs.journalnode.edits.dir</name> |
| <value>{{ worker_data_dirs[0] }}/hadoop/journal</value> |
| </property> |
| <property> |
| <name>dfs.ha.automatic-failover.enabled</name> |
| <value>true</value> |
| </property> |
| {% endif %} |
| </configuration> |