tomcat - Customizing a web application before auto-deploying it -
the application scenario
i have bunch of tomcat servers on iaas cloud service, under control.
these servers (the application in design stage) run java application container software, such tomcat, jboss, websphere.
apart solution best, have web application (a war) of have total source code. in decent hosting environment, set of new user implies deploying fresh new re-create of same web application different application context (say, re-create war newuser.war
, allow tomcat eat it).
the application based on spring , hibernate. it's powered maven.
since run on iaas, considering adding requirement our management software. if application server goes down, redeploying webapps runs on different node, and/or automatically request cloud provider provisioning of new machine (especially when registered users increase). don't have paas service @ our provider. discussing cloud providers supporting java webapps out of scope.
configuration needseach instance of mentioned webapp has own database (need specific connection string generated management software). also, require few beans customized in string properties.
the questionwith focus self-managed , auto-manageable tomcat server, need design automated setup mechanisms (to integrated in failover discussed before). our problem right set db connection string , a few spring beans' string properties (these shared 1-to-1 passcodes).
first, came imagination possible solution, don't know if it's "best" in terms of easiness , manageability.
the question then:
from high level point of view, see major flaws in approach described below? do know smarter solutions (perhaps ease of additional software) accomplish need do? the approachsince have total source code, bash script may suffice:
download fresh re-create svn production branch literally replace connection string inhibernate.cfg.xml
desired 1 (perhaps file in svn branch contains placeholder string replacement) literally replace placeholders in spring configuration file copy tomcat webapp folder under new name wait tomcat autodeploy
spring supports placeholder.
the easiest way set property file in class path (if there 1 war running per server, in tomcat lib dir, or if there several war in war/web-inf/class folder).
most of time placeholder used define db connection (probably solving hibernate config needs).
as there several different way retrieve configuration should utilize big g search method case.
tomcat cloud war web-deployment
No comments:
Post a Comment