You are on page 1of 90

JBOSS System Administration Base

Versione 2.0

Ing. Mauro Tedesco

JBOSS System Administration

Capitolo Uno
Sommario capitolo uno
Informazioni generali
Sito Jboss
Sito Enterprise (RedHat)
Jboss download
Jboss RedHat docs
JBoss rilasci
JBoss timeline
Jboss comparazioni, video
Introduzione Jboss EAP 5 e 6
Jboss Enterprise Application Platform
Jboss Enterprise component
Ing. Mauro Tedesco

JBOSS System Administration

Informazioni generali

Questo corso pu essere seguito da chiunque abbia un p di dimestichezza


con:
il Sistema operativo Linux.
Il TCP/IP
Architetture web

Esistono due versioni di Jboss:


la versione community
La versione Enterprise.

Ing. Mauro Tedesco

JBOSS System Administration

Sito JBoss

la versione community

Ing. Mauro Tedesco

JBOSS System Administration

Products vs. Projects

Ing. Mauro Tedesco

Jboss.org

JBOSS System Administration

Products vs. Projects

It's the same like with Fedora vs. RHEL


We have an open source space on www.jboss.org
There we work on the future of the project
There we try new stuff, we implement new standards before they are officially released

During productization we make the projects ready for the enterprise

We make heavy load tests


We are fixing bugs
We make them mature
Shortly: We do everything we can to be able to give support up to 5 years to a product

It is still open source!


You can download the source for the products (like with RHEL)

Ing. Mauro Tedesco

JBOSS System Administration

Products vs. Projects

Ing. Mauro Tedesco

JBOSS System Administration

Products vs. Projects


JBoss Community
Downloads of JBoss Community projects are for individual
developers who want to integrate, maintain and support their
projects themselves.
I am willing to:
Resolve

JBoss Enterprise
Downloads of JBoss Enterprise products are for Enterprise
Developers who are building applications for businesses and
public sector institutions that are planned to go into production
or require tested, integrated software with certified patches and
updates, and/or SLA-based support with a declared
Support Policy from Red Hat.

issues and bugs during development without any SLA.

Perform
Rely

I require:

integration and compatibility testing myself.

on the community for answers to questions.

Identify

and resolve security issues on my own.

Support

the software in production on my own without any SLA.

Subject

my application to a porting process before it can go into


production.

Enterprise quality

support during development and/or


production with guaranteed SLAs.

Pre-integrated

and tested software that's certified multiple


JVMs and Operating Systems.

Continuous

updates and patches to resolve security,


performance, and stability issues.

Notifications about

security issues and advice on how to


resolve them.

Training and consulting

services to help deliver solutions ontime and on-budget.

Ing. Mauro Tedesco

JBOSS System Administration

Sito Enterprise (RedHat)

La versione Enterprise RedHat.

Ing. Mauro Tedesco

JBOSS System Administration

Jboss download

La versione Enterprise RedHat.

Ing. Mauro Tedesco

JBOSS System Administration

Jboss RedHat docs

La versione Enterprise RedHat docs

Ing. Mauro Tedesco

JBOSS System Administration

JBoss rilasci

Le versioni e come si alternano

Ing. Mauro Tedesco

JBOSS System Administration

JBoss timeline

Le

Ing. Mauro Tedesco

JBOSS System Administration

Jboss comparazioni

La versione Enterprise RedHat e la versione community

Ing. Mauro Tedesco

JBOSS System Administration

Jboss comparazioni video

La versione Enterprise RedHat e la versione community video

/home/mtedesco/personale_asus/corsi_docenze/Jboss/extra/jboss-community-v-enterprise.ogg

Ing. Mauro Tedesco

JBOSS System Administration

Introduzione Jboss 5

JBoss Enterprise Application Platform 5 costruito intorno al nuovo


JBoss Microcontainer.

Jboss Microcontainer un contenitore leggero che supporta il


deployment diretto, la configurazione e la gestione del ciclo di vita di
Plain Old Java Objects (POJO).

Il progetto JBoss Microcontainer standalone e sostituisce la versione


JBoss Microkernel JMX utilizzato nelle versioni 4.x della piattaforma
JBoss Enterprise Application.

Ing. Mauro Tedesco

JBOSS System Administration

Introduzione a Jboss 5 - segue


Il nuovo Microcontainer JBoss si integra perfettamente con il framework
JBoss Aspect Oriented Programming (JBoss AOP).

Il supporto JBoss AOP JMX in Jboss Enterprise Application Platform 5


rimane supportato e i servizi scritti con il vecchio Microkernel continuano a
lavorare.

Molte caratteristiche di JBoss Enterprise Application Platform 5 sono


forniti integrando progetti standalone:

JBoss EJB3

JBoss Messaging

JBoss Cache

JBoss Web

Ecc...

Ing. Mauro Tedesco

JBOSS System Administration

Introduzione Jboss 6

JBoss Enterprise Application Platform 6 costruito intorno a jboss


community 7

Jboss Microcontainer un contenitore leggero che supporta il


deployment diretto, la configurazione e la gestione del ciclo di vita di
Plain Old Java Objects (POJO).

La gestione dello start dell'EAP pi veloce

Ing. Mauro Tedesco

JBOSS System Administration

Introduzione a Jboss 6 - segue

Tutto si f da console

La gestione del server da command line si f utilizzando lo script

<JBOSS_HOME>/bin/jboss-cli.sh

Esempio

Shutdown
<JBOSS_HOME>/bin/jboss-cli.sh --connect --command=:shutdown

Ing. Mauro Tedesco

JBOSS System Administration

Jboss Enterprise Application


Platform

Il 99% delle applicazioni web che coinvolgono un database.

Le applicazioni mission-critical web che possono essere raggruppati.

Le applicazioni web semplici con JSP/Servlet.

Le applicazioni web di media difficolt JSP/Servlet utilizzando un


framework.

Le applicazioni web complesse con JSP/Servlet

Cross applicazione middleware (JMS, Corba, JMX, ecc).

Ing. Mauro Tedesco

JBOSS System Administration

Jboss Enterprise component


JBoss Web Framework_Kit

JBoss Enterprise Web Server

JBoss Developer Studio

JBoss Enterprise Portal Platform

JBoss Enterprise Application Platform

JBoss Communications Platform

JBoss Operations Network

JBoss Enterprise BRMS Platform

JBoss Enterprise SOA Platform

JBoss Enterprise Data Services

JBoss Enterprise Web Platform

Ing. Mauro Tedesco

JBOSS System Administration

Jboss Enterprise component

Ing. Mauro Tedesco

JBOSS System Administration

Jboss Enterprise Application


Platform Architecture

Ing. Mauro Tedesco

JBOSS System Administration

Jboss Enterprise Application


Platform Component

Ing. Mauro Tedesco

JBOSS System Administration

Jboss Application Server 7


Platform Component

Ing. Mauro Tedesco

JBOSS System Administration

Jboss Application Server 7


architecture Component

Ing. Mauro Tedesco

JBOSS System Administration

Capitolo Due
Sommario capitolo due
Jboss Enterprise Application Platform directory
JBoss E A P Installazione
JBoss E A P Installazione-Prerequisiti
JBoss E A P Installazione-configurazone
JBoss E A P Installazione start
JBoss E A P Installazione stop
JBoss E A P start options
JBoss E A P start options

Ing. Mauro Tedesco

JBOSS System Administration

Jboss Enterprise Application Platform 5


directory

Ing. Mauro Tedesco

JBOSS System Administration

Jboss Enterprise Application


Platform 6 directory-segue

Ing. Mauro Tedesco

JBOSS System Administration

Jboss Enterprise Application


Platform 5 directory-segue

Ing. Mauro Tedesco

JBOSS System Administration

Jboss Enterprise Application


Platform 5 directory-segue

Ing. Mauro Tedesco

JBOSS System Administration

Jboss Enterprise Application


Platform 6 directory-segue

