Loading each machii instance on a clustered server as they boot up.

19 views
Skip to first unread message

drfishflan

unread,
Feb 27, 2014, 5:20:02 AM2/27/14
to mach-ii-for...@googlegroups.com

We are implementing clustering at my office.

I am attempting to create a script which will load when each server starts. (onServerStart method in server.cfc)

I would like to load up MachII for each instance as it boots up.

I have not found a way of doing this yet… any thoughts/ideas would be appreciated!

 

Thanks!

Peter J. Farrell

unread,
Feb 27, 2014, 1:00:52 PM2/27/14
to mach-ii-for...@googlegroups.com
Just make an http call to app in onServerStart.  This is load the app.

drfishflan said the following on 02/27/2014 04:20 AM:
--
--
For more options and to unsubscribe, visit this group at http://groups.google.com/group/mach-ii-for-coldfusion?hl=en
 
Git & Wiki: https://github.com/Mach-II/Mach-II-Framework
---
You received this message because you are subscribed to the Google Groups "Mach-II for CFML" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mach-ii-for-coldf...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


-- 
Peter J. Farrell
OpenBD Steering Committee / Mach-II Lead Developer
http://blog.maestropublishing.com
Identi.ca / Twitter: @maestrofjp

Please do not send me Microsoft Office/Apple iWork documents. Send OpenDocument instead! http://fsf.org/campaigns/opendocument/

Alex Tait

unread,
Feb 27, 2014, 1:48:27 PM2/27/14
to mach-ii-for...@googlegroups.com
No can do...since we clustering cannot depend upon which server node the HTTP request will hit.

Needs need to somehow initialize machii programatically within CF so that every node is loaded.

Our additional problem is that we will have multiple Application instances on each node!

Thanks for your response though!


You received this message because you are subscribed to a topic in the Google Groups "Mach-II for CFML" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mach-ii-for-coldfusion/G8Fg1Y_9giE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mach-ii-for-coldf...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Alex Tait

Peter J. Farrell

unread,
Feb 27, 2014, 2:32:29 PM2/27/14
to mach-ii-for...@googlegroups.com
Alex Tait said the following on 02/27/2014 12:48 PM:
> No can do...since we clustering cannot depend upon which server node
> the HTTP request will hit.
Typically a cluster will still have individually addressable sub domains
so direct access can be made bypassing a load balancer for debugging /
other purposes. Something like web01.example.com, web02.example.com,
etc. These subdomains are usually blocked at the firewall so only
requests on a certain subnet or network can access them.

Remember that CF (and other apps / frameworks) is all about HTTP so this
will be your friend. Even scheduled tasks are just HTTP calls and CFML
doesn't have any command line functions that you can run (unlike as
other modern language such as Python, etc.).

> Needs need to somehow initialize machii programatically within CF so
> that every node is loaded.
>
> Our additional problem is that we will have multiple Application
> instances on each node!
What I've done in the past is a small app that can send an HTTP request
to the right node / url to reload and pre-load an application.

If you want to go the onServerStart route, if all your applications live
in a similar directory like /opt/tomcat/webapps/* then you can easily
use cfdirectory and look for all Application.cfc which should have a
corresponding index.cfm to hit.

In our case, we've done
/opt/tomcat/webapps/web01-example-com/public/Application.cfc You can use
the web01-example.com from the file path as the known internal address
to that particular application on that node (just convert - to .) and
make a request to http://web01.example.com in your onServerStart. As
long as your applications follow the same policies, it is easy to parse
and dropping in new applications means they will always be found without
having to update any Server.cfc file (ie. follow a convention over
configuration in this case).
Reply all
Reply to author
Forward
0 new messages