Skip to content

Commit acf0830

Browse files
authored
Merge pull request #521 from dheren-git/master_hdfs_33
HDFS transparency-33 support
2 parents 2eebc3b + 454e66a commit acf0830

File tree

9 files changed

+126
-40
lines changed

9 files changed

+126
-40
lines changed

roles/scale_hdfs/cluster/tasks/configure.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@
126126
msg: "Failed to fetch mountpoint. "
127127
when: hdfs_mountpoint.changed|bool and hdfs_mountpoint.rc != 0 and scale_hdfs_mountpoint|length == 0
128128

129+
- name: configure | ha_enable_dir
130+
shell: "ls {{ scale_hdfs_mountpoint }}/HA-{{ scale_hdfs_cluster.name }}"
131+
register: ha_enable_dir
132+
run_once: true
133+
delegate_to: "{{ scale_server }}"
134+
129135
- name: configure | Check HDFS ces_group
130136
shell: "/usr/lpp/mmfs/bin/mmces address list|grep {{ scale_hdfs_ces_group_name }}"
131137
register: check_hdfs_ces_group
@@ -243,7 +249,7 @@
243249
- name: configure | InitializeSharedEdits for Namenodes HA
244250
command: /usr/lpp/mmfs/hadoop/bin/hdfs namenode -initializeSharedEdits -force
245251
register: initializedSharedEdits
246-
when: ha_enabled|bool and ces_hdfs_enabled|bool
252+
when: ha_enabled|bool and ces_hdfs_enabled|bool and ha_enable_dir.rc|length != 0
247253

248254
- name: configure | suspend CES nodes
249255
command: "/usr/lpp/mmfs/bin/mmces node suspend --stop -N {{ scale_hdfs_cluster.namenodes|join(',') }}"

roles/scale_hdfs/node/defaults/main.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,15 @@ scale_install_localpkg_tmpdir_path: /tmp
1313

1414
## Flag to install hdfs debug package
1515
install_debuginfo: true
16+
17+
# Directory to install 3.1.1.x hdfs package
18+
hdfs_rhel_version_path: 'hdfs_rpms/rhel7/hdfs_3.1.1.x/'
19+
20+
# Directory to install 3.3.x hdfs package
21+
hdfs_rhel_version_path_33: 'hdfs_rpms/rhel7/hdfs_3.3.x/'
22+
23+
# Directory to install 3.1.1.x hdfs package
24+
hdfs_sles_version_path: 'hdfs_rpms/rhel7/hdfs_3.1.1.x/'
25+
26+
# Directory to install 3.3.x hdfs package
27+
hdfs_ubuntu_version_path: 'hdfs_debs/ubuntu/hdfs_3.1.1.x/'

roles/scale_hdfs/node/tasks/install.yml

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
scale_hdfs_namenodes_list: []
88
scale_hdfs_datanodes_list: []
99
scale_hdfs_cluster: []
10+
scale_install_all_packages: []
1011

1112
- name: global_var | initializing scale_hdfs_cluster
1213
set_fact:
@@ -74,21 +75,45 @@
7475
run_once: true
7576
delegate_to: localhost
7677

77-
# Run chosen installation method to get list of RPMs
78-
79-
- name: install | Initialize list of packages
80-
set_fact:
81-
scale_install_all_packages: []
78+
# Run chosen installation method to get list of RPMs
8279

8380
- name: install | Set the extracted package directory path
8481
set_fact:
8582
hdfs_extracted_path: "{{ scale_extracted_path }}"
83+
hdfs_version_path_selection_rhel: "{{ hdfs_rhel_version_path }}"
8684

8785
- name: install | Stat extracted packages directory
8886
stat:
8987
path: "{{ hdfs_extracted_path }}"
9088
register: scale_extracted_gpfs_dir
9189

90+
- include_tasks: prepare_env.yml
91+
92+
- block:
93+
- name:
94+
set_fact:
95+
hdfs_version_path_selection_rhel: "{{ hdfs_rhel_version_path_33 }}"
96+
when: transparency_33_enabled|bool
97+
98+
- name: install | Fetch hdfs rpm dir path for rhel
99+
set_fact:
100+
hdfs_rpm_path_rhel: "{{ hdfs_version_path_selection_rhel }}"
101+
102+
- name: install | Fetch hdfs rpm dir path for sles
103+
set_fact:
104+
hdfs_rpm_path_sles: "{{ hdfs_sles_version_path }}"
105+
106+
- name: install | Fetch hdfs rpm dir path for ubuntu
107+
set_fact:
108+
hdfs_rpm_path_ubuntu: "{{ hdfs_ubuntu_version_path }}"
109+
110+
111+
run_once: true
112+
delegate_to: localhost
113+
114+
- debug:
115+
var: hdfs_rpm_path_rhel
116+
92117
- include_tasks: install_{{ scale_installmethod }}.yml
93118

