Steven Erat's Blog Steven Erat Photography
 
 
Viewing By Entry
 
 

TalkingTree  Starting ColdFusion9 Solr: Using cfsolr in same directory

 

The cfsolr script for Mac, Linux, and Unix is written such that you must be in the ColdFusion9/solr/ directory when running the script. The script refers to the start.jar file without providing the full path.

The problem is that if you are not in the solr/ directory under the ColdFusion root directory, the cfsolr script echos that Solr has been started or stopped, even though it has not.

Since the standard error is redirected to the standard out with "2>&1" the problem is swallowed and the person performing the operation is led to believe that the operation has been carried out as expected.

Here's a snippet from the ColdFusion9/solr/cfsolr script showing that start.jar is referenced without a full path:

SOLRSTART='nohup java $JVMARGS -jar start.jar > $SOLR/logs/start.log 2>&1 &'
SOLRSTOP='nohup java $JVMARGS -jar start.jar --stop > $SOLR/logs/start.log 2>&1'


Looking at the logs, I see that the problem was quietly recorded in a solr log file:

QAs-iMac:logs QA$ pwd
/opt/ColdFusion901/solr/logs
QAs-iMac:logs QA$ cat start.log
Unable to access jarfile start.jar


The script already has a variable defining the Solr directory path:

SOLR="/opt/ColdFusion9/solr"


To fix the bug, prefix the reference to start.jar with ${SOLR}/start.jar like this:

SOLRSTART='nohup java $JVMARGS -jar ${SOLR}/start.jar > $SOLR/logs/start.log 2>&1 &'
SOLRSTOP='nohup java $JVMARGS -jar ${SOLR}/start.jar --stop > $SOLR/logs/start.log 2>&1'


With that fix, the cfsolr script can be called from any directory outside the solr directory.

Here is an examle of how the script falsely echos that the solr server has stopped or started when it has not (determined by grepping for the process):

QAs-iMac:opt QA$ pwd
/opt
QAs-iMac:opt QA$ ./ColdFusion9/bin/coldfusion stop
Stopping ColdFusion 9, please wait
Stopping coldfusion server.stopped
ColdFusion 9 has been stopped
QAs-iMac:opt QA$ ps -ef | grep solr
501 73310 1 0 0:00.25 ?? 0:02.64 /usr/bin/java -XX:+AggressiveOpts -XX:+ScavengeBeforeFullGC -XX:-UseParallelGC -Xmx256m -Dsolr.solr.home=multicore -DSTOP.PORT=8079 -DSTOP.KEY=cfsolrstop -jar start.jar


QAs-iMac:opt QA$ ./ColdFusion9/solr/cfsolr start
Starting ColdFusion Solr Server...
ColdFusion Solr Server is starting up and will be available shortly.
QAs-iMac:opt QA$ ps -ef | grep solr
501 78371 62961 0 0:00.00 ttys000 0:00.00 grep solr
QAs-iMac:opt QA$ ps -ef | grep solr
501 78373 62961 0 0:00.00 ttys000 0:00.00 grep solr
QAs-iMac:opt QA$ ps -ef | grep solr

 


Comments

Thanks Steven,

I just ran into this problem, remembered your tweet about it, and found your blog on it. :)


Oh, *that* Aaron Longnion. Just put the face to the name. You're welcome.


Thanks Steven, very helpful.

I tried editing my cfsolr file and adding the path like you suggested but it doesn't appear to be working, I still have to be in the cfusion/solr/ directory to start it. Any idea why that might be?


Ryan, you might want to add an echo ${SOLR} to your script to see what it is interpreted as, you could also check the Solr start.log, or remove the whole > $SOLR/logs/start.log 2>&1 from the script so that your console will show all the output.


 

 

Calendar

 
Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

Search This Site

 
This is an exact search only

topics

 
adobe blogging coldfusion computer technology events flex java learning linux mac os x macromedia meetup new england odds & ends outdoors personal photos photoshop science travel video

About This Site

 
Adobe Alumni & Community Professional. Expert in ColdFusion, Flex, LCDS, Photoshop, Lightroom. Linux RHCE. Follow Me!. For my photography check out Boston Portrait Photographer.

Speaker at CF.Objective(): Automated UI Testing with CFSelenium, MXUnit, ANT, and JenkinsCI

Adobe Community Professional (ACP)
Red Hat Linux Certified Engineer

Recent Entries

 
Automated System Testing for ..
Could not find ColdFusion com..
No April Fools: Selenium Ship..

Recent Comments

 
Posted By Steven Erat:
Jim, and anyone else that may attend, if you would like the full slide deck and my demo project files BEFORE the conference, please reply as a comment ...

Posted By Jim Priest:
Can't wait for this one!!

Posted By iPhone Repair:
It appears there are so many people have issue with their iPhone & iPod Touch screens dropped and cracked. It happened to me also when u haven't got a ...

recently played

 
Mr. Brightside
by The Killers
on Hot Fuss
Get Hot Fuss by The Killers on Amazon

now playing, a plug-in for itunes

Categories

 
RSS Adobe (34)
RSS Bicycling (9)
RSS Blogging (39)
RSS Books (13)
RSS Breeze (13)
RSS CFMX Podcasts (10)
RSS ColdFusion (437)
RSS Computer Technology (51)
RSS Events (26)
RSS Flex (20)
RSS Gadgets (11)
RSS HiTech Industry (16)
RSS Java (26)
RSS Learning (57)
RSS Linux (70)
RSS Mac OS X (23)
RSS Macromedia (27)
RSS Meetup (35)
RSS New England (62)
RSS Odds & Ends (25)
RSS Outdoors (32)
RSS Personal (29)
RSS Photos (111)
RSS Photoshop (29)
RSS Podcasts (18)
RSS Rants (19)
RSS Restaurants (8)
RSS Science (34)
RSS Spain (16)
RSS Travel (42)
RSS Twitter (10)
RSS Video (20)
RSS Webcam (3)
RSS Writing (10)

RSS

 


Add to Google
Add to My Yahoo!

Credits and Stuff

 
BlogCFC - Free ColdFusion Powered Blog Software


 
 
blog | photos | flickr | referers | webcam | stats | about | contact
 
Copyright © 2012 Steven Erat. All rights reserved.
This is a personal weblog. The opinions expressed here represent my own and not those of my employer