Skip to content
This repository has been archived by the owner on Jan 8, 2019. It is now read-only.

node['bcpc']['node_number'] is not derived from cluster_def node_id #1191

Open
http-418 opened this issue Apr 27, 2018 · 1 comment
Open
Labels

Comments

@http-418
Copy link
Contributor

http-418 commented Apr 27, 2018

We have taken to setting node_id in cluster.txt, and some code relies on those node IDs. Unfortunately, those node IDs are at no point copied into node objects, so older code that relies on node[:bcpc][:node_number] will get a bogus value derived from the MAC address.

This is particularly dangerous on Zookeeper clusters, where one value is used for the zoo.cfg cluster definition, and the other value is used for the myid file.

For now we can work around this issue by copying the values in chef-shell after chef installation but before cheffing nodes:

sudo chef-shell -z -o 'bach_hadoop_wrapper'

require 'cluster_def'
BACH::ClusterDef.new.fetch_cluster_def().map { |ss| 
  nn = Chef::Node.load(ss[:fqdn])
  nn.normal[:bcpc][:node_number] = ss[:node_id]
  nn.save 
}

At some point we need to really fix this.

@pu239ppy
Copy link
Contributor

This may have been an omission on my part, however it is also possible at the time of writing I mean to make sure all node number requests are serviced from the file. Perhaps I should have documented this explicitly

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants