using Solr in a multi instance configuration

541 views
Skip to first unread message

BarryC

unread,
Apr 4, 2011, 5:25:06 PM4/4/11
to cfaussie
Hi,

Has anyone used, or does anyone know how to get Solr going properly in
a multi instance configuration?

We have two instances on a single server installed;
cfusion
uat

the solr directory sits buried inside the cfusion instance directory,
but the uat instance does not have a solr directory. It seems by
default that the idea is to have the new instance point at the solr
server running out of the original instance 'cfusion'
We want the uat instance to have seperate solr search collections but
using the same collection names as the ones in cfusion, which means we
need to have a seperate solr store somehow.

I've had a look at running 'multiple solr webapps' from a single solr
server, but the documentation on this is very poor and I have not been
able to successfully get this working.

Do we need to duplicate the solr directory into the new instance, and
run a seperate solr server start script with solr running on a
different port or something?

Thanks
Barry

Mark Mandel

unread,
Apr 4, 2011, 5:42:59 PM4/4/11
to cfau...@googlegroups.com

I had a look the other day, and it looks like cf's solr configuration is multi core, so you can set up more than one index on there. You don't need a whole other solr instance running.

I'm doing a lot of solr work at the moment, and found it much easier to simply setup an instance of the latest solr on jetty, and talk to it via solrj loaded in JavaLoader, than screw around with cf's version.

Mark

Sent from my mobile device.

> --
> You received this message because you are subscribed to the Google Groups "cfaussie" group.
> To post to this group, send email to cfau...@googlegroups.com.
> To unsubscribe from this group, send email to cfaussie+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.
>

Barry Chesterman

unread,
Apr 4, 2011, 6:07:02 PM4/4/11
to cfau...@googlegroups.com
Yes, we have several indexes in Solr e.g.

majors
papers

The only problem is, our second instance needs to use the same collection names which means we can't just point the second instance to the same place.

Mark Mandel

unread,
Apr 4, 2011, 7:31:03 PM4/4/11
to cfau...@googlegroups.com

Oh, I think I see the issue.

You want to deploy a second instance of solr, but are not sure how to tell each instance to have different solr homes. Is that correct?

Mark

Sent from my mobile device.

On 05/04/2011 8:07 AM, "Barry Chesterman" <barrych...@gmail.com> wrote:

Barry Chesterman

unread,
Apr 4, 2011, 8:19:19 PM4/4/11
to cfau...@googlegroups.com
Deploying a second instance of solr was my idea also, but I wasn't sure if this was the right way to go about it or not (I'm also not exactly sure how you go about deploying a second instance of Solr either) - is it a copy directory and modify some files type exercise, or is it a run the solr standalone installer? the solr we are using is the one that installs all by itself when you put coldfusion 9 on.

I know how to tell an instance what Solr to look at (in the CFIDE administrator, in Solr) so that bit is straight forward.

Mark Mandel

unread,
Apr 5, 2011, 2:01:38 AM4/5/11
to cfau...@googlegroups.com
Yeah, it's another JEE deployment.

Looks like CF is running SOLR on a Jetty servlet engine. It may be a case of going into /opt/webapps/ and making a copy of solr.war and call it something new (say uat.war), and then restarting it.

You will have to look at having seperate solr.home's defined for each solr instance, and that is the tricky bit. It may actually be a zillion times easier to simply install another instance of Jetty on the server, and drop solr on it, and point your UAT machine at that instead.

I don't think that CF supports pointing at multiple SOLR instances, does it?

Mark
--
E: mark....@gmail.com
T: http://www.twitter.com/neurotic
W: www.compoundtheory.com

cf.Objective(ANZ) - Nov 17, 18 - Melbourne Australia
http://www.cfobjective.com.au

Hands-on ColdFusion ORM Training
www.ColdFusionOrmTraining.com

charlie arehart

unread,
Apr 5, 2011, 12:13:23 PM4/5/11
to cfau...@googlegroups.com
Barry, this is indeed interesting. I've read the other replies so far, and I
have some other thoughts.

I've not tried to install solr on a server where I installed CF in
multiserver mode, but looking at the install guide, it's a little unclear.
It says in the discussion of J2EE deployment (which is different from
multiserver) that "there can be only one solr instance per server". It
doesn't really seem to speak to multiserver deployment.

But it does say (as Mark did) that at least in that J2EE setup, the solution
is for it to be in one place and for the solr home in each CF admin to be
configured to point to that place.