Ing. Mauro Tedesco

JBOSS System Administration

JBoss E A P Installazione

Prerequisiti

Configurazione

Diversi metodi di installazione

Rpm

Zip

Rhn

GUI

Ing. Mauro Tedesco

JBOSS System Administration

JBoss E A P Installazione-Prerequisiti

Prerequisiti

Ing. Mauro Tedesco

JBOSS System Administration

JBoss E A P 5 Installazione-configurazone

Changing Memory Settings for the Enterprise Application Platform on


Linux

1. Navigate to JBOSS_DIST/jboss/bin.

2 Using a text editor, open run.conf.

3 modify the memory options.

JAVA_OPTS="-XmsINITIAL_HEAP_SIZEm -XmxMAX_HEAP_SIZEm -XX:MaxPermSize=256m


-Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000
-Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.lang.ClassLoader.allowArraySyntax=true"

Ing. Mauro Tedesco

JBOSS System Administration

JBoss E A P 6 Installazione-configurazone

Changing Memory Settings for the Enterprise Application Platform on


Linux

1. Navigate to JBOSS_DIST/jboss/bin.

2.1 Using a text editor, open standalone.conf.

2.2 Using a text editor, open domain.conf

3 modify the memory options.

JAVA_OPTS="-XmsINITIAL_HEAP_SIZEm -XmxMAX_HEAP_SIZEm -XX:MaxPermSize=256m


-Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000
-Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.lang.ClassLoader.allowArraySyntax=true"

Ing. Mauro Tedesco

JBOSS System Administration

JBoss E A P Installazione - start

Start del server

Lanciare lo script che si trova nella directory jboss-as/bin :

Linux

$ ./run.sh ---- c' scritto di lanciare lo script relativo

$ ./standalone.sh

$ ./domain.sh

Windows

run.bat

Ing. Mauro Tedesco

JBOSS System Administration

JBoss E A P 5 Installazione - start

Start del server

Img dei comandi

Ing. Mauro Tedesco

JBOSS System Administration

JBoss E A P 6 Installazione - start

Start del server

Img dei comandi

Ing. Mauro Tedesco

JBOSS System Administration

JBoss E A P Installazione - stop


Stop del server
Lanciare lo script che si trova nella directory jboss-as/bin :
Linux
./shutdown.sh -S --- versione 5
Stopping the Server
------------------The JBoss AS7 server can be stopped by pressing Ctrl-C on the
command line.
If the server is running in a background process, the server can be
stopped
using the JBoss CLI:

<JBOSS_HOME>/bin/jboss-cli.sh --connect --command=:shutdown

Ing. Mauro Tedesco

JBOSS System Administration

JBoss E A P 5 Installazione - stop

Stop del server

Img dei comandi di stop

Ing. Mauro Tedesco

JBOSS System Administration

JBoss E A P 6 Installazione - stop

Stop del server

Img dei comandi di stop

Ing. Mauro Tedesco

JBOSS System Administration

JBoss E A P 5 start options

Start del server con opzioni

Lanciare lo script che si trova nella directory jboss-as/bin :

Linux

$ ./run.sh -c minimal

$ ./run.sh -b 0.0.0.0

$ ./run.sh -h

Ing. Mauro Tedesco

JBOSS System Administration

JBoss E A P 5 start options

Start del server con opzioni


img con i comandi di options

Ing. Mauro Tedesco

JBOSS System Administration

JBoss E A P 5 start -h

Opzioni di start

usage: run.sh [options]

-h, --help Show help message

-V, --version Show version information

-d, --bootdir=<dir> Set the boot patch directory; Must be absolute or url

-p, --patchdir=<dir> Set the patch directory; Must be absolute or url

-c, --configuration=<name> Set the server configuration name

-B, --bootlib=<filename> Add an extra library to the front bootclasspath

-L, --library=<filename> Add an extra library to the loaders classpath

-C, --classpath=<url> Add an extra url to the loaders classpath

-P, --properties=<url> Load system properties from the given url

-b, --host=<host or ip> Bind address for all JBoss services.

