-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Counting Namenode Servers method #44
Comments
Hi, sorry about my late reply! You are absolutely correct, this specific configuration (using more than 1 node in the master groups) would not work as I haven't accounted for so far (mainly because it's very rare when 2 masters are holding the exact same services - but not impossible as your usecase demonstrates). The fix is however twofold:
It's essentially the same end result, but
Zookeeper: https://github.com/hortonworks/ansible-hortonworks/blob/master/playbooks/roles/ambari-blueprint/templates/blueprint_dynamic.j2#L488 (what happens for example if you have 3 zookeepers, but 2 groups, 1 group with 1 unique node and 1 group with 2 identical nodes). All of this might work just fine, but it needs testing... Next week I won't be able to do this so after. You're also free to test whenever you can and see if you get any issues from Ambari. Thanks for reporting this! |
Hi Alexandru, I have made some test and you are totally right about Ambari I first tried to create - name: Populate the namenode lists
set_fact:
namenode_groups: "{{ namenode_groups }} + [ '{{ item.role }}' ]"
namenode_hosts: "{{ namenode_hosts }} + {{ groups[item.role] }}"
namenode_hostgroups: "{{ namenode_hostgroups }} + [ '{{ item.role }}' ]*{{ groups[item.role]|length }}"
when: groups[item.role] is defined and groups[item.role]|length > 0 and 'NAMENODE' in item.services
with_items: "{{ blueprint_dynamic }}" With this inventory: [hdp-namenode] #NN;RM;ZK
server1
server2
[hdp-master] #ZK
server3 At this step: So : "dfs.namenode.http-address.{{ hdfs_ha_name }}.nn1" : "%HOSTGROUP::{{ namenode_groups[0] }}%:50070",
"dfs.namenode.http-address.{{ hdfs_ha_name }}.nn2" : "%HOSTGROUP::{{ namenode_groups[1] }}%:50070", will give: "dfs.namenode.http-address.{{ hdfs_ha_name }}.nn1" : "%HOSTGROUP::hdp-namenode%:50070",
"dfs.namenode.http-address.{{ hdfs_ha_name }}.nn2" : "%HOSTGROUP::hdp-namenode%:50070", The Blueprint installation create an hdfs-site.xml with nn1=nn2=server1.example.com "dfs.namenode.http-address.{{ hdfs_ha_name }}.nn1" : "server1.example.com:50070",
"dfs.namenode.http-address.{{ hdfs_ha_name }}.nn2" : "server2.example.com:50070", FYI I didn't have this problem with ZK configuration even if zookeeper_hostgroups was: [ 'hdp-namenode', 'hdp-namenode', 'hdp-master' ], the generated ZK quorum was: server1,server2,server3. I'm wondering if it's a good idea to use directly the fqdn instead of Ambari %HOSTGROUP::%. We don't really need HOSTGROUP when we deploy a blueprint with a Jinja template and the Ansible inventory/group_vars. |
Hi, sorry I didn't get the chance to come back on this. It makes sense what you say and there are instances where Ambari doesn't do the HOSTGROUP thing, like the audit solr zookeepers (https://github.com/hortonworks/ansible-hortonworks/blob/master/playbooks/roles/ambari-blueprint/templates/blueprint_dynamic.j2#L110). But I don't know all the implications of this... I've been using HOSTGROUP as this was the property of the exported blueprint. Alternatively, we could just choose to have this limitation and live with having a bit more complex blueprint_dynamic variable... |
Method to count NN Servers (to determine if we have to enable HA) could be unsuitable in case we have several and all NN in the same group.
In the actual version, NN are counted by summing the number of groups with NAMENODE service:
The things is that we can have 2 Namenodes in the same Group (if both servers are hosting exactly the same services).
Example :
To suit this case, we need to change:
The method of counting NN:
And so the methods to check if we have at least 2 NN:
Same thing for other HA like Ranger KMS, RM, …
Are you in line with this approach ?
The text was updated successfully, but these errors were encountered: