tag:blogger.com,1999:blog-23220351717325343302024-02-20T08:37:47.405-08:00Blog - SimplyPhi Software Solutions Private LimitedSimplyPhihttp://www.blogger.com/profile/03424481068656672487noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-2322035171732534330.post-65508424226184619662012-06-23T04:21:00.000-07:002013-09-13T06:04:12.879-07:00SOLR - Upgrade to Jetty 8<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
<span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;"><br /></span><span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">After working with Solr for so many years, right from solr version 1.2 </span><span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">I realised it usually started with downloading the latest source </span><span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">distribution and working from the example dir wihich had a solr </span><span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">instance packaged in jetty 6.x container. All these years Solr </span><span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">versions kept changing from 1.x to 3.x series but jetty version stayed </span><span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">at 6.x. recently I discovered that eclipse foundation has released </span><span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">jetty 8 stable version after years of hard work. While the new Solr </span><span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">version is going to upgrade current 3.x release is going to stay on </span><span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">jetty 6.x. So I decided to take the plunge and </span><span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">do the upgrade myself.</span><br />
<span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;"><br /></span><span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">I used the latest <b>Solr 3.6.0</b> version which is the latest stable release of solr as of now and the jetty <b>8</b></span><span style="background-color: white;"><span style="color: #222222; font-family: arial, sans-serif; font-size: x-small;"><b>.1.4.v20120524</b> version, </span></span><span style="background-color: white;"><span style="color: #222222; font-family: arial, sans-serif; font-size: x-small;">also the latest stable release of jetty 8.</span></span><span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;"> The key change is the way in which jsp is supported by jetty 8, we need to specify the jsp in options. Jetty 8 uses jsp 2.2 compared to 2.1 in earlier version and servlet 3.0 compared to 2.5 in jetty 6.</span></div>
<div style="text-align: justify;">
<span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;"><br /></span></div>
<div style="text-align: justify;">
<span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;"><br /></span></div>
<div style="text-align: justify;">
<span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">To start the action, you can pull out the ready to run solr server directly from github at:</span></div>
<br />
<a href="https://github.com/umars/jetty-solr.git" style="background-color: rgba(255, 255, 255, 0.917969); color: #1155cc; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;" target="_blank">https://github.com/umars/jetty-solr</a><br />
<br />
<div style="text-align: left;">
<span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">To start the server you just need to first clone the repo and then </span><span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">start the server as:</span></div>
<br />
<span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;"> <b> <i>git clone</i></b> </span><a href="https://github.com/umars/jetty-solr.git" style="background-color: rgba(255, 255, 255, 0.917969); color: #1155cc; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;" target="_blank">https://github.com/umars/jetty-solr</a><br />
<br />
<span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">For all purpose i will call the newly checked out dir as <b><i>JETTY_DIR</i></b></span><br />
<br />
<span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;"> <b><i>cd $JETTY_DIR</i></b></span><br />
<span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;"> <b><i>java -jar start.jar</i></b></span><br />
<br />
<div style="text-align: left;">
<span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">When you see a message like "Started </span><a href="http://SocketConnector@0.0.0.0:8983/" style="background-color: rgba(255, 255, 255, 0.917969); color: #1155cc; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;" target="_blank">SocketConnector@0.0.0.0:8983</a><span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">" , </span><span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">your server should be ready now to be used</span></div>
<br />
<span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">To demonstrate the use , the exampledocs dir contains some sample </span><span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">documents , same as provided in the solr distribution. </span><span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">From another console run the following commands:</span><br />
<br />
<span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;"> <b><i>cd $JETTY_DIR/exampledocs</i></b></span><b><i><br style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;" /><span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;"> ./post.sh *.xml</span></i></b><br />
<div style="text-align: left;">
<br style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;" />
<span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">You should see some activity on the console where we started the </span><span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">server, as the data in the files get posted to the index. </span><span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">When you see a message like "INFO: {commit=}" , the solr server has </span><span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">data ready to be served.</span></div>
<div style="text-align: left;">
<span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;"><br /></span><span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">Now fire up a browser and go to "</span><a href="http://localhost:8983/solr/select?q=*:*" style="background-color: rgba(255, 255, 255, 0.917969); color: #1155cc; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;" target="_blank">http://localhost:8983/solr/<wbr></wbr>select?q=*:*</a><span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">"</span></div>
<div style="text-align: left;">
<span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;"><br /></span><span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">You should be able to see the results as xml in the browser.</span></div>
<div style="text-align: left;">
<span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;"><br /></span></div>
<span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;"><br /></span></div>
Anonymoushttp://www.blogger.com/profile/15171988247501126827noreply@blogger.com6