-g, --partition=<name> HA Partition name (default=DefaultDomain)

-m, --mcast_port=<ip> UDP multicast port; only used by JGroups

Ing. Mauro Tedesco

JBOSS System Administration

JBoss E A P start -h

Opzioni di start

Img con immagine di start -h

Ing. Mauro Tedesco

JBOSS System Administration

JBoss E A P 6 cli

Opzioni

Ing. Mauro Tedesco

JBOSS System Administration

Capitolo Tre

Sommario capitolo tre


Jboss Jboss Enterprise Application Platform standalone
JBoss Application Platform community standalone
JBoss cosa non si deve fare
Network
Java e Javac
Jboss (esercizio)
Jboss (esercizio Video)
Jboss interfaccia web
Jboss interfaccia web -- Administration

Ing. Mauro Tedesco

JBOSS System Administration

Jboss Enterprise Application Platform


standalone

script:

/etc/init.d/jbossas (viene lanciato automaticamente allo start del server )

Il profilo usato dal servizio configurato in

/etc/sysconfig/jbossas.

Modifica del profilo di "default"

change "JBOSSCONF="

Se la linea inizia con il carattere # significa che commentata.

Rimuovere il carattere per avere effetto

Ing. Mauro Tedesco

JBOSS System Administration

Jboss Enterprise Application Platform


standalone

script:
img dei comandi utilizzati

Ing. Mauro Tedesco

JBOSS System Administration

JBoss Application Platform


community standalone

Script
Copiare il file $JBOSS_DIST/jboss/bin/init* in /etc/init.d/jbossas

# chkconfig add jbossas

# chkconfig jbossas on

/etc/init.d/jbossas (viene lanciato automaticamente allo start del server )

Il profilo usato dal servizio pu essere configurato in

/etc/sysconfig/jbossas.

Modifica del profilo di "default"

change "JBOSSCONF="

Ing. Mauro Tedesco

JBOSS System Administration

JBoss Application Platform


community standalone

Script

Img dei comandi utilizzati

Ing. Mauro Tedesco

JBOSS System Administration

JBoss Application Platform


installazione -- riepilogo

Script

Img dei comandi utilizzati

Ing. Mauro Tedesco

JBOSS System Administration

JBoss cosa non si deve fare

Jboss non si lancia mai da root

Non si editano i file di log da root

Non si modifica il nome macchina a run-time

Non si modifica il nome macchina dopo l'installazione del server

Non si configura un firewall senza tenere conto di tutte le porte di

comunicazione dei servizi di Jboss

Non si cancella la cache a run-time

Non si killano i processi java manualemte

Ing. Mauro Tedesco

JBOSS System Administration

Network EAP 5

Network
By default, the Enterprise Platform binds to all networking addresses
at start-up.
Community 127.0.0.1
You can specify a bind address, as well as a UDP address, at start-up.
If not specified, only TCP is used.

-b [IP-ADDRESS] TCP

-u [IP-ADDRESS] UDP

-m UDP multicast address. Optional.

Enterprise Application Platform 5 does not include support for IPv6,


although this support is planned for the future.

Ing. Mauro Tedesco

JBOSS System Administration

Network EAP 6

Network

By default, the Enterprise Platform binds to 127.0.0.1

By default, the community binds to 127.0.0.1


You can specify a bind address, as well as a UDP address in
configuration file

File standalone.xml in standalone/configuration

File domain.xml in domain/configuration

Ing. Mauro Tedesco

JBOSS System Administration

Java e Javac

Java

Ing. Mauro Tedesco

JBOSS System Administration

Jboss (esercizio)

JBoss

yum info java

yum provides java

yum install java-1.6.0-openjdk-1.6.0.0-1.23.1.9.10.el5_7

java -version

echo $JAVA_HOME

vi /etc/profile.d/java.sh

Ing. Mauro Tedesco

JBOSS System Administration

Jboss esercizio cont.


JBoss

mkdir /opt/java

unzip /root/jboss-5.1.0.GA-jdk6.zip -d /opt/java/

