Repository: bigtop Updated Branches: refs/heads/master 1849e5809 -> 7c716c644
BIGTOP-1259. spark-worker service should be started after spark-master if ran on the same node Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/7c716c64 Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/7c716c64 Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/7c716c64 Branch: refs/heads/master Commit: 7c716c64443fe41aa86527de25ae794811008330 Parents: 1849e58 Author: Konstantin Boudnik <[email protected]> Authored: Tue Mar 25 12:40:21 2014 -0700 Committer: Konstantin Boudnik <[email protected]> Committed: Tue Mar 25 12:40:21 2014 -0700 ---------------------------------------------------------------------- .../puppet/modules/spark/manifests/init.pp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bigtop/blob/7c716c64/bigtop-deploy/puppet/modules/spark/manifests/init.pp ---------------------------------------------------------------------- diff --git a/bigtop-deploy/puppet/modules/spark/manifests/init.pp b/bigtop-deploy/puppet/modules/spark/manifests/init.pp index f23387e..1cc7133 100644 --- a/bigtop-deploy/puppet/modules/spark/manifests/init.pp +++ b/bigtop-deploy/puppet/modules/spark/manifests/init.pp @@ -28,18 +28,22 @@ class spark { define master($master_host = $fqdn, $master_port = "7077", $master_ui_port = "18080") { include common - service { "spark-master": - ensure => running, - require => [ Package["spark"], File["/etc/spark/conf/spark-env.sh"], ], - subscribe => [Package["spark"], File["/etc/spark/conf/spark-env.sh"] ], - hasrestart => true, - hasstatus => true, - } + if ( $fqdn == $master_host ) { + service { "spark-master": + ensure => running, + require => [ Package["spark"], File["/etc/spark/conf/spark-env.sh"], ], + subscribe => [Package["spark"], File["/etc/spark/conf/spark-env.sh"] ], + hasrestart => true, + hasstatus => true, + } + } } define worker($master_host = $fqdn, $master_port = "7077", $master_ui_port = "18080") { include common - + if ( $fqdn == $master_host ) { + Service["spark-master"] ~> Service["spark-worker"] + } service { "spark-worker": ensure => running, require => [ Package["spark"], File["/etc/spark/conf/spark-env.sh"], ],
