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
- Contact typesafe, get a copy of conductr.deb, add it into your clone of this repo
- Build cluster with vagrant + ansible in project.
- This vagrant uses a custom base-box... you can use this: https://github.com/dsugden/vagrant-ansible-ubuntu-oracle-java8 to create this box
- OR use trusty64 box and uncomment the java task in build-cluster-vagrant.yml's
-
Launch visualizer
These example projects are using sbt-conductr 1.2.1
As this plugin evolves, this repo will be updated.
sbt micro/bundle:dist
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>
The test ConductR network in this repo will bring up a 4 node network with the following akka.cluster.roles
- 192.168.77.20 akka.cluster.roles=[web-server]
- 192.168.77.22 akka.cluster.roles=[backend]
- 192.168.77.23 akka.cluster.roles=[frontend]
- 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.