On 02/07/2014 11:49, Paul Taylor wrote:
I guess I'm a little confused as to what this means.
I have a simple WAR based web application that uses Lucene created
indexes to provide search results in a xml format.
Especially given the following context:
and supplementary question how do I modify my pom file to do this
with maven
I was under the impression that Paul was building a separate
application using Lucene during the build stage to create the
indexes, but then using an application - specific mechanism to use
those indexes.
That's what I thought, too.
Yes correct, let me explain it a bit further. I'm trying to deploy an
application that serves results from a lucene index in response to
user requests. Deploying it manually to my own server is fine, first
of all I just copy the index files to a location on the disk, then I
deploy my application, and within its web.xml I have a servlet
parameter that defines where the indexes are, so within the servlets
init() method i initilize the indexes. The problem is that I'm trying
to deploy my application to Amazon Web Services using autoscaled
Elastic Beanstalk, this means that the application has to be able to
be initilized and created based on what is in the war because Elastic
Beanstalk will automatically start new servers as required due to load
and terminate those instances when not required.
I do seem to have a solution, but I detail it here because it doesn't
seem quite right and might be useful to others.
Short Answer:
Originally I first tried putting the index files (unzipped) into the
src/main/resources folder of my maven project, and referred to the
WEB-INF/classes/index_dir location in my web.xml and tomcat didn't
start. It didnt seem right for non Java classes to be in that folder
anyway so I discarded that idea, however Ive just tried it again
locally and it worked so if it works on EB that is the solution I'm
going to use for now unless any better suggestions. It does mean that
the resulting .war file is rather large, far too large to upload from
my local machine but as I build the code and indexes from another AWS
EC2 instance I can just dump it into S3, and deploy from S3 to EB, if
I need to redeploy you dont seem able to redeploy from S3 but Ive
realised that when I need to redeploy I would do it to a new EB
configuration and then swap the dns from EB1 to EB2 to mimimize
downtime so that is not really a problem.
Bother - it doesn't work because of an arbitary limit of 524,288,000
bytes (1/2 GB) on the size of the war that can be deployed to EB. Don't
know why Amzon have this limit but because my war now contains the index
files its larger than that.
Looks to me the only possibility of getting it working properly is to
use .ebextensions or Docker
Paul
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org