I am working at a startup, we are just about to roll out our first beta. Knowing that we will be having a good number of users, we want to have seamlessly deployment when we are adding new features.
I have worked with windows azure before, and I know they support seamless deployment, so I did some googling and cloudbees was the first result.
So the question is, with what we have now (geronimo server, rackspace hosting), is it possible to seamlessly redeploy a java web application? If so, how?
Are there other alternative solution, such as using another hosting provider or use a different web server? (Because it is a startup, it would be beneficial if the answer keeps scalability in mind)
If with a seamless redeploy, you mean an upgrade of your application without any downtime or restarting of your server, LiveRebel might be something to look at.
See http://zeroturnaround.com/liverebel
There are a lot of methods for doing this in the java world. If you don't use sessions (or use shared sessions between app servers) you can do a rolling stop/deploy/start of your appservers, taking 1 offline at a time and using a load balancer to ensure that traffic goes to the other servers.
I have heard Glassfish has such feature, the reference probably ment this (Glassfish 3.x redeploy command) : http://docs.oracle.com/cd/E19798-01/821-1758/6nmnj7q1h/index.html
Related
I have coded a Jersey based java server which is all wrapped in one excecutable jar.
I am looking for a web host service in which i can deploy the jar and run it.
I saw some dedicated servers which can do this but this is overshooting the need, any suggestions?
As per your comment I understand that you created a web application with a Jetty embedded server.
I think the best solution for you in this case is to get a virtual machine host, install JRE, upload your *.jar and run it from there. Given firewall permissions and correct configuration you should be able to receive requests on the 80 port. Cons? It costs. A lot.
Most of the Java hosts have already a servlet container running (almost always Tomcat) and you can only deploy your web application in it. Having an embedded Jetty server messes up everything for you.
I strongly suggest you to detach your web application (or as you called it REST server) from Jetty and deploy the *.war in any of the multiple free Java hosts to test it online.
EDIT
Thanks to you I made a deeper research on the topic and found an interesting guide to deploy a web application with embedded Jetty server in Heroku. I've never tried it nor I know if its free, but maybe you can give a try.
Digital Ocean work pretty well for me. Their basic packages are really cheap and you get root control over your own machine, meaning you can host whatever you want without restrictions. The only downside is that they are pretty old school - you have to set up EVERYTHING yourself, including firewalls etc. There are a lot of guides available on their website though, which makes life a lot easier!
http://www.digitalocean.com
I know this is a touch redundant but I don't have voting or comment rights yet so this is the only method for me to communicate.
Digital Ocean is a solid choice. I am paying 5$ a month for a VM with 512 Mb Ram and 20 gigs of storage (which for my use is just fine.) I am still working on my first proper deploy but as stated above there are tons of tutorials to guide you through it. I have no prior command line experience but I've managed to get the server running, Created an SSH key, uploaded my landing page and have gotten a test project using Spark as the embedded server up and functional in a matter of a few hours. The Droplets are easily scalable from what I've seen. I'm still having trouble deploying an Rest based app with Postgres as the DB but it seems more to do with the ports in play than anything else. Keep getting 404s.
Hey guys I am trying to display a maintenance message on my web page while I wanna deploy an updated war, so the original war must go offline first and at the same time, client will get 404 not found error page...My question is, what is the most common way for website maintenance? Thanks!
PS: I am not specifying which server is being used, so it could be tomcat, jboss, websphere and etc.
Ideally, you'll want some kind of hot-deployment support so that your users won't ever notice a service interruption. Common methods of achieving this are:
Having multiple instances of the web application behind some kind of load balancer which directs incoming requests to a running instance. If you'd perform a deployment, you wouldn't take all instances offline at once, but sequentially take one instance offline, redeploy, restart, and repeat this sequentially for all other instances.
Code-based hot-swapping while the software is running. The Oracle's JVM has limited support for this (HowSwap). A popular commercial tool which enables redeployments (using more sophisticated mechanisms than HotSwap) of Java web apps is LiveRebel.
I have just became a partner of a company that has a site developed in JAVA. As part of the agreement they allow me to create a section on their site (so I can take benefit of their traffic), but the development of this section needs to be as less intrusive as possible.
So ideally I would like to implement an independant web application in JAVA (with same layout) with a separate database that runs in the same application server. And in the application server to make a mapping like this:
All the traffic that comes to www.domain.com/MY_FOLDER
its served by my web application, all the rest should be served by my partners site.
I have no experience in JAVA but I found that in php this can be done, so I was wondering if it can be done also in JAVA.
About the application server I dont know yet which one they are using but I guess that are using "resing server" (by caucho: http://www.caucho.com/).
I would really appreciate if you can give me any ideas of how I can achieve this.
Thanks in advance,
Juan
Only one application can listen at a given socket at one time, so you need to have the existing server forward "your" requests to your web application, if it is not Java capable in itself.
The way to do that is not standardized so you will have to talk to the server administrator.
The easiest way to start from scratch with a Java Web Application is in the Netbeans bundle with Glassfish.
So we have a busy legacy web service that needs to be replaced by a new one. The legacy web service was deployed using a WAR file on an apache tomcat server. That is it was copied over into the web apps folder under tomcat and all went well. I have been delegated with the task to replace it and would like to do it ensuring
I have a back up of the old service
the service gets replaced by another WAR file with no down time
Again I know I am being overly cautious however it is production level and I would like everything to go smooth. Step by step instructions would help.
Make a test server
Read tutorials and play around with the test server until it goes smoothly
Replicate what you did on the test server on the prod server.
If this really is a "busy prod server" with "no down time", then you will have some kind of test server that you can get the configuration right on.
... with no down time
If you literally mean zero downtime, then you will need to replicate your webserver and implement some kind of front-end that can transparently switch request streams to different servers. You will also need to deal with session migration.
If you mean with minimal downtime, then most web containers support hot redeployment of webapps. However, this typically entails an automatic shutdown and restart of the webapp, which may take seconds or minutes, depending on the webapp. Furthermore there is a risk of significant memory leakage; e.g. of permgen space.
The fallback is a complete shutdown / restart of the web container.
And it goes without saying that you need:
A test server that replicates your production environment.
A rigorous procedure for checking that deployments to your test environment result in a fully functioning system.
A preplanned, tested and hopefully bomb-proof procedure for rolling back your production system in the event of a failed deployment.
All of this (especially rollback) gets a lot more complicated when you system includes other stuff apart from the webapp; e.g. databases.
web application update best practice..
normally how you folk do web application update from large critical system? do u forward user to page stating upgrading in progress on another web server; quickly deploy new war and point back ?
can provide some guides..
If possible, run two tomcat servers, with an Apache web server in front, load balancing the requests between the two.
When it comes time to upgrade, tell Apache to use only Tomcat A, then upgrade Tomcat B, tell Apache to use Tomcat B, upgrade Tomcat A, then back to using both.
No major interruption of service, if you do it right, although without session replication you're going to get some intra-session disruption. It's not as easy as it sounds, though.
As always, the lengths to which you go to minimise disruption depends on how important that disruption is. You can always make it smoother, at more expense and effort.