We noticed issues in MapR cluster, when some nodes had different user-id compared to name node.
This caused files to be written with different user permission and essentially causing permission error when launching program, etc.
we need to ensure the cdap user-id is same across the nodes in the cluster.
I confirmed the root cause in this case was a conflict between cloud provider usermgmt and Coopr usermgmt, causing one node to have an extra user temporarily installed, but occupying a uid. This caused cdap uid to be inconsistent.
One option is to have the cdap base packages provide specify useradd -u UID, but this still won't guarantee consistency due to conflicts. So instead we should recommend that to avoid this, the best option is to pre-create the cdap user on the nodes of the cluster with consistent uid/gid. To that end, we could add a recipe to the cdap cookbook to do this, similar to how the hadoop_mapr cookbook creates the mapr user.
I've implemented this as a separate recipe. It can be called directly, or will be called automatically if node['cdap']['create_cdap_user'] is set to true.
Created cdap::user recipe, with configurable uid/gid and added an attribute to control the behavior. By default, we do not create the user in Chef.