Mais conteúdo relacionado Semelhante a JBoss AS7 by Matt Brasier (20) JBoss AS7 by Matt Brasier1. JBoss AS 7
Its JBoss, but not as we know it
© C2B2 Consulting Limited 2011
All Rights Reserved
2. Agenda
• Introduction
• About Me
• JBoss 7 – All change
• Standalone mode
• Domain mode
• Command line interface
© C2B2 Consulting Limited 2011
All Rights Reserved
3. Who am I?
• Matt Brasier
• Head of Consulting at C2B2
• 7 years experience in middleware
consulting
– 5 years using JBoss
© C2B2 Consulting Limited 2011
All Rights Reserved
4. C2B2
• Middleware services specialists
– Consulting
– Troubleshooting
– Performance tuning
– Managed services
– Training
• In the UK and beyond
© C2B2 Consulting Limited 2011
All Rights Reserved
6. JBoss 7 – All change
© C2B2 Consulting Limited 2011
All Rights Reserved
7. 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
© C2B2 Consulting Limited 2011
All Rights Reserved
8. 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
© C2B2 Consulting Limited 2011
All Rights Reserved
9. Directory Structure
• bin
– Scripts for starting and stopping JBoss
• docs
– Documentation, schemas, examples etc
• modules
– Modules used by/available to the server
• domain
– Files for running in domain mode
• standalone
– Files for running in stand alone mode
© C2B2 Consulting Limited 2011
All Rights Reserved
10. Modules
• Pluggable components of the application
server
– Referenced from profiles
– module.xml
• Basis of classloading in JBoss AS 7
© C2B2 Consulting Limited 2011
All Rights Reserved
11. 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
© C2B2 Consulting Limited 2011
All Rights Reserved
13. Standalone mode
• Similar to the old JBoss approach
– Independent servers
• Centralised configuration
– Based on profiles
– configuration/standalone.xml
• Domain mode processes collapsed into a
single JVM
© C2B2 Consulting Limited 2011
All Rights Reserved
14. 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
© C2B2 Consulting Limited 2011
All Rights Reserved
15. 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>
© C2B2 Consulting Limited 2011
All Rights Reserved
16. 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>
© C2B2 Consulting Limited 2011
All Rights Reserved
17. Deploying to standalone
• Drop the application
into
standalone/deployme
nts
– Deployment scanner
runs periodically
© C2B2 Consulting Limited 2011
All Rights Reserved
18. Domain mode
© C2B2 Consulting Limited 2011
All Rights Reserved
19. 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
© C2B2 Consulting Limited 2011
All Rights Reserved
20. Domain mode
• Domain.xml
– Configures all the profiles available in the
domain
– Standard across the domain
• Host.xml
– Configures the host controller on a host
– Unique to each host
© C2B2 Consulting Limited 2011
All Rights Reserved
22. 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
© C2B2 Consulting Limited 2011
All Rights Reserved
23. Process Controller
• Lightweight process responsible for
starting and stopping other processes
– Keep the parent process of a server very
lightweight
© C2B2 Consulting Limited 2011
All Rights Reserved
24. Deploying to domain mode
• Via the command line
interface
[domain@localhost:9999 /] deploy
../../../../testsuite/smoke/target/
deployments/test-
deployment.sar --all-server-
groups 'test-deployment.sar'
deployed successfully.
© C2B2 Consulting Limited 2011
All Rights Reserved
26. 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)*] )]
© C2B2 Consulting Limited 2011
All Rights Reserved