Can embedded tomcat or any such embedded server be used for microservices in production environment? How, embedded server is different wrt the normal standalone full fledged server (performance . reliability wise)? Is the embedded server light weight compared to standalone? What are the features that embeded servers do not have compared to their standalone ones? Can we change the default security settings, tls ciphers etc advanced things in embedded tomcat?
Well, it's a matter of choice. I've seen some services which use embedded tomcat in production and some services which rely on standalone tomcat container which is directly provided by the platform. Some platforms might not have a java runtime, in such scenarios you're bound to use embedded containers for tomcat or jetty.
The key difference would be that standalone containers can host multiple java deployments whereas for single deployments you can stick to the embedded ones. And yeah reliability and performance won't be a huge concern, although I believe that standalone containers are designed to be more scalable. From my personal experience, embedded deployments are easier to manage, since we can custom configure the tomcat setting specific to that deployment (might be the answer to your last question)
Related
I am new to clustering on Weblogic and read this tutorial. Now I want to know that is that possible to cluster any java application on Weblogic? in that tutorial is discussed about Ejb-based applications. My application has no framework and is just simple JavaEE application and I want to cluster it on weblogic.
Yes, you can.
This is simply replicate your app into multiple servers and a load balancer on top of these will distribute the requests among them.
You have to only check your resource (server, database etc.) support it and there is no multithreading / concurrency issue with your code.
Cluster:
A logical grouping of one or more functionally identical application server processes. A cluster provides ease of deployment, configuration, workload balancing, and fallback redundancy. A cluster is a collection of servers working together as a single system to ensure that mission-critical applications and resources remain available to clients.
Clusters provide scalability. For more information, refer to additional documentation that customer support may provide that describes vertical and horizontal clustering in the WebSphere Application Server distributed environment.
Above is the explanation for WebSphere cluster. In WebSphere world, a cell can have one or many clusters. I want to know in which case one application should be deployed in more than one cluster in WebSphere?
You cannot deploy exactly the same application to more than one cluster, if you need more processing power you just add members to the cluster.
One of the few reasons that comes to my mind to deploy to second cluster, could be to use different application version - check this post for more details and restrictions of deploying multiple versions of the same application.
I'm starting an JBoss to use on the development, and I'm using it as standalone.
I read that on the production environment the JBoss should be as a domain.
I searched for that to understand what's the difference between than. But I didn't found any document well explained.
That's not really correct. Standalone is fine for production. It's commonly used in production, especially when you only need one instance of the server.
Domain is used when you run several instances of JBoss AS and you want a single point where you can control configuration from. You can read more about it in the documentation.
Update
The link has been changed to the latest version of WildFly as the JBoss AS 7 documentation has been archived, but is still available at https://docs.jboss.org/author/display/AS71/Admin%20Guide.html#8094211_AdminGuide-StandaloneServer
Standalone mode
each JBoss server has its own configuration
single JVM process
Domain mode
central control of multiple servers
central configuration for multiple servers
It's important to understand that the choice between a managed domain and standalone servers is all about how your servers are managed, not what capabilities they have to service end user requests. This distinction is particularly important when it comes to high availability clusters.
So, given all that:
A single server installation gains nothing from running in a managed domain, so running a standalone server is a better choice.
For multi-server production environments, the choice of running a managed domain versus standalone servers comes down to whether the user wants to use the centralized management capabilities a managed domain provides.
Running a standalone server is better suited for most development scenarios. Any individual server configuration that can be achieved in a managed domain can also be achieved in a standalone server, so even if the application being developed will eventually run in production on a managed domain installation, much (probably most) development can be done using a standalone server.
For the Above explanation and more follow this link
I am trying to understand the difference between a full fledged application server (e.g. Weblogic, JBoss etc.) and a servlet container (Tomcat, Jetty etc.).
How do they differ and when to use which?
Thanks,
A servlet-container supports only the servlet API (including JSP, JSTL).
An application server supports the whole JavaEE - EJB, JMS, CDI, JTA, the servlet API (including JSP, JSTL), etc.
It is possible to run most of the JavaEE technologies on a servlet-container, but you have to install a standalone implementation of the particular technology.
Broadly speaking, a servlet container restricts itself more or less to the implementation of the J2EE Servlet specification. Also, it's focus is on the runtime environment and not so much on providing additional tools.
In contrast, a full fledged application server implements the whole J2EE stack; plus it comes with all the enterprisey tools and integration possibilities. An application server usually has advanced administration interfaces, it supports clustering and other features used mostly in high-end systems development.
For a beginner, it's probably better to stay with a simple servlet container, since the learning curve there is much less steep.
Edit
#Apache Fan: It depends on the specifics of your situation like existing systems and future plans among other things. I don't think a generic flowchart approach is applicable here.
Platform selection is usually done by weighing specific requirements against first-hand knowledge of systems under consideration.
However the question gives no clues as to what the evaluation criteria are. Should it be open source? Is around-the-clock vendor support necessary? What kind of an enterprise environment should the system integrate with? Are licencing fees an issue? Any must-have technologies or tools? Etc.
Without knowing the above it's pretty much shooting in the dark.
Basically an application server in Java EE context is a software installed on a server and that implements one Java EE specification (Java EE 7 for example). That means such software (application server) must be able to run Java EE application.
Java EE defines 4 domains, the so called containers:
Applet container,
Application client container,
Web container, and
EJB container.
Two containers are part of the application server (EJB and Web container) and two others are part of the client-computer.
JBoss and Weblogic are application servers, Tomcat and Jetty are web container. That's why JBoss and Weblogic can deal with more technologies than a Web container. Application server can manage EJB.
Servlet container is not the appropriate expression to qualified Tomcat and Jetty because it is more restrictive. Tomcat can also execute JSP and JSF, not only Servlets.
afaik, websphere and jboss are fully compliant j2ee-server that can run beyond servlets, like EJB, whereas Tomcat is just a servlet container and you can't run EJBs on it.
In Layman terms :
A web Server means: Handling HTTP requests (usually from browsers).
A Servlet Container (e.g. Tomcat) means: It can handle servlets & JSP.
An Application Server (e.g. GlassFish) means: *It can manage Java EE applications (usually both servlet/JSP and EJBs).
For a beginner, it's probably better to stay with a simple servlet container.
I have just ordered a VPS from my provider.
I have some Q however...
My website uses Solr, which requires the following according to their website:
"Solr requires Java 1.5 and an Application server (such as Tomcat) which supports the Servlet 2.4 standard"
I also need php 5, MySql, and the usual javascript etc...
The OS is Ubuntu 9.10
1- So what do I need to install then?
2- What is a servlet container?
3- The solr I have downloaded came with Jetty. Is Jetty a Servlet container?
Thanks
3- The solr I have downloaded came
with Jetty. Is Jetty a Servlet
container?
Yes, Jetty is a Web server and Servlet container. A servlet container is a web server that interacts with servlets, and you need one of those to host your servlets, execute them, etc.
An application server typically hosts many other facilities, such as security, authentication, Java Mail, EJB container, and many others.
PHP: Hypertext Preprocessor is a widely used, general-purpose scripting language that was originally designed for web development to produce dynamic web pages.
PHP 5 included new features such as improved support for object-oriented programming, the PHP Data Objects extension (which defines a lightweight and consistent interface for accessing databases), and numerous performance enhancements.
Servlets are Java programming language objects that dynamically process requests and construct responses. Jetty is the simplest/smallest servlet container that could be run easily in a cross platform way. That does not imply that Solr runs better under Jetty, or that Jetty is only good enough for demos, it's just that Jetty makes demo setup easier.
Users should decide for themselves which Servlet Container they consider the easiest/best for their use cases based on their needs/experience. For high traffic scenarios, investing time for tuning the servlet container can often make a big difference.
A Servlet container is basically a web server for Java Servlets and JSP pages.
Tomcast and Jetty are both Servlet containers.
In the phrase you quoted, it is using the phrase "Application server" interchangeably with "Servlet container". While Solr may only require a Servlet container, it shouldn't use the terms interchangeably.
The Servlet container is only part of a J2EE application server. Some other application servers (that also include Servlet containers) are JBoss and Apache Geronimo; Geronimo uses either Tomcat or Jetty depending on which set you install.
If you also need PHP, a Servlet Container won't be enough... you'll also need a normal webserver.
Installing the libapache2-mod-php5 module from the Ubuntu repository should install both PHP5 and Apache 2.2 for you. To install MySQL, install the mysql-server and php5-mysql packages.
Assuming you only have command-line access, installing packages on Ubuntu is done using the aptitude or apt-get programs; aptitude is preferred.
Before you install new programs, you should always run aptitude update, which updates the local index of which programs are available. Afterwards, you can upgrade existing packages with aptitude safe-upgrade and install new packages with aptitude install <packagename> (without the <>)
Ubuntu is usually pretty good about keeping the available package list up to date, and will periodically tell you on login that some packages have available upgrades. Since upgrades are almost always security updates, it is a good idea to check for them.
I also need php 5, MySql, and the usual javascript etc... The OS is Ubuntu 9.10
1- So what do I need to install then?
Use Apache HTTPD server for PHP, use Apache Tomcat for JSP/Servlet, use mod_jk to let HTTPD play proxy for Tomcat so that you can run PHP and JSP at one same site.
Since JavaScript is a client side language, you don't need to worry about it at the server side.
2- What is a servlet container?
A webserver with a JSP/Servlet API implementation. An application server is usually more than that. JSP/Servlet is only a little part of the huge Java EE API. A fullfledged application server implements pretty much all of Java EE API.
3- The solr I have downloaded came with Jetty. Is Jetty a Servlet container?
Yes, it is. It however doesn't support PHP. You need Apache HTTPD for PHP. However I am not aware of ways to connect Jetty with HTTPD.