J2EE Server Infrastructure with Linux

ballooncadgeInternet και Εφαρμογές Web

31 Οκτ 2013 (πριν από 3 χρόνια και 5 μήνες)

63 εμφανίσεις

J2EE Server Infrastructure
with Linux

VaibhaV Sharma

Ishi Systems Inc.

vsharma@ishisystems.com

J2EE?


Primarily an enterprise computing
technology


Defines a Framework for distributed
computing


Java based


Buzzword compliant


J2EE thrives on the word “abstraction”


Native linux J2SDKEE packages
available from sun.

Enterprise Computing


Enterprise computing involves development,
deployment and maintenance of the
information systems required for survival and
success in today’s business climate
.”

Enterprise Computing


Computers are typically dispersed over a wide area


Legacy applications


Very large databases


Hundreds to thousands/millions of clients


Heterogeneous computers, client devices, networks,
applications


Constantly changing business requirements


Mission critical applications


Requires reliability and performance

J2EE


Container / component architecture

Image taken from java.sun.com

J2EE implementation

Web server

Web server

App Server Cluster

Load balanced web servers

Web Tier

EJB Tier

Database

Web client / Applet

Client Apps

Database

Web Tier

EJB Tier

HTTP(S)

JDBC

Database Cluster

HTTP(S)

JDBC

Other components

The usual bundles
-


Routers


DNS servers


Firewall


Authentication Servers


Mail servers


Web caches


Remote access servers


VPN mechanism

J2EE App Server


Implements the J2EE framework


App server = Web + EJB tiers


App Logic = Presentation + Business


Talks to various auth mechanisms


Handles Database transactions


Clustering

How?


Setup app server machine(s)


Install and setup Databases


Deploy application


Initial deployment can use app
server as the web server


Use a layer of squid proxy servers


Introduce Apache server pool as
load increases


J2EE App Servers on Linux


Free / Open Source


Jboss (OSS/LGPL)


Tomcat (Apache software license)


Resin (free for non
-
commercial use)


Enhydra (LGPL)


JOnAS (LGPL)


Gefion Software LiteWebserver


Commercial


BEA Weblogic


IBM Websphere


Oracle Application Server


Sun One

App servers

OS (Linux)

JVM

(SUN or Jrockit)

WEB

EJB

Application

App Server

instance

Database

External Auth

Legacy App

WEB

EJB

Application

App Server

instance

JVM

(SUN or Jrockit)

J2EE

Image taken from java.sun.com

Jboss / Tomcat


Jboss implements the EJB container


Tomcat handles the web container


Very lightweight


Has an Apache module


J2EE compliant but not certified


Has ports for various *nix flavours


Both Jboss and Tomcat can be clustered


Documentation is not free but not
expensive either ($99 /yr)

Weblogic


One of the most popular J2EE server
implementations


Has a vendor supported port for linux


Supports clustering


Very Heavyweight


Sun Certified


Has a module for apache


Has an inbuilt SNMP agent


RedHat / BEA partnership

Databases


Free / OpenSource


Postgresql


MySQL


SAP DB


Interbase (MPL License)


Commercial


Oracle


IBM DB2 / Informix


Sybase


Type 4 JDBC driver needed for respective Database.

Apache Web server


Caching support


Used with app servers to handle
static content


Modules are available for integration
with various app servers

Weblogic and Apache

Loadmodule weblogic_module libexec/mod_wl.so

# With Clustering

<IfModule mod_weblogic.c>


WebLogicCluster
s1.vsharma.net:7001,s2.vsharma.net:7001,s3.vsharma.net:7001


ErrorPage http://vsharma.net/error.html


MatchExpression *.jsp

</IfModule>


# Without Clustering

<IfModule mod_weblogic.c>


WebLogicHost pompom.vsharma.net


WebLogicPort 7001


MatchExpression *.jsp

</IfModule>

Tomcat and Apache

LoadModule jk_module libexec/mod_jk.so

AddModule mod_jk.c

JkWorkersFile /etc/httpd/conf/workers.properties

JkLogFile /var/log/httpd/mod_jk.log

JkLogLevel info

JkLogStampFormat "[%a %b %d %H:%M:%S %Y] “





JkMount /examples/servlet/* worker1

JkMount /examples/*.jsp worker1


Scalability issues


Design your app strictly J2EE compliant


Finetune the JVM and the kernel


Add as much RAM as your app needs


Faster CPU certainly helps


Load balance web servers


Physically separate Web and EJB tiers


Preferably, isolate clustered machines

Other components

Router

Linux kernel routing

DNS servers

BIND / DJBDNS

Firewall

Iptables / Netfilter

Authentication

PAM, OpenLDAP, Samba

Mail servers

Sendmail / Postfix / Qmail /
Exim

Web caches

Squid / Apache reverse Proxy

Remote access
/ VPN

Pppd based dialin, OpenSSH,
FreeS/WAN or OpenSSH

Monitoring

SNMP
-

MRTG, Cricket

Questions?

Thank You