Embedded Solr on Amazon AWS - solr

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.

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.

SOLR 5 Install in a Production Environment

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.

Bluemix Monitoring and Analytics: Resource Monitoring - JsonSender request error

I am having problems with the Bluemix Monitoring and Analytics service.
I have 2 applications with bindings to a single Monitoring and Analytics service. Every ~1 minute I get the following log line in both apps:
ERR [Resource Monitoring][ERROR]: JsonSender request error: Error: unsupported certificate purpose
When I remove the bindings, the log message does not appear. I also greped my code for anything related to "JsonSender" or "Resource Monitoring" and did not find anything.
I am doing some major refactoring work on our server, which might have broken things. However, our code does not use the Monitoring service directly (we don't have a package that connects to the monitoring server or something like that) - so I will be very surprised if the problem is due to the refactoring changes. I did not check the logs before doing the changes.
Any ideas will help.
Bluemix have 3 production environments: ng, eu-gb, au-syd, and I tested with ng, and eu-gb, both using 2 applications with same M&A service, and tested with multiple instances. They are all work fine.
Meanwhile, I received a similar problem that claim they are using Node.js 4.2.6.
So there are some more information we need to know to identify the problem:
1. Which version of Node.js are you using (Bluemix Default or any other one)
2. Which production environment are you using? (ng, eu-gb, au-syd)
3. Is there any environment variables are you using in your application?
(either the creating in code one, or the one using USER-DEFINED Variables)
4. One more thing, could you please try to delete the M&A service, and create it again, in case we are trapped in a previous fault of M&A.
cf ds <your M&A service name>
cf cs MonitoringAndAnalytics <plan> <your M&A service name>
NodeJS versions 4.4.* all appear to work
NodeJS uses openssl and apparently did/does not like how one of the M&A server certificates were constructed.
Unfortunately NodeJS does not expose the openssl verify purpose API.
Please consider upgrading to 4.4 while we consider how to change the server's certificates in the least disruptive manner as there are other application types that do not have an issue with them (e.g. Liberty and Ruby)
setting node js version 4.2.4 in package.json worked for me, however this is an alternative by-passing solution. Actual fix is being handled by core team. Thanks.

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