SOLR 5 Install in a Production Environment - solr

I am a bit confused about installing SOLR 5.5. The 5.5 manual says it is not recommended to deploy solr war on any other web/application servlet containers. It says deploy solr as a stand alone server. What does this mean? SOLR running on port 8983 is not running out of jetty? SOLR itself is a web server? How stable will it be in a prod environment?
I followed all the instructions on https://cwiki.apache.org/confluence/display/solr/Installing+Solr
https://cwiki.apache.org/confluence/display/solr/Taking+Solr+to+Production
Appreciate if someone can share their experience.

It's using Jetty, but it might not in the future (as there are quite a few things that gets easier to implement when you don't have to consider the webapp framework around your service). That's why 5.0 dropped explicit support for running in an existing container (it can still be done - but you're on your own, and features may break). At least now the environment for the application can be assumed to be a certain container and have a specific feature set.

Related

How to integrate apache solr in apache tomcat 7?

Is there any way to integrate apache solr in tomcat 7 or do I have to run two servers in my application? Can in run apache solr within tomcat and not as a separate server?
The official answer is: Run it as a stand alone application.
No Longer Supported
Beginning with Solr 5.0, Support for deploying Solr as a WAR in servlet containers like Tomcat is no longer supported.
For information on how to install Solr as a standalone server, please see Installing Solr.
Background about the the decision for this move can be found on the Solr Wiki.
Solr is intended to be a server not a Java web application, similar to mysql or the Apache web server. When Solr was first created, designing it as a web application was a convenient choice, to avoid writing a lot of tricky code to build a network layer. These days, this design decision has become a limiting factor.
When you download Solr and install it onto your machine, it should be Solr that gets started. It should not be necessary to install Solr into a third-party application (servlet container) before it will work.
At this time, Solr is still a webapp, but this is an internal implementation detail, not an immutable property. The intention is to make Solr into a completely standalone application. Startup scripts that start the included container are the first step towards that goal. Jetty might still be the technology used once Solr is a standalone application, but if that happens, it will be internally embedded.
Solr is still a web app. They are suggesting that not to use it in another servlet container as its not been recommended and tested by them.
They are giving a fully tested system and don't want others(developers) to invest time in testing it with other containers.
I have used solr 3.4 version and deployed it in tomcat server on port 8080.
My application is deployed in another tomcat at 8080 port and is on another machine.
I have created the solr war and deployed the same in tomcat. and only 8080 port of that server is made open and been access by our application only.
I am not sure about the solr version 5 ...i.e. whether that can be deployed in other container other than jetty...but I think it can be deployed in tomcat...you need to try the same...
Other thing is that dont deply application war and solr war in the same container or in a single container. The reason is if one of the application goes down everything will be down.
Like if solr goes down then the application may go down, which is not a good for the application.

Hoster requirements for running Solr

I am planning to add a full-text search engine for searching a MySQL database to a website. Most recommendations on a nice, user-friendly implementation I found, mentioned the use of Apache Solr.
Keeping this in mind I started searching for the requirements for a hoster to use Solr but I didn't find any useful information expect for "it should support java". So I picked a random host that states it has Java JRE installed (http://wiki.dreamhost.com/What_We_Support) and asked if they supported Solr. Unfortunately, the answer was "no".
So, what would I need to be looking for? Do I need a dedicated server, a VPN, or are there shared hosting solutions where it is possible to run Solr?
What are the system requirements?
I hope there is someone out there, who knows a bit about this. Thanks!
The Solr requirements can be found here: https://wiki.apache.org/solr/SolrInstall
So an installed JRE is needed, but also an servlet container, which also needs an JRE.
If I would be in your situation, I would rent an virtual server.
An other option is an hosting service, specialized for solr hosting: search the web for "apache solr hosting". There are offers for free or payed offers also.
I've been running two drupal websites + apache solr on an ssd vps from rosehosting utilizing 2 cpu cores and 1gb ram. I wasn't able to setup apache solr and java myself so that's why I rented a managed vps service.
If you're not that technical I suggest you add managed to the keywords mentioned by #The Bndr and make sure you check with your host that they will support apache solr and java on your vps

Embedded Solr on Amazon AWS

