modules/hadoop1/hadoop1.sfp in nuri-0.5.1 vs modules/hadoop1/hadoop1.sfp in nuri-0.5.2

- old
+ new

@@ -1,6 +1,7 @@ include "../service/service.sfp" +include "../aptpackage/aptpackage.sfp" /** * Module for managing Hadoop version 1 * * - password can be generated using command: @@ -15,67 +16,77 @@ final user = "hadoop" final group = "hadoop" final password = "!" final source = "http://www.mirrorservice.org/sites/ftp.apache.org/hadoop/common" final version = "1.2.1" - final java_home = "" //"/usr/local/java/jre1.6.0_34" - final data_dir = "/tmp/hadoop" + final java_home = "" + final data_dir = "/opt/hadoop/data" final replication = 2 + java isa AptPackage { + package_name = "default-jre" + } + sub install { condition { this.installed != true + this.java.installed = true } effect { this.installed = true - this.running = false } } sub uninstall { condition { - this.running = false this.installed = true + this.running = false } effect { this.installed = false } } sub start { condition { - this.running != true this.installed = true + this.running != true } effect { this.running = true } } sub stop { condition { + this.installed = true this.running = true } effect { this.running = false } } } -schema Hadoop1Master extends Hadoop1 { } +schema Hadoop1Master extends Hadoop1 { + home = "/opt/hadoopmaster" + data_dir = "/opt/hadoopmaster/data" +} - schema Hadoop1Slave extends Hadoop1 { master isref Hadoop1Master + home = "/opt/hadoopslave" + data_dir = "/opt/hadoopslave/data" + sub install (master : Hadoop1Master) { condition { this.installed != true master.parent.created = true + this.java.installed = true } effect { this.installed = true - this.running = false this.master = master } } sub start (master : Hadoop1Master) {