start solrserver deployed inside tomcat from within eclipse - eclipse

I am working in windows 7 machine.I want to implement search using apache solr with hbase ta
bles as datasource. I have configured apache solr 4.3.1 in tomcat 7. I can able to deploy it successfully by manually starting tomcat server.
When i try to start solr server from within spring mvc web application it says solrserver started,but when i query the solr its giving the following without any errors:
page 0 of 0 containing UNKNOWN instances
As per my research on solr, it is mentioned embedded solrserver is unfit for production so i need to have httpsolrserver.
So somebody help me clear my head and give me some solution...
Thanks in advance..

For production, you would be better with hosting Solr as a seperate instance.
This would keep the responsibility separate, web application and search engine.
Indexing process are resource intensive and would the web application behavior as well.
This can be catered by Master Slave arch, providing best search performance.
External instance can be scaled at will and would not impact the web application.

Related

Host RESTHeart on IBM WebSphere

I want to host/run RESTHeart on an IBM WebSphere Application Server (traditional V8.5 or Liberty). For default RESTHeart is made to run on Undertow/JBoss(?).
Is there any possibility to do so? I couldn't find anything about that.
You can't. RESTHeart is a plain Java application, it is NOT meant to be ran inside any application server. It's not true it's made to run inside Undertow/JBoss, instead RESTHeart embeds Undertow, to serve HTTP requests very efficiently.
RESTHeart has been developed with a micro-services architecture in mind, because we wanted something simple, without the need to run and manage a fully fledged application server in our production environments.

Elastic search to be deployed as embedded or client/server mode

Which is the preferred mode of deployment for Elasticsearch, embedded mode (embedded in to the product/application) or client/server mode?
Apache Solr and most of the SQL, NOSQL databases are usually deployed in client/server mode. Where server runs as standalone, the client might be a driver library which will be used in the application.
In case of Elasticsearch, client and server binaries are the same. It would be difficult to package two separate Elasticsearch binaries, one for client to use in the application and another for the standalone server. I am planning to go with Rest API because I cannot package two set of Elasticsearch binaries in my product.
What is the general practice for Elasticsearch deployment? Keep Elasticsearch as standalone and use Rest API or embedded Elasticsearch within the application?
For production usage it is better to decouple your application from elasticsearch srever.
Lets say you want to upgrade to elastic 2.X that mean that you will need to re-compile your application - wouldnt it be overhead?
If you to run unit/data integration test you can use elasticsearch as embedded service to your testing needs

Solr + Eclipse + Jetty + custom jsp

i wish to design a jsp page which uses solr to index and search for queries. I would like to know how to do that with eclipse, jetty, solr and jsp. Please advise. Thanks.
You don't want to expose Solr directly to the web. Think of it as a special kind of database that needs to be protected. So, it will be a standalone service and you ignore that it is running as part of a container (Jetty). With Solr 5, just released, this is now the official position.
So, then you design your client anyway you want in the other service and it should talk to Solr using SolrJ client.
Or you could use something like Spring Boot with Spring Data Solr, which does not use JSP, but does make it easier to build a web interface quickly and to talk to Solr using it's own client library.

Deploying an application without undeploying previous one and with no downtime?

I use Glassfish Java, and JSP over MySQL for my web applications. Many online people uses this web application and that web-site should not be down.
When I want to deploy a new war file, I should undeploy and deploy the new one for my application at server.
My question is that;
Is there any technology that doesn't need to undeploy my application and just change the appropriate classes so no need to redoploy it again?
There are java technologies that would allow you to replace classes on the fly (like JRebel). But since you're using Glassfish already, you should just start using clustering which is built into glassfish. You'll need either 2.1 or 3.1, as 3.0 does not support clustering. With a Glassfish cluster, you have a load balancer (Apache, Sun Web Server, hardware (Big IP, Coyote), etc) distribute the load among your cluster nodes. When you want to upgrade the app, you can technically do it one node at a time. Setting up the cluster is not the easiest thing in the world, but it is doable and it would get you some great benefits. You'll be able to scale the load by adding new hardware and even using Amazon (or whoever) cloud services. You'll be able to keep your site running even if the hardware fails on one of the nodes.
Personally I'm in the middle of converting from Glassfish 2.1 to 3.1. So far I like the management of the Glassfish 3.1 cluster much better, but I can't personally vouch for how it will run in production, though I have high expectations.
http://download.oracle.com/docs/cd/E18930_01/html/821-2432/gktqx.html#gktob
Jim is right, the best solution is currently to use a cluster and perform a manual rolling-upgrade.
But there is actually work ongoing to address your needs. We are working on a rolling-upgrade feature in a single standalone instance. To sum up in a nutshell (as the specifications have not been published yet), it will let you switch from an application version to another (see application versioning and the enable command) with no downtime. Stay tuned.

