Repository: bigtop Updated Branches: refs/heads/master fe6709bc9 -> e1c6d96c7
BIGTOP-1690. Puppet should automatically create data directories Signed-off-by: Konstantin Boudnik <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/e1c6d96c Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/e1c6d96c Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/e1c6d96c Branch: refs/heads/master Commit: e1c6d96c78c63e58d6adf9b6abd01e6b7bc2345b Parents: fe6709b Author: Sergey Soldatov <[email protected]> Authored: Fri Nov 13 18:01:44 2015 -0800 Committer: Konstantin Boudnik <[email protected]> Committed: Fri Nov 13 21:00:01 2015 -0800 ---------------------------------------------------------------------- bigtop-deploy/puppet/modules/hadoop/manifests/init.pp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bigtop/blob/e1c6d96c/bigtop-deploy/puppet/modules/hadoop/manifests/init.pp ---------------------------------------------------------------------- diff --git a/bigtop-deploy/puppet/modules/hadoop/manifests/init.pp b/bigtop-deploy/puppet/modules/hadoop/manifests/init.pp index 777c26e..a548975 100644 --- a/bigtop-deploy/puppet/modules/hadoop/manifests/init.pp +++ b/bigtop-deploy/puppet/modules/hadoop/manifests/init.pp @@ -28,6 +28,12 @@ class hadoop ($hadoop_security_authentication = "simple", include stdlib class deploy ($roles) { + + if (!empty(intersection($roles , ["datanode","namenode","nodemanager", "mapred-app"]))) { + include hadoop + hadoop::create_storage_dir { $hadoop::hadoop_storage_dirs: } + } + if ("datanode" in $roles) { include hadoop::datanode } @@ -698,6 +704,14 @@ class hadoop ($hadoop_security_authentication = "simple", } } + define create_storage_dir { + exec { "mkdir $name": + command => "/bin/mkdir -p $name", + creates => $name, + user =>"root", + } + } + define namedir_copy ($source, $ssh_identity) { exec { "copy namedir $title from first namenode": command => "/usr/bin/rsync -avz -e '/usr/bin/ssh -oStrictHostKeyChecking=no -i $ssh_identity' '${source}:$title/' '$title/'",
