Awesome
Serenity-formulas
Salt formula and scripts for Mesos with Serenity deployment.
For the full Salt Formulas installation and usage see instructions.
For official Serenity page see Project Serenity.
Requirements
- Zookeeper is working on all Master nodes (in HA) on default 2181 port.
- Salt installed and configured on nodes.
- Proper DNS and hostname setup.
- Master and Slaves nodes must be able to communicate freely with each other.
- For marathon: java installed.
Status
Tested on CentOS 7, 36x Intel Xeon E5 v3 machines with NFS storage under DCOS.
Installation:
On salt master node:
-
Install formulas from this repo to
/srv/formulas/
:git clone https://github.com/Bplotka/serenity-formula.git
-
Add
/srv/formulas/serenity-formula
to/etc/salt/master
conf under:file_roots: base: - /srv/formulas/serenity-formula
-
Restart
salt-master
. -
Copy
serenity.sls.example
to/srv/pillar/serenity.sls
and edit file to configuration. (make sure thatdns
,zookeeper_cluster_size
andmaster_lb
are filled properly. -
Copy or append content from
top.sls.example
to/srv/pillar/top.sls
-
Set roles for each node using salt:
$ salt 'masternode.example.com' grains.setval mesos-roles [master] $ salt 'agentnode.example.com' grains.setval mesos-roles [slave]
-
Set roles for each slave if needed:
$ salt 'agentnode.example.com' grains.setval mesos-default-role custom_role
-
Run formula to prepare configuration:
$ salt '*' state.sls serenity.setup
-
[Optional] Configure your build system to put Mesos build in
/srv/formulas/serenity/build/mesos_latest/
-
Configure your build system to put Serenity build in
/srv/formulas/serenity/build/serenity_latest/
-
Make sure that
/srv/formulas/serenity/build/
has write rights for your build system.
Installation under DCOS:
These formulas are able to work also under the DCOS.
On salt master node: Do all steps from above section except 5. Theses formulas will use dcos-roles.
Usage:
-
Each time you deploy and build new mesos & serenity source you can deploy it easily:
$ salt '*' state.sls serenity.deploy_all
-
Each time you deploy and build ONLY serenity source you can deploy it easily:
$ salt '*' state.sls serenity.deploy
Or just deploy on slaves:
$ salt -G 'mesos-roles:slave' state.sls serenity.deploy
Under the DCOS in case of need for reverting mesos to the DCOS version just run:
$ salt '*' state.sls serenity.use_dcos
Marathon installation and usage via serenity-formula:
Serenity formula is able to run configured marathon as well. As default it deploys proper marathon services to systemd in HA on the same nodes where Mesos Masters are. In case of willing to run custom marathon using this formula you need some additional steps to make it running:
-
Make sure that you have java installed on your machine.
-
Download marathon.jar (version you want to have in your cluster)
-
Use
serenity.deploy_with_marathon
instead ofserenity.deploy_all
$ salt -G 'mesos-roles:slave' state.sls serenity.deploy_with_marathon
Other information:
- Make sure that every needed file from mesos build is present (for now,
.so
,./sbin
and./share
are downloaded)