Currently, I have developed a web application. In my web application, I used embedded solr server to make indexing. After that I deployed onto the Tomcat 6 on window xp. Everything is ok. Next, I have tried my web application to deploy on Amazon AWS. My platform is linux + mysql. When I deployed, I got the exception related with embedded solr.
[ WARN] 19:50:55 SolrCore - [] Solr index directory 'solrhome/./data/index' doesn't exist. Creating new index...
[ERROR] 19:50:55 CoreContainer - java.lang.RuntimeException: java.io.IOException: Cannot create directory: /usr/share/tomcat6/solrhome/./data/index
at org.apache.solr.core.SolrCore.initIndex(SolrCore.java:403)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:552)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:480)
So how to fix my problem. I am novie to linux.
My guess is that the user you are running Solr under does not have permission to access that directory.
Also, which version of Solr are you using? Looks like 3+. The latest version is 4, so it may make sense to try using that from the start. Probably a bit more troubleshooting to start, but a much better pay off that starting with legacy configuration.
I got solution. That is because of permission affair on Amazon Linux with ec2-user. So , I changed permission by following.
sudo chmod -R ugo+rw /usr/share/tomcat6
http://wiki.apache.org/solr/SolrOnAmazonEC2strong text
t should allow access to ports 22 and 8983 for the IP you're working from, with routing prefix /32 (e.g., 4.2.2.1/32). This will limit access to your current machine. If you want wider access to the instance available to collaborate with others, you can specify that, but make sure you only allow as much access as needed. A Solr instance should not be exposed to general Internet traffic. If you need help figuring out what your IP is, you can always use whatismyip.com. Please note that production security on AWS is a wide ranging topic and is beyond the scope of this tutorial.

Install Jetty or run embedded for Solr install

I am about to install Solr on a production box. It will be the only Java applet running and be on the same box as the web server (nginx).
It seems there are two options.
Install Jetty separately and configure to use with Solr
Set Solr's embedded Jetty server to start as a service and just use that
Is there any performance benefit in having them separate?
I am a big fan of KISS, the less setup the better.
Thanks
If you want KISS there is no question: 2. stick to vanilla Solr distrib with included jetty.
Doing the work of installing an external servlet engine would make sense if you needed Tomcat for example, but just to use the same thing (Jetty) Solr already includes...no way.
Solr is still using jetty 6. So there would be some benefits if you can get the solr application to run in a recent jetty distribution. For example you could use jetty 9 and use features like SPDY to enhance the response times of your application.
However I have no idea or experience if it's possible to run the solr application standalone in a servlet engine.
Another option for running Solr and keeping it simple is to use Solr-Undertow which is a high performance with small footprint server for Solr. It is easy to use on local machines for development and also production. It supports simple config files for running instances with different data directories, ports and more. It also can run just by pointing it at a distribution .zip file without needing to unpack it.
(note, I am the author of Solr-Undertow)
Link here: https://github.com/bremeld/solr-undertow with releases under the "Releases" tab.

How to setup Solr on a live VPS?

I follow the instruction on http://lucene.apache.org/solr/tutorial.html and I can setup Solr on my PC.
Now when I come to my VPS I cannot overcome the step: $ java -jar start.jar
Afer running that command, search service is available at http: //x.x.x.x:8983/solr/select .
But, Whenever I close the SSH client, the service on http: //x.x.x.x:8983/solr/select is also closed. So I can't search any more.
What should I do?
My VPS has 512MB RAM and run mainly lighttpd, php and mySQL. Do you think Solr is suitable for me, or Sphinx is a better choice? I need faceted search on my site.
Thanks for any help.
I think you challenge is that when you start up Solr, you are starting it up as a console process, not as a daemon. So when you log out, it kills the Java process! There are a number of ways around this, from using a tool like "screen" to preserve your running console processes when you log out, to using commands like nohup or java -jar start.jar & to send those processes to the background.
However, what you really need to do is install Tomcat or Jetty as a daemon service on your VPS. You may be able to have your VPS hosting provider do this for you.
As far as your hardware setup, I think unless you have a ginormous index, or really busy site, 512 of RAM should be plenty to run a LAMP style website and Solr. One nice thing about Solr being HTTP based is you can quickly move your Solr server to another VPS as your load increases!
I would contact your VPS provider and ask them if Java is supported/recommended.. If so, you are good to go, if not, then you need a good Java supporting VPS!
I would recommend running Solr with Tomcat. That way you can run multipe Solr configurations with ease.
You can control your Solr installation from the Tomcat manager (stopping/starting).
To store Tomcat logging under your Solr directory check: http://globalgateway.wordpress.com/2010/01/06/configuring-solr-1-4-logging-with-log4j-in-tomcat/
Thank you very much. I decided to use Jetty as a daemon service to serve Solr because of its lightweight and ease to embed. It works very well on my VPS (althought this daemon use too much RAM - 50%).
My VPS is clean I and I can setup Java without any problem.

Resources