Heroku-like services for Scala?

I love Heroku but I would prefer to develop in Scala rather than Ruby on Rails.
Does anyone know of any services like Heroku that work with Scala?
UPDATE: Heroku now officially supports Scala - see answers below for links
As of October 3rd 2011, Heroku officially supports Scala, Akka and sbt.
http://blog.heroku.com/archives/2011/10/3/scala/
Update
Heroku has just announced support for Java.
Update 2
Heroku has just announced support for Scala
Also
Check out Amazon Elastic Beanstalk.
To deploy Java applications using
Elastic Beanstalk, you simply:
Create your application as you
normally would using any editor or IDE
(e.g. Eclipse).
Package your
deployable code into a standard Java
Web Application Archive (WAR file).
Upload your WAR file to Elastic
Beanstalk using the AWS Management
Console, the AWS Toolkit for Eclipse,
the web service APIs, or the Command
Line Tools.
Deploy your application.
Behind the scenes, Elastic Beanstalk
handles the provisioning of a load
balancer and the deployment of your
WAR file to one or more EC2 instances
running the Apache Tomcat application
server.
Within a few minutes you will
be able to access your application at
a customized URL (e.g.
http://myapp.elasticbeanstalk.com/).
Once an application is running,
Elastic Beanstalk provides several
management features such as:
Easily deploy new application versions
to running environments (or rollback
to a previous version).
Access
built-in CloudWatch monitoring metrics
such as average CPU utilization,
request count, and average latency.
Receive e-mail notifications through
Amazon Simple Notification Service
when application health changes or
application servers are added or
removed.
Access Tomcat server log
files without needing to login to the
application servers.
Quickly restart
the application servers on all EC2
instances with a single command.
Another strong contender is Cloud Foundry. One of the nice features of Cloud Foundry is the ability to have a local version of "the cloud" running on your laptop so you can deploy and test offline.
I started working on the exact same thing as what you said a few weeks ago. I use Lift, which is a great framework and has a lot of potential, on top of Linux chroot environment.
I'm done with a demo version, but Linux chroot is not that stable (nor secure), so I'm now switching to FreeBSD jail on Amazon EC2, and hopefully it'll be done soon.
http://lifthub.net/
There are also other Java hosting environment including VMForce mentioned above.
If you are looking for a custom setup which also has the ease of deployment that heroku offers: http://dotcloud.com. They are invite only right now but I was given access in under three days. I am working on a Lift/MongoDB project there and it works well.
Off the top of my head, only VMForce comes to mind, but its not available yet. This will be a Java-oriented service, so that probably means you'll have to spend a wee bit of time figuring out how to package the app.
For more discussion, there was a debate about this in 2008.
I'm not entirely sure if it's really suitable or not, but people have deployed Scala applications to Google App Engine, for example http://mawson.wordpress.com/2009/04/10/first-steps-with-scala-on-google-app-engine/
Actually you can run scala on heroku right now. You don't believe it?
https://github.com/lstoll/heroku-playframework-scala
I'm not sure the tricks lstoll has used are legit but using the
new cedar platform where you can run custom processes and some
ingenious Gemfile hacking he has managed to bootstrap the Java
play platform into a process. Seems to work as he has a live
site running a test page.
Stax cloud service offers preconfigured lift project skeleton. Also, there is a tutorial on how to deploy lift project to appengine.