mv jboss-5.1.0.GA jboss

vi /etc/profile.d/jboss.sh

adduser jboss

chown -Rf jboss.jboss /opt/java/jboss/

su jboss

ps -ef

netstat -na |more

Ing. Mauro Tedesco

JBOSS System Administration

Jboss esercizio cont.


ps -ef

netstat -na |more


Img dei comandi

Ing. Mauro Tedesco

JBOSS System Administration

Jboss (esercizio -- Video)

JBoss

Video installazione

Ing. Mauro Tedesco

JBOSS System Administration

JBoss EAP 6 (AS7) All change

Ing. Mauro Tedesco

JBOSS System Administration

All Change

Major rewrite of the application server

Much bigger change than JBoss 4 to 5

Key features

Module based services


Modular Service Container
Domain mode and Standalone mode
Everything has changed

Ing. Mauro Tedesco

JBOSS System Administration

Focus on configuration

Make JBoss a solid


platform for enterprise
deployment of server
side java applications

Deployment and
management across
multiple servers

Focus on providing
enterprise-scale
features

Ing. Mauro Tedesco

JBOSS System Administration

Directory Structure

bin

docs

Modules used by/available to the server

domain

Documentation, schemas, examples etc

modules

Scripts for starting and stopping JBoss

Files for running in domain mode

standalone

Files for running in stand alone mode

Ing. Mauro Tedesco

JBOSS System Administration

Modules

Pluggable components of the application server

Referenced from profiles


module.xml

Basis of classloading in JBoss 6 EAP (AS 7)

Ing. Mauro Tedesco

JBOSS System Administration

Standalone vs Domain

Standalone mode

Each JBoss server has


its own configuration
Single JVM process

Domain mode

Central configuration
for multiple servers
Central control of
multiple servers

Ing. Mauro Tedesco

JBOSS System Administration

Standalone mode

Ing. Mauro Tedesco

JBOSS System Administration

Standalone mode

Similar to the old JBoss approach

Centralised configuration

Independent servers
Based on profiles
configuration/standalone.xml

Domain mode processes collapsed into a single


JVM

Ing. Mauro Tedesco

JBOSS System Administration

Single configuration

All configuration is now centralised in the


standalone.xml file

No sar archives with jboss-service.xml


No *-ds.xml files
No JMS destinations-service.xml files
No tomcat server.xml

One-stop-shop for configuring your server

Ing. Mauro Tedesco

JBOSS System Administration

Standalone.xml
<subsystem xmlns="urn:jboss:domain:threads:1.0">
<scheduled-thread-pool name="remoting">
<max-threads count="10" per-cpu="20"/>
<keepalive-time time="10" unit="seconds"/>
</scheduled-thread-pool>
<bounded-queue-thread-pool name="jca-short-running" blocking="true">
<core-threads count="10" per-cpu="20"/>
<queue-length count="10" per-cpu="20"/>
<max-threads count="10" per-cpu="20"/>
<keepalive-time time="10" unit="seconds"/>
</bounded-queue-thread-pool>
<bounded-queue-thread-pool name="jca-long-running" blocking="true">
<core-threads count="10" per-cpu="20"/>
<queue-length count="10" per-cpu="20"/>
<max-threads count="10" per-cpu="20"/>
<keepalive-time time="10" unit="seconds"/>
</bounded-queue-thread-pool>
Ing. Mauro Tedesco

JBOSS System Administration

Datasources in standalone.xml
<subsystem xmlns="urn:jboss:domain:datasources:1.0">
<datasources>
<datasource jndi-name="java:/H2DS" enabled="true" use-java-context="true" pool-name="H2DS">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
<driver-class>org.h2.Driver</driver-class>
<driver>org.h2.Driver#1.2</driver>
<pool></pool>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
<validation></validation>
<timeout></timeout>
<statement></statement>
</datasource>
</datasources>
<drivers>
<driver module="com.h2database.h2"/>
</drivers>
</subsystem>
Ing. Mauro Tedesco

