Sha256: 0461d62d9baa297268818222b0ccc36e0b3a6f82022d25e61c89f18f25411dc2

Contents?: true

Size: 1.77 KB

Versions: 4

Compression:

Stored size: 1.77 KB

Contents

include "../service/service.sfp"
include "../aptpackage/aptpackage.sfp"

/**
 * Module for managing Hadoop version 1
 *
 * - password can be generated using command:
 *     $ echo "mypassword" | makepasswd --clearfrom=- --crypt-md5 |awk '{ print $2 }'
 *
 */
schema Hadoop1 {
	installed = true
	running = true

	final home = "/opt/hadoop"
	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 = ""
	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
		}
	}
	
	sub uninstall {
		condition {
			this.installed = true
			this.running = false
		}
		effect {
			this.installed = false
		}
	}

	sub start {
		condition {
			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 {
	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.master = master
		}
	}

	sub start (master : Hadoop1Master) {
		condition {
			this.running != true
			this.installed = true
			this.master = master
			master.running = true
		}
		effect {
			this.running = true
		}
	}
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
nuri-0.5.5 modules/hadoop1/hadoop1.sfp
nuri-0.5.4 modules/hadoop1/hadoop1.sfp
nuri-0.5.3 modules/hadoop1/hadoop1.sfp
nuri-0.5.2 modules/hadoop1/hadoop1.sfp