94119
- import_tasks: apt/install.yml

roles/scale_hdfs/node/tasks/install_local_pkg.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,24 +106,27 @@
106106
path: "{{ scale_install_localpkg_tmpdir_path + '/' + scale_install_localpkg_path | basename }}"
107107
state: absent
108108

109+
- debug:
110+
var: hdfs_rpm_path_rhel
111+
109112
- name: install | hdfs path on rhel7
110113
set_fact:
111-
scale_hdfs_url: 'hdfs_rpms/rhel7/hdfs_3.1.1.x/'
114+
scale_hdfs_url: "{{ hdfs_rpm_path_rhel }}"
112115
when: ansible_distribution in scale_rhel_distribution and ansible_distribution_major_version == '7'
113116

114117
- name: install | hdfs path on rhel8
115118
set_fact:
116-
scale_hdfs_url: 'hdfs_rpms/rhel7/hdfs_3.1.1.x/'
119+
scale_hdfs_url: "{{ hdfs_rpm_path_rhel }}"
117120
when: ansible_distribution in scale_rhel_distribution and ansible_distribution_major_version == '8'
118121

119122
- name: install | hdfs path on sles15
120123
set_fact:
121-
scale_hdfs_url: 'hdfs_rpms/rhel7/hdfs_3.1.1.x/'
124+
scale_hdfs_url: "{{ hdfs_rpm_path_sles }}"
122125
when: ansible_distribution in scale_sles_distribution and ansible_distribution_major_version >= '15'
123126

124127
- name: install | hdfs path on ubuntu20
125128
set_fact:
126-
scale_hdfs_url: 'hdfs_debs/ubuntu/hdfs_3.1.1.x/'
129+
scale_hdfs_url: "{{ hdfs_rpm_path_ubuntu }}"
127130
when: ansible_distribution in scale_ubuntu_distribution and ansible_distribution_major_version == '20'
128131

129132
#

roles/scale_hdfs/node/tasks/install_remote_pkg.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,23 +73,23 @@
7373
7474
- name: install | hdfs path
7575
set_fact:
76-
scale_hdfs_url: 'hdfs_rpms/rhel7/hdfs_3.1.1.x/'
76+
scale_hdfs_url: "{{ hdfs_rpm_path_rhel }}"
7777
when: ansible_distribution in scale_rhel_distribution and ansible_distribution_major_version == '7'
7878

79-
- name: install | hdfs path
79+
- name: install | hdfs path on rhel8
8080
set_fact:
81-
scale_hdfs_url: 'hdfs_rpms/rhel7/hdfs_3.1.1.x/'
81+
scale_hdfs_url: "{{ hdfs_rpm_path_rhel }}"
8282
when: ansible_distribution in scale_rhel_distribution and ansible_distribution_major_version == '8'
8383

84-
- name: install | hdfs path
84+
- name: install | hdfs path on sles15
8585
set_fact:
86-
scale_hdfs_url: 'hdfs_rpms/rhel7/hdfs_3.1.1.x/'
86+
scale_hdfs_url: "{{ hdfs_rpm_path_sles }}"
8787
when: ansible_distribution in scale_sles_distribution and ansible_distribution_major_version >= '15'
8888

89-
- name: install | hdfs path
89+
- name: install | hdfs path on ubuntu20
9090
set_fact:
91-
scale_hdfs_url: 'hdfs_debs/ubuntu/hdfs_3.1.1.x/'
92-
when: ansible_distribution in scale_ubuntu_distribution and ansible_distribution_major_version >= '20'
91+
scale_hdfs_url: "{{ hdfs_rpm_path_ubuntu }}"
92+
when: ansible_distribution in scale_ubuntu_distribution and ansible_distribution_major_version == '20'
9393

9494
- block: ## when: host is defined as a protocol node
9595

roles/scale_hdfs/node/tasks/install_repository.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,43 @@
22
- name: install | Initialize
33
set_fact:
44
scale_hdfs_url: ""
5+
gpgcheck: "yes"
56

6-
- name: install | hdfs path
7+
- name: install | Disable gpg check
78
set_fact:
8-
scale_hdfs_url: 'hdfs_rpms/rhel7/hdfs_3.1.1.x/'
9+
gpgcheck: "no"
10+
when: scale_version < '5.0.4.0'
11+
12+
- name: install | hdfs path on rhel7
13+
set_fact:
14+
scale_hdfs_url: "{{ hdfs_rpm_path_rhel }}"
915
when: ansible_distribution in scale_rhel_distribution and ansible_distribution_major_version == '7'
1016

11-
- name: install | hdfs path
17+
- name: install | hdfs path on rhel8
1218
set_fact:
13-
scale_hdfs_url: 'hdfs_rpms/rhel7/hdfs_3.1.1.x/'
19+
scale_hdfs_url: "{{ hdfs_rpm_path_rhel }}"
1420
when: ansible_distribution in scale_rhel_distribution and ansible_distribution_major_version == '8'
1521