JBOSS System Administration

Deploying to standalone

Drop the application


into
standalone/deploymen
ts

Deployment scanner
runs periodically

Ing. Mauro Tedesco

JBOSS System Administration

Domain mode

Ing. Mauro Tedesco

JBOSS System Administration

Domain mode

Multiple servers controlled centrally


Multiple processes/JVMs per instance

Domain controller
Process controller
Server

Domain can define multiple profiles

Different servers can run different profiles

Ing. Mauro Tedesco

JBOSS System Administration

Domain mode processes

Ing. Mauro Tedesco

JBOSS System Administration

Host controller

Process responsible for controlling the lifecycle of


servers
At most one host controller in a domain is the
domain controller

Responsible for performing configuration and


administration operations

Ing. Mauro Tedesco

JBOSS System Administration

Process Controller

Lightweight process responsible for starting and


stopping other processes

Keep the parent process of a server very lightweight

Ing. Mauro Tedesco

JBOSS System Administration

Deploying to domain mode

Via the command line


interface

[domain@localhost:9999 /]
deploy
../../../../testsuite/smoke/target/deployme
nts/test-deployment.sar --all-servergroups 'test-deployment.sar' deployed
successfully.

Ing. Mauro Tedesco

JBOSS System Administration

Command line interface

Ing. Mauro Tedesco

JBOSS System Administration

Command line interface

Connects to the domain controller process


Execute operations on the domain controller
The format for the operation requests is

[node-type=node-name (,node-type=node-name)*] :
operation-name [( [parameter-name=parameter-value
(,parameter-name=parameter-value)*] )]

Ing. Mauro Tedesco

JBOSS System Administration

Jboss EAP 5 interfaccia web

Console

IMG di http://localhost:8080

Ing. Mauro Tedesco

JBOSS System Administration

Jboss EAP 6 interfaccia web

Console

IMG di http://localhost:8080

Ing. Mauro Tedesco

JBOSS System Administration

Jboss EAP 5 interfaccia web -Administration

Console

IMG di http://localhost:8080

Ing. Mauro Tedesco

JBOSS System Administration

Jboss AS 7 (EAP 6) interfaccia web -Administration

Console

IMG di http://localhost:9990

Ing. Mauro Tedesco

JBOSS System Administration

Aggiungere un utente
The management interfaces in JBoss Enterprise Application Platform 6
are secured by default

No default user. This is a security precaution, to prevent security


breaches from remote systems due to simple configuration errors.

Ing. Mauro Tedesco

JBOSS System Administration

Jboss EAP 6 procedura per


aggiungere un utente
1. Invoke the add-user.sh or add-user.bat script.

Change to the EAP_HOME/bin/ directory. Invoke the appropriate


script for your operating system.

[user@host bin]$ ./add-user.sh

2 Choose to add a Management user.

Select option a to add a Management user. This user is added to the


ManagementRealm and is authorized to perform management
operations using the web-based Management Console or commandline based Management CLI.

The other choice, b, adds a user to the ApplicationRealm, and


provides no particular permissions. That realm is provided for use
with applications.

3. Choose the realm for the user.

4. Enter the desired username and password.

Ing. Mauro Tedesco

JBOSS System Administration

Jboss EAP 6 procedura per


aggiungere un utente --2
1. Invoke the add-user.sh or add-user.bat script.

Change to the EAP_HOME/bin/ directory. Invoke the appropriate


script for your operating system.

[user@host bin]$ ./add-user.sh

2 Choose to add a application user.

Select option b to add a Applicationt user. That realm is provided for


use with applications.

3. Choose the realm for the user.

4. Enter the desired username and password.

Ing. Mauro Tedesco

JBOSS System Administration

Bibliografia

Http://www.jboss.org

Http://www.jboss.com

http://www.redhat.com

Ing. Mauro Tedesco

JBOSS System Administration

JBOSS System Administration


Base

Ing.
Ing.Mauro
MauroTedesco
Tedesco

Ing. Mauro Tedesco

JBOSS System Administration

You might also like