Skip to content

dsugden/conductr-examples

Repository files navigation

Collection of projects used to demo the features of Typesafe conductR

Currently using conductr_1.0.11_all.deb.deb . You will need the the ConductR Package to run these examples, copy it to:

ansible/conductr/files

To get a trial: contact Typesafe

Build a conductr cluster
  1. Contact typesafe, get a copy of conductr.deb, add it into your clone of this repo
  2. Build cluster with vagrant + ansible in project.
  1. Launch visualizer

    http://192.168.77.20:9999/

These example projects are using sbt-conductr 1.2.1

As this plugin evolves, this repo will be updated.

Build the micro bundle
sbt micro/bundle:dist
build the akkacluster bundles

There is a frontend and a backend. When not run in conductr, the backend is the seed.

The backend will join cluster, then register with front end. The frontend will forward work to the backend.

sbt
project akkaclusterFront

# replace with the IP of your conductr server
# 192.168.77.20 is for the Vagrantfile conductr custer in this repo
controlServer 192.168.77.20:9005

clean
bundle:dist

 
conduct load <Tab for bundle file > 

# you will get a message here telling you the hash (id) of the loaded bundle, you can use this hash to:

conduct run <bundleId>

# if you want to scale this bundle to run on n nodes:

conduct run <bundleId> --scale <n>


# you will get a message here telling you the hash (id) of the bundle, you can use this hash to:

conduct stop <bundleId>

conduct unload <bundleId>



project akkaclusterBack
clean
bundle:dist
conduct load <Tab for bundle file >
conduct run <bundleId>

for bundle configuration:

sbt
project akkaclusterBack
set BundleKeys.configurationName := "stage"
clean
configuration:dist
bundle:dist
controlServer 192.168.77.20
conduct load <TAB>
conduct run <HASH>    
ConductR roles

The test ConductR network in this repo will bring up a 4 node network with the following akka.cluster.roles

  1. 192.168.77.20 akka.cluster.roles=[web-server]
  2. 192.168.77.22 akka.cluster.roles=[backend]
  3. 192.168.77.23 akka.cluster.roles=[frontend]
  4. 192.168.77.24 akka.cluster.roles=[backend]

To view the roles in a conductr cluster, ssh to control server and:

curl -s $(hostname):9005/members | python3 -m json.tool    

In each of the sub-projects sbt projects specification, a role is assigned for that app eg:

BundleKeys.roles  := Set("backend")

When this app gets deployed to the ConductR cluster, it will only be replicated/ started on a node with the matching role

The all-conductrs role is the default, it will allow any role.

About

Collection of projects used to demo the features of Typesafe conductR

Resources

License

Stars

6 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors