JBoss EAP6 High Availability - Weinan Li - E-Book

JBoss EAP6 High Availability E-Book

Weinan Li

0,0
31,19 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

High availability is a system design approach and associated service implementation which ensures that a prearranged level of operational performance will be met during a contractual measurement period. High availability is usually a system combined with many different components that achieve different goals. High availability cluster implementations attempt to build redundancy into a cluster to eliminate single points of failure.

JBoss EAP6 High Availability is the perfect guide for learning how to apply the newest technologies provided by JBoss to build your high availability system. With a clear explanation of the design of JBoss EAP6 and its clustering components, this book will help you customize each component to fulfill your specific requirements.

Throughout the course of this book, you will learn how to build high availability clusters using the projects provided by JBoss. The book begins with an introduction to the design of JBoss EAP6 and its uses. The next step will be to explore the two companion open source projects - mod_jk and mod_cluster. In this section, you will get to grips with the concept of load balancing with mod_jk and mod_cluster. You will also learn how to enable SSL in the clustering environment and how to configure session replication between EAP6 servers. Furthermore, the appendix section introduces you to some troubleshooting techniques for Wildfly.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 150

Veröffentlichungsjahr: 2013

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

JBoss EAP6 High Availability
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. JBoss EAP6 Overview
Understanding high availability
JBoss EAP6 high availability
JBoss Web, Apache httpd, mod_jk, and mod_cluster
EJB session bean
JBossWS and RESTEasy
HornetQ
Hibernate and Narayana
JGroups and JBoss Remoting
Domain management
Installing JBoss EAP6
The JBoss EAP6 startup mode
The domain mode
The standalone mode
Starting JBoss EAP6 in the standalone mode
Understanding the startup process
The standalone.xml file
Alternative configuration files
The --help option
Configuration files
Starting JBoss EAP6 in the domain mode
The domain mode
Configuration files
The domain.xml file
The host.xml file
The domain-controller section
The servers section
XSD documents
Summary
2. Using JBoss EAP6
Configuring the JBoss EAP6 management console
Security realms
Setting up an admin account
Using the web-based management console
Deploying a project in the standalone mode
Testing
Deployment scanner
Introducing JBoss DMR
Deploying a project in the domain mode
The main-server-group
Testing
CLI Usages
Connecting to CLI
ls
cd
Basic commands
echo-dmr
read-operation
The GUI
Deploying a project
Summary
3. Setting Up a JBoss EAP6 Cluster
Designing a cluster
Setting up a server group
The main-server-group versus other-server-group
Server configuration
Setting up master
Configuring host.xml
Adding a user account for slave server
Setting up HornetQ
Setting up slave
Configuring host.xml
Configuring domain.xml on slave
Testing the server group
Running master
Running slave
Checking the server status
Project deployment
Deploying a project to other-server-group
Clustering with the standalone mode
Summary
4. Load Balancing with mod_jk
Preparing a machine to install Apache httpd
Compiling and installing Apache httpd
Downloading httpd
Compiling httpd
Installing httpd
Starting httpd
Stopping httpd
Configuring httpd
Compiling and installing mod_jk
Installing JK
Configuring JK
Configuring httpd-jk.conf
The workers.properties configuration
Testing the cluster
The jk-status module
Summary
5. Load Balancing with mod_cluster
The design of mod_cluster
Installing mod_cluster
Downloading mod_cluster
Compiling and installing mod_cluster
Configuring mod_cluster
Configuring httpd.conf
Configuring mod_cluster
Configuring EAP6
Testing the cluster
Starting up httpd
The protocol analysis
The advertising channel
The management channel
The connector channel analysis
Accessing the cluster
Failover
Stress testing
Summary
6. Clustering with SSL
Using SSL in JBoss EAP6
Enabling SSL in EAP6
Using SSL in the JBoss EAP6 cluster
Configuring JK with SSL
Generating a certificate for httpd
Configuring httpd to use certificates
Summary
7. Configuring mod_cluster with SSL
The design of mod_cluster
Enabling SSL for the mod_cluster management channel
An introduction to SSL mutual authentication
Configuring SSL mutual authentication
Creating a CA certificate
Creating a certificate for httpd
Setting up OpenSSL
Signing the httpd.csr file
Creating a certificate for EAP6
Configuring httpd
Configuring EAP6
Testing the configuration
Enabling SSL in the proxy channel
Summary
8. Developing Distributed Applications
Web session replication
CDI-session-scoped bean replication
Configuring sticky sessions with JK
Configuring sticky sessions with mod_cluster
Summary
Index

JBoss EAP6 High Availability

JBoss EAP6 High Availability

Copyright © 2013 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First published: December 2013

Production Reference: 1171213

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham B3 2PB, UK.

ISBN 978-1-78328-243-2

www.packtpub.com

Cover Image by Aniket Sawant (<[email protected]>)

Credits

Author

Weinan Li

Reviewers

Dustin Kut Moy Cheung

Jean-Frederic Clere

Ty Lim

Martin Večeřa

Acquisition Editors

Owen Roberts

Erol Staveley

Commissioning Editor

Sruthi Kutty

Technical Editors

Pooja Nair

Humera Shaikh

Ritika Singh

Nachiket Vartak

Copy Editors

Alisha Aranha

Roshni Banerjee

Sarang Chari

Karuna Narayanan

Deepa Nambiar

Kirti Pai

Project Coordinator

Ankita Goenka

Proofreader

Jonathan Todd

Indexer

Hemangini Bari

Graphics

Sheetal Aute

Ronak Dhruv

Valentina Dsilva

Production Coordinator

Shantanu Zagade

Cover Work

Shantanu Zagade

About the Author

Weinan Li started off as a Metro Railway Engineer and has worked at Alcatel since 2004 playing with hardware and assembly language.

He entered Red Hat in 2011 and is currently working as a Senior Software Engineer in the JBoss EAP team. He is also the productization leader of JBoss EWS and an active contributor to RESTEasy.

He currently lives in Beijing with his wife and their three-year-old son.

I would like to thank Veena Manjrekar from Packt Publishing who recommended me to write this book. I also give my gratitude to the editors from Packt Publishing, Sruthi Kutty and Ankita Goenka, 
who have given me great support during the writing process of 
this book.

I would like to thank my colleagues from Red Hat who have patiently answered my questions and helped me to review this book. They are Dustin Kut Moy Cheung, Fernando Nasser, Jean-Frederic Clere, Michal Babacek, Mladen Turk, Paul Ferraro, and Radoslav Husar. I would like to thank Martin Večeřa and Ty Lim who have given me a lot of advice.

I would like to especially thank Jean-Frederic Clere who has given me a lot of guidance during the writing process of this book. I would also like to thank all the people from the JBoss community who have inspired me to write this book.

Finally, thank you to my parents, my wife, and my son. I love you.

About the Reviewers

Dustin Kut Moy Cheung was born and raised in the island of Mauritius. Dustin's interest in computers was sparked when he obtained his first computer at the age of nine. Since then, he became determined to head into a career in the software world. He values spending time with his close friends, and looks at pictures of puppies and kittens in his spare time.

I'd like to thank Weinan for giving me the opportunity to review this book. I'd also like to thank the awesome people at Red Hat, Toronto; you guys rock! To my friends scattered around the world, I miss you! And of course, I wouldn't be here without the unconditional love and dedication of my parents. Thank you Papi and Mami!

Jean-Frederic Clere was born in France, where he studied. After a few years of consulting work there, he started to write servers for applications and moved to Barcelona, Spain. In 2000, he started contributing to Apache Software Foundation projects. Since 2006 he has been working for Red Hat in the JBoss division where he takes care of the web layer and the Apache httpd as a proxy for the Application Server. Actually, he lives in Neuchatel, Switzerland.

I would like to thank my wife Adelina for her patience with my geek behavior and all the colleagues and friends from Open Source communities who make my contributions possible.

Ty Lim is an experienced IT professional with more than 15 years' experience working on various operating system and middleware platforms. He has professional experience with IBM WebSphere Application Server, Apache Tomcat, Apache httpd server, and various other middleware and operating system platforms. He has experience working in various industries that include healthcare, telecommunications, financial, and software development. He holds a Bachelor of Science in Computer Science from the University of the Pacific, and a Master of Science degree in Computer Information Systems from Boston University.

I would like to thank my friends and family for their 
continued support.

To my "HH" friends, let's always keep the party going.

Martin Večeřa is a JBoss Quality Assurance Manager within a division of Red Hat. He has a passion for bleeding-edge projects and technologies. His main area of interest is Java middleware and performance testing in which he has almost 10 years' experience. Previously, he has developed information systems for power plants and medical companies. He publishes articles on Java middleware to various international and local web magazines and is a co-author of a blog on the PerfCake Performance Testing Framework.

www.PacktPub.com

Support files, eBooks, discount offers and more

You might want to visit www.PacktPub.com for support files and downloads related to your book.

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.

http://PacktLib.PacktPub.com

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books. 

Why Subscribe?

Fully searchable across every book published by PacktCopy and paste, print and bookmark contentOn demand and accessible via web browser

Free Access for Packt account holders

If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.

Preface

High availability is a broad topic to discuss, and it concerns both project deployment and development. In this book, I'd like to explore the topics on clustering, load balancing, failover, and session replication.

High availability is also a very interesting topic, and the technologies provided by open source communities are especially fun. In this book we'll learn how to use JBoss EAP6 together with other JBoss and Apache community tools to build a high-availability system.

Here is a brief list of the projects we'll use in this book: JBoss EAP 6, Apache httpd, mod_jk, and mod_cluster. When I'm writing this book, JBoss EAP 6.1.0.Final is the newest product version based on JBoss AS 7.2.x and can be downloaded freely from the JBoss community. This version is very stable with its clustering features, so we'll use it in our book.

Since AS 8.x, the project name of JBoss AS has been renamed to WildFly. Though the project name changed, its design hasn't changed much, and you can reuse most of the knowledge in this book for future versions of WildFly.

JBoss EAP6 has provided a domain management feature that can help us to centralize the management of many servers. This feature is very helpful in a clustering environment, because we don't have to manage each server separately. We'll check this feature in the book.

Transportation security is usually considered critical in business applications. In this book, I'll introduce the methods of applying SSL into a clustering environment.

What this book covers

Chapter 1, JBoss EAP6 Overview, teaches you how to download and install JBoss EAP6, introduces you to startup modes of JBoss EAP6, and covers the basic uses of the domain management function.

Chapter 2, Using JBoss EAP6, covers more details on using the EAP6 management console and explains the design of the EAP6 management model.

Chapter 3, Setting Up a JBoss EAP6 Cluster, guides you on how to set the EAP6 servers properly for it to form a cluster.

Chapter 4, Load Balancing with mod_jk, shows how to use mod_jk as the load balancer of the EAP6 cluster.

Chapter 5, Load Balancing with mod_cluster, discusses how to use mod_cluster as the load balancer of the EAP6 cluster.

Chapter 6, Clustering with SSL, shows how to enable SSL in a clustering environment and teaches you how to set SSL to work with mod_jk.

Chapter 7, Configuring mod_cluster with SSL, shows how to set SSL to work with mod_cluster.

Chapter 8, Developing Distributed Applications, discusses how to develop the distributable applications with the help of JavaEE technologies and deploy it into the EAP6 cluster.

Appendix, WildFly Troubleshooting, shows how to debug the WildFly server at runtime. This chapter is available as a bonus chapter and can be downloaded from http://www.packtpub.com/sites/default/files/downloads/2432OS_Appendix.pdf.

What you need for this book

Some basic knowledge on Linux/Unix is required to read this book. You may need to follow the shell commands shown in the book to configure the servers properly.

Some basic understanding of IP multicasting is strongly recommended. Because many clustering features rely on IP multicasting, you can better understand the design of EAP6 clustering with this knowledge.

If you want to follow the instructions in Chapter 8, Developing Distributed Applications, you may need some basic knowledge of EJB and Servlet development. In addition, some knowledge on Maven usage is preferred.

Chapter 6, Clustering with SSL, and Chapter 7, Configuring mod_cluster with SSL, mainly focus on applying SSL in clustering. Some basic understanding of SSL/TLS technologies is needed if you want to follow the instructions in these two chapters.

When you are following the instructions in this book, please turn off the network firewall of your machine in case it blocks important ports needed by the cluster. If you are using Linux as your working environment, please disable SELinux because it will affect a lot on the clustering features. When you have fully understood the EAP6 clustering features, you can turn these protections back online and configure them properly to work with the EAP6 cluster.

Who this book is for

JBoss EAP6 administrators and JavaEE developers are the main audience of this book. Anyone who wants to know the coolest technologies provided by the JBoss community is recommended to read this book. I hope this book is not merely a step-by-step tutorial, so I've included some discussions on the design of JBoss EAP6 and relative projects.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, folder names, filenames, file extensions, pathnames, dummy URLs, and user input are shown as follows: "The default configuration file is standalone.xml."

A block of code is set as follows:

<interfaces> <interface name="management"> <inet-address value="${jboss.bind.address.management:127.0.0.1}"/> </interface> <interface name="public"> <inet-address value="${jboss.bind.address:127.0.0.1}"/> </interface> </interfaces>

Any command-line input or output is written as follows:

$ ./standalone.sh

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "To undeploy the project, click on En/Disable first and then click on Remove".

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to <[email protected]>, and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the erratasubmissionform link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at <[email protected] >with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.

Chapter 1. JBoss EAP6 Overview