Skip to content

Instantly share code, notes, and snippets.

View dsugden's full-sized avatar

Dave Sugden dsugden

  • Shopify
  • Gatineau
View GitHub Profile
IO(Http) ? Http.Bind(service, interface = ip, port = port)
logger.info(s"MicroserviceMain booting ip:$ip port:$port")
StatusService.signalStartedOrExit()
vagrant@vagrant-ubuntu-trusty-64:~$ conduct run --ip 192.168.77.20 --scale 2 91fc7e7
Bundle run request sent.
Stop bundle with: conduct stop --ip 192.168.77.20 91fc7e7
Print ConductR info with: conduct info --ip 192.168.77.20
vagrant@vagrant-ubuntu-trusty-64:~$
vagrant@vagrant-ubuntu-trusty-64:~$ conduct stop --ip 192.168.77.20 91fc7e7
Bundle stop request sent.
Unload bundle with: conduct unload --ip 192.168.77.20 91fc7e7
Print ConductR info with: conduct info --ip 192.168.77.20
vagrant@vagrant-ubuntu-trusty-64:~$
object Application extends Controller with LazyLogging {
def index = Action.async {
val singlemicro = LocationService.getLookupUrl("/singlemicro", "http://127.0.0.1:8096/singlemicro")
val result = WS.url(singlemicro+"/singlemicro")
.withFollowRedirects(follow = true)
.get()
.map { response =>
Ok(response.body)
}
vagrant@vagrant-ubuntu-trusty-64:~$ conduct info --ip 192.168.77.20
ID NAME #REP #STR #RUN
d248907 visualizer 3 0 1
91fc7e7 singlemicro-1.0.0 4 0 2
76d03c0 playproject-1.0.0 3 0 1
sbt
project singlemicro
#Now we need to tell the plugin where ConductR is hosted:
controlServer 192.168.59.103:9005
#Once this is done, you can build a distribution, load it up to ConductR cluster, run , stop and unload.
#create the artifact (bundle)
akka.cluster.seed-nodes = ["akka.tcp://SomeAkkaClusterSystem@10.0.1.60:8089"]
akka.cluster.seed-nodes = ["akka.tcp://SomeAkkaClusterSystem@127.0.0.1:8089"]
AkkaProperties.initialize()
BundleKeys.endpoints := Map("akka-remote" -> Endpoint("tcp", 0, Set.empty))