|
65 | 65 |
|
66 | 66 | - name: check | calculate namenodes services |
67 | 67 | set_fact: |
68 | | - namenodes_service: "{{ namenodes_service }}nn{{ item }}," |
| 68 | + namenodes_service: "{{ namenodes_service }}nn{{ namenode_list }}," |
69 | 69 | with_sequence: count={{ namenodes_length }} |
70 | 70 | when: scale_hdfs_namenodes_list|length > 1 |
| 71 | + loop_control: |
| 72 | + loop_var: namenode_list |
71 | 73 | delegate_to: localhost |
72 | 74 | run_once: true |
73 | 75 |
|
|
111 | 113 | - name: check | fetch mountpoint |
112 | 114 | shell: /usr/lpp/mmfs/bin/mmlsfs "{{ scale_hdfs_filesystem }}" -T -Y | grep defaultMountPoint | awk -F':' '{print $9}' |
113 | 115 | register: hdfs_mountpoint |
| 116 | + |
114 | 117 | - name: check| decode mountpoint |
115 | 118 | command: /usr/lpp/mmfs/bin/mmclidecode "{{ hdfs_mountpoint.stdout }}" |
116 | 119 | register: hdfs_mountpoint_decode |
117 | 120 | when: hdfs_mountpoint.rc == 0 |
| 121 | + |
118 | 122 | - name: check| get mountpoint |
119 | 123 | set_fact: |
120 | 124 | scale_hdfs_mountpoint: "{{ hdfs_mountpoint_decode.stdout }}" |
121 | 125 | when: hdfs_mountpoint_decode.rc == 0 |
| 126 | + |
122 | 127 | run_once: true |
123 | 128 | delegate_to: "{{ scale_server }}" |
124 | 129 |
|
|
175 | 180 | - block: |
176 | 181 | - name: configure | Configuare core-site.xml |
177 | 182 | set_fact: |
178 | | - core_site_conf_dict: "{{ core_site_conf_dict | default({}) | combine ({ item.key : item.value }) }}" |
| 183 | + core_site_conf_dict: "{{ core_site_conf_dict | default({}) | combine ({ core_list.key : core_list.value }) }}" |
179 | 184 | with_items: |
180 | 185 | - { 'key': "fs.defaultFS", 'value': "hdfs://{{scale_hdfs_cluster.name}}" } |
181 | 186 | - { 'key': "hadoop.proxyuser.livy.hosts", 'value': "*" } |
|
184 | 189 | - { 'key': "hadoop.proxyuser.hive.groups", 'value': "*" } |
185 | 190 | - { 'key': "hadoop.proxyuser.oozie.hosts", 'value': "*" } |
186 | 191 | - { 'key': "hadoop.proxyuser.oozie.groups", 'value': "*" } |
| 192 | + loop_control: |
| 193 | + loop_var: core_list |
187 | 194 |
|
188 | 195 | - name: configure | Configuare hdfs-site.xml |
189 | 196 | set_fact: |
190 | | - hdfs_site_conf_dict: "{{ hdfs_site_conf_dict | default({}) | combine ({ item.key : item.value }) }}" |
| 197 | + hdfs_site_conf_dict: "{{ hdfs_site_conf_dict | default({}) | combine ({ hdfs_list.key : hdfs_list.value }) }}" |
191 | 198 | with_items: |
192 | 199 | - { 'key': "dfs.ha.namenodes.{{ scale_hdfs_cluster.name }}", 'value': "{{ namenodes_service }}" } |
193 | 200 | - { 'key': "dfs.client.failover.proxy.provider.{{ scale_hdfs_cluster.name }}", 'value': 'org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider' } |
|
196 | 203 | - { 'key': "dfs.namenode.servicerpc-bind-host", 'value': "0.0.0.0" } |
197 | 204 | - { 'key': "dfs.namenode.lifeline.rpc-bind-host", 'value': "0.0.0.0" } |
198 | 205 | - { 'key': "dfs.namenode.http-bind-host", 'value': "0.0.0.0" } |
| 206 | + loop_control: |
| 207 | + loop_var: hdfs_list |
199 | 208 |
|
200 | 209 | - name: configure | include append_dict.yml |
201 | 210 | include_tasks: append_dict.yml |
|
207 | 216 |
|
208 | 217 | - name: configure | Configuare hdfs-site.xml for HA |
209 | 218 | set_fact: |
210 | | - hdfs_site_conf_dict: "{{ hdfs_site_conf_dict | default({}) | combine ({ item.key : item.value }) }}" |
| 219 | + hdfs_site_conf_dict: "{{ hdfs_site_conf_dict | default({}) | combine ({ hdfs_site_ha_conf.key : hdfs_site_ha_conf.value }) }}" |
211 | 220 | with_items: |
212 | 221 | - { 'key': "dfs.namenode.shared.edits.dir", 'value': "file:///{{ scale_hdfs_mountpoint }}/HA-{{ scale_hdfs_cluster.name }}" } |
213 | 222 | when: ha_enabled|bool |
| 223 | + loop_control: |
| 224 | + loop_var: hdfs_site_ha_conf |
214 | 225 |
|
215 | 226 | - name: configure | Configuare gpfs-site.xml |
216 | 227 | set_fact: |
217 | | - gpfs_site_conf_dict: "{{ gpfs_site_conf_dict | default({}) | combine ({ item.key : item.value }) }}" |
| 228 | + gpfs_site_conf_dict: "{{ gpfs_site_conf_dict | default({}) | combine ({ hdfs_site_list.key : hdfs_site_list.value }) }}" |
218 | 229 | with_items: |
219 | 230 | - { 'key': "gpfs.mnt.dir", 'value': "{{ scale_hdfs_mountpoint }}" } |
220 | 231 | - { 'key': "gpfs.data.dir", 'value': "{{ scale_hdfs_datadir }}" } |
221 | | - |
| 232 | + loop_control: |
| 233 | + loop_var: hdfs_site_list |
222 | 234 | run_once: true |
223 | 235 | delegate_to: localhost |
224 | 236 |
|
225 | 237 | - block: |
226 | 238 | - name: configure | Set configuration for core-site.xml |
227 | | - shell: /usr/lpp/mmfs/hadoop/sbin/mmhdfs config set core-site.xml -k "{{ item.key }}"="{{ item.value }}" |
| 239 | + shell: /usr/lpp/mmfs/hadoop/sbin/mmhdfs config set core-site.xml -k "{{ core_site_conf.key }}"="{{ core_site_conf.value }}" |
228 | 240 | loop: "{{ core_site_conf_dict | dict2items }}" |
| 241 | + loop_control: |
| 242 | + loop_var: core_site_conf |
229 | 243 |
|
230 | 244 | - name: configure | Set configuration for gpfs-site.xml |
231 | | - shell: /usr/lpp/mmfs/hadoop/sbin/mmhdfs config set gpfs-site.xml -k "{{ item.key }}"="{{ item.value }}" |
| 245 | + shell: /usr/lpp/mmfs/hadoop/sbin/mmhdfs config set gpfs-site.xml -k "{{ gpfs_site_conf.key }}"="{{ gpfs_site_conf.value }}" |
232 | 246 | loop: "{{ gpfs_site_conf_dict | dict2items }}" |
| 247 | + loop_control: |
| 248 | + loop_var: gpfs_site_conf |
233 | 249 |
|
234 | 250 | - name: configure | Set configuration for hdfs-site.xml |
235 | | - shell: /usr/lpp/mmfs/hadoop/sbin/mmhdfs config set hdfs-site.xml -k "{{ item.key }}"="{{ item.value }}" |
| 251 | + shell: /usr/lpp/mmfs/hadoop/sbin/mmhdfs config set hdfs-site.xml -k "{{ hdfs_site_conf.key }}"="{{ hdfs_site_conf.value }}" |
236 | 252 | loop: "{{ hdfs_site_conf_dict | dict2items }}" |
| 253 | + loop_control: |
| 254 | + loop_var: hdfs_site_conf |
237 | 255 |
|
238 | 256 | - name: configure | Remove localhost |
239 | 257 | shell: /usr/lpp/mmfs/hadoop/sbin/mmhdfs worker remove localhost |
|
0 commit comments