16-
- name: install | hdfs path
22+
- name: install | hdfs path on sles15
1723
set_fact:
18-
scale_hdfs_url: 'hdfs_rpms/rhel7/hdfs_3.1.1.x/'
24+
scale_hdfs_url: "{{ hdfs_rpm_path_sles }}"
1925
when: ansible_distribution in scale_sles_distribution and ansible_distribution_major_version >= '15'
2026

21-
- name: install | hdfs path
27+
- name: install | hdfs path on ubuntu20
2228
set_fact:
23-
scale_hdfs_url: 'hdfs_debs/ubuntu/hdfs_3.1.1.x/'
24-
when: ansible_distribution in scale_ubuntu_distribution and ansible_distribution_major_version >= '20'
29+
scale_hdfs_url: "{{ hdfs_rpm_path_ubuntu }}"
30+
when: ansible_distribution in scale_ubuntu_distribution and ansible_distribution_major_version == '20'
31+
32+
33+
- debug:
34+
var: scale_hdfs_url
2535

2636
- name: install | Configure hdfs YUM repository
2737
yum_repository:
2838
name: spectrum-scale-hdfs
2939
description: IBM Spectrum Scale (hdfs)
3040
baseurl: "{{ scale_install_repository_url }}{{ scale_hdfs_url }}"
31-
gpgcheck: "{{ scale_install_gpgcheck }}"
41+
gpgcheck: "{{ gpgcheck }}"
3242
repo_gpgcheck: no
3343
sslverify: no
3444
state: present

roles/scale_hdfs/postcheck/tasks/check.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
msg: "Not all datanode are running, check datanode log"
7171
when: 'dn_status.stdout_lines|length < datanodes|length'
7272

73-
7473
- name: postcheck | Check Namenodes active status
7574
shell: "{{ scale_hdfs_command_path }}hdfs haadmin -getAllServiceState | grep -i 'active'"
7675
register: active_status
@@ -80,13 +79,20 @@
8079
failed_when: false
8180
run_once: true
8281

82+
- name: postcheck | get ceshost
83+
shell: "/usr/lpp/mmfs/bin/mmces address list -Y|grep hdfs{{ scale_hdfs_cluster.name }} |awk -F: '{print $8}'"
84+
register: ceshost
85+
when: ha_enabled|bool
86+
ignore_errors: yes
87+
delegate_to: "{{ scale_server }}"
88+
failed_when: false
89+
run_once: true
90+
8391
- name: postcheck | Force active
8492
shell: "{{ scale_hdfs_command_path }}hdfs haadmin -transitionToActive --forceactive -scale"
8593
register: force_active
86-
when:
87-
- ha_enabled|bool
88-
- active_status.stdout_lines | length == 0
89-
delegate_to: "{{ scale_server }}"
94+
when: ha_enabled|bool and active_status.stdout_lines | length == 0 and ceshost.stdout|length != 0
95+
delegate_to: "{{ ceshost.stdout }}"
9096
run_once: true
9197

9298
- name: postcheck | Check Namenodes active status again

roles/scale_hdfs/precheck/tasks/check.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
---
2+
- include_tasks: prepare_env.yml
3+
4+
- debug:
5+
msg: "transparency_33_enabled: {{ transparency_33_enabled|bool }}"
6+
27
- name: global_var | Initialize
38
set_fact:
49
scale_hdfs_cluster: []
@@ -53,13 +58,6 @@
5358
delegate_to: "{{ server }}"
5459
run_once: true
5560

56-
- fail:
57-
msg: "NameNode is already running, Make sure namenodes are stopped(/usr/lpp/mmfs/hadoop/sbin/mmhdfs hdfs-nn stop) on {{ server }} node."
58-
when:
59-
- verify_namenodes.stdout|int > 0
60-
delegate_to: "{{ server }}"
61-
run_once: true
62-
6361
- fail:
6462
msg: "Not sufficient CESIPs are assigned in export_ip_pool for HDFS clusters, please add more CESIP and retry."
6563
when:
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
- name:
3+
set_fact:
4+
transparency_33_enabled: "False"
5+
transparency_version: "False"
6+
7+
- name:
8+
shell: "echo $SS_HDFS_33_TRANSPERNCY_VERSION_ENABLE"
9+
register: transparency_version
10+
delegate_to: localhost
11+
run_once: true
12+
13+
- debug:
14+
var: transparency_version
15+
16+
- name:
17+
set_fact:
18+
transparency_33_enabled: "{{ transparency_version.stdout|bool }}"
19+
when:
20+
- transparency_version.stdout is defined
21+
- transparency_version.stdout|bool
22+
delegate_to: localhost
23+
run_once: true
24+
25+
- debug:
26+
var: transparency_33_enabled|bool

0 commit comments

Comments
 (0)