I'm curious: do I assume you did tell it to install Solr during the CF 9
Multiserver installation, right? I'm curious: where did the solr files end
up? In a Standard/Server deployment, they are in a [cf]\solr directory. In a
multiserver deployment, was this created within the cfusion instance (such
as a C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\cfusion\solr
directory), or perhaps even also in each new isntance (such as in
C:\JRun4\servers\instance2\cfusion.ear\cfusion.war\WEB-INF\cfusion\solr)? Or
is it put in some directory outside of jrun entirely?

If it was created each instance, then I wonder if it may be possible for you
to manually manipulate the solr/jetty config files to simply specify
different ports so that they can run on their own. It seems reasonable. But
I wouldn't be surprised if the CF team opted to make the default behavior be
simplest: a single deployment.

Hope that helps. Let us know what you find.

/charlie

Barry Chesterman

unread,
Apr 5, 2011, 5:14:58 PM4/5/11
to cfau...@googlegroups.com
Thanks for the info Mark, and yes you can point coldfusion to a seperate solr instance.

Charlie, when the initial install was done, it was a multiserver deployment. Yes it goes in the directory you mention below, in the default cfusion instance in:

/opt/jrun4/servers/cfusion/..
The Solr part is installed at:
/opt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/solr/
and there is a start script that gets put in init.d/ to start / stop / restart solr.
Yes solr was installed in the initial deployment and we have been using it without a problem in that instance.

When the second instance creation was done, we just ran the create new instance from the CFIDE administrator, and then did the custom apache config edits as listed in the cf9 documentation. It creates the second instance here:
/opt/jrun4/servers/uat/
I looked in the corresponding folder as the default install, and there is no solr/ folder in
/opt/jrun4/servers/uat/cfusion.ear/cfusion.war/WEB-INF/cfusion/

We are not sure what one is 'supposed' to do here, normally I guess you would have your second instance just point to the solr server running from the default install instance, but in our case this is no good because we need to use the same collection names for the second instance.

I had a go at running multiple webapps with Jetty (what Solr in cf runs on) - where you edit the [CF]/solr/etc/jetty.xml config file as shown here:
http://wiki.apache.org/solr/SolrJetty
but none of that worked, Solr would always fail to start with errors, normally about how it couldn't find the methods or classes specified.

Solr under coldfusion runs the collections out of a [CF]/solr/multicore

The only options I've come up with are;
1. copy the solr folder from the cfusion instance, to our uat instance, and update the jetty config accordingly, add a new solr start file in init.d and update the new coldfusion instance to point to that solr server.
2. run the installer for the standalone solr server (which adobe provide mainly for running solr on a different server), then point the new coldfusion instance to that - essentially what Mark pointed out in his post.

Barry

charlie arehart

unread,
Apr 5, 2011, 10:34:55 PM4/5/11
to cfau...@googlegroups.com

Thanks for the clarifications/confirmations/observations. Sounds like you will indeed need to go one of those two routes. Sorry I couldn’t help more.

 

/charlie

Mark Mandel

unread,
Apr 5, 2011, 11:17:57 PM4/5/11
to cfau...@googlegroups.com
Just as an aside - if anyone is looking to seriously get into Solr, I cannot recommend this book enough:
http://www.packtpub.com/solr-1-4-enterprise-search-server/book

Solr is an amazing product, but its online documentation can be lacking. The above book really takes you end to end with Solr, and shows you pretty much everything that can be done with it, from features, through to deployment.

Mark

--
You received this message because you are subscribed to the Google Groups "cfaussie" group.
To post to this group, send email to cfau...@googlegroups.com.
To unsubscribe from this group, send email to cfaussie+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.



--

Rawdyn Nutting

unread,
Apr 6, 2011, 4:18:08 AM4/6/11
to cfau...@googlegroups.com
Thanks Mark,

Just today a client asked me for a searchable document repository.
Great timing.

Rawdy

On Wednesday, April 6, 2011, Mark Mandel <mark....@gmail.com> wrote:
> Just as an aside - if anyone is looking to seriously get into Solr, I cannot recommend this book enough:
> http://www.packtpub.com/solr-1-4-enterprise-search-server/book
>
> Solr is an amazing product, but its online documentation can be lacking. The above book really takes you end to end with Solr, and shows you pretty much everything that can be done with it, from features, through to deployment.
>
> Mark
>

--
*Rawdyn Nutting*
Chief Technology Officer
*CODEBASE Pty Ltd*
codebase.com.au
1300 596 400

Reply all
Reply to author
Forward
0 new messages