Contained WithinFind More DocumentationFeatured Support Resources | Descargar este libro en PDF (3002 KB)
Chapter 4 Deployment ScenariosThis chapter describes how to deploy Web Server on a single node and a cluster environment. The following topics are discussed in this chapter: Deployment ArchitectureThis section describes the single node deployment architecture. The following figure represents Web Server in a single node deployment set up. ![]() In the figure, Web Server deployment set up comprises of the following components:
Deployment OverviewYou can consider deploying Web Server on a the single node for the following purposes:
The following flowchart provides the schematic representation of how to deploy Web Server on a node: Figure 4–1 Flowchart representing the deployment of web server on a single node
The deployment process is described in the following sections: Pre-Deployment RequirementsTo deploy the Web Server on a single node, prepare the system by performing the following tasks:
Deploying Web ServerUse the following procedure to deploy Web Server on a node:
Cluster EnvironmentA cluster is a group of multiple server instances, spanning across more than one node, all running identical configuration. All instances in a cluster work together to provide high availability, reliability, and scalability. With load balancing, a cluster offers uninterrupted service and session data persistence by providing failover and session replication. Hardware and Software RequirementsThe use case described in this section, the Web Server cluster consists of the following entities:
To set up a cluster, you need two or more identical nodes with the same operating system version and patches installed. For example, if you select a machine with Solaris® 9 SPARC® operating system, other machines in the cluster must also have Solaris 9 SPARC installed. For information on supported platforms and patch requirements, see the Sun Java System Web Server 7.0 Update 3 Release Notes. The following figure describes a clustered environment. Figure 4–2 Cluster Set Up
In the figure, nodes are configured in the De-Militarized Zone (DMZ). The Administration Server is configured behind a firewall, the Militarized Zone, to restrict and protect the Administration Server against general access. Another node is configured as the Reverse Proxy Server. A reverse proxy server resides inside the DMZ to enhance security. Note – The Solaris zone feature is supported only on Solaris 10 operating system. Setting Up a ClusterThis section describes the procedure to set up the cluster and enable reverse proxy to support load-balancing of HTTP requests. The following flowchart illustrates the procedure to set up a cluster. Figure 4–3 Flowchart illustrating the cluster set up
Configuring Reverse Proxy for Load-balancingWeb Server 7.0 provides a sophisticated built-in load balancer, the reverse proxy. A reverse proxy is a gateway for Web Servers in a server farm. By configuring reverse proxy, the requests are forwarded to multiple similarly configured web servers Use the following procedure to enable reverse proxy in Web Server 7.0:
This completes configuring reverse proxy for load balancing HTTP requests. Note – To configure a reverse proxy in a cluster environment, issue a wildcard server certificate or the alternate subject names that can be set to the actual origin server host names. The other option of specifying the original server's host names in the subject name field limits the size of the cluster, leading the cluster to fail if another node is added to the cluster. A wildcard server certificate can be created using the administration interfaces. After creating the server certificate use certutil to get the base64 encoded version of the certificate and install it as a trusted CA certificate on the load balancer configuration. Type the following command to generate the base64 encoded certificate bash$./certutil -L -a -d instancedir/config. Copy the output of the command and paste it in the install certificate wizard. Configuring Timeout Parameter in Reverse Proxy
|
ObjectType fn="http-client-config" timeout="400" |
The default timeout value is 300 seconds.
Once the response timeout value is defined, the reverse proxy parameter closes the connection to the backend instance if the connection hangs for more than 400 seconds and identifies it as offline.
When a reverse proxy parameter tries to establish a connection with a backend instance which is hanging or too busy, it waits for a connection response for a maximum period of five seconds and then identifies the instance as offline.
Login to Administration Console
Select the configuration from the list
Click the Edit Virtual Server button
Click the Content Handling tab
Click the Reverse Proxy sub tab
Click the New button
A new window appears.
In URI enter (/) if you want all the requests to be set revers proxy. Else, enter the URI to be set to reverse proxy.
Enter the server's URL, which you want to reverse proxy.
For example, http://<content server-hostname>:port
Click the OK button
Click the Deployment Pending link in the top right of the screen.
Click the Deploy button
Deployment successful message appears.
Click the Configuration tab
Start the instance.
Access the URI, which you configured as the reverse proxy.
To configure conditional request processing you need to manually edit the virtual server specific obj.conf file.
For example, if you want to configure reverse proxy for all .jsp, .php requests. You need to include the following text in your obj.conf file.
<If $uri =~ '.jsp$' or $uri =~ '.php$'> NameTrans fn="map" from="/" to="http:/" name="custom_reverse_proxy" </If> |
You should insert the above text under the object name default.Add the following text to the end of the obj.conf file.
<Object name ="custom_reverse_proxy"> Route fn="set-origin-server" server="http://<hostname>:<port>" </Object> <Object name ppath="http:*" Service fn="proxy-retrieve" method="*" </Object> |
Follow the below steps to configure reverse proxy in CLI mode. For examples, let us create a configuration config1 and also create an instance rp as reverse proxy.
Start the Administration Server:
$ <install-dir>/admin-server/bin/startserv
Invoke the CLI shell:
<install-dir>/admin-server/bin/wadm -user <username>
Now, you can see the wadm shell
Create config1:
wadm>create-config --http-port 8080 --server-name config1 --server-user root config1
Create an instance for the config1 configuration:
wadm>create-instance --config config1 <host-name>
Add the web application on the created configuration:
wadm>add-webapp --config config1 -vs config1 --uri/test <warfile>
Deploy the web application
wadm>deploy-config --user=admin --password-file=admin.pwd --host=serverhost --port=8989 config1
Create a rp configuration:
wadm>create-config --http-port 8081 --server-name rp --server-user root rp
Enable the rp configuration to reverse proxy using the following command:
wadm>create-reverse-proxy --config rp --vs rp --uri-prefix/--server http://<host-name>:8080
Create an instance for the rp configuration
wadm>create-instance --config rp <host-name>
Start the instances:
wadm>start-instance --config config1 <host-name>
wadm>start-instance --config rp <hostname>
Now, the web application deployed in config1 can be viewed through rp instance.
http://<rp instance hostname>:8081/test
Session replication is a mechanism used to replicate the data stored in a session across different instances. However, the replicated instance must be part of the same cluster. When session replication is enabled in a cluster environment, the entire session data is copied on a replicated instance. However, the session replication operation does not copy the non-serializable attributes in a session and any instance specific data.
Session replication along with load balancing provides good failover capabilities for web applications.
This section describes the session replication operation in detail.
At the end of a web request, the Web Server determines whether the session data needs to be copied through the session replication configuration that is stored in the server configuration file, the server.xml.
Consider a use case of four instances forming a cluster and the session replication is enabled on the Administration Server.
The session replication process in a Web Server cluster of four instances (A, B, C, and D) running on four nodes is as follows:
Instance A is backup of D, B is backup of A, C is backup of B, and D is backup of C. This forms a complete backup ring.
Each instance in the cluster keeps track of a static list of all the instances in the cluster and an active backup instance.
Depending on the configuration, session data is sent to the backup instance synchronously at the end of each request.
The failover process in a Web Server clustered environment as follows:
If instance A fails, the load balancer redirects all incoming web requests destined for instance A to the remaining instances in the cluster and the backup ring is re-configured as follows:
D detects that its backup A is down and selects the next instance to A on the ordered list as its new backup instance.
In this case, B is selected and D establishes a new backup connection to B. B now holds two backups: a read-only backup of A and an active backup of D.
The backup ring is now complete with B backing up to C, C backing up to D, and D backing up to B.
When the failed instance A is made available again, it rejoins the backup ring by sending its designated backup instance B a rejoin message and establishes a backup connection to B.
When D detects that A comes online by either receiving a successful ping return from A or by receiving a message from A.
D then establishes a backup connection to A and terminates its backup connection to B.
Web Server 7.0 does not support the following features in session replication:
Recover simultaneous failures of two or more instances.
The interval between two failures must be greater than the time needed for a resurrected instance to fully recover.
Session backup to more than one instance. In normal operation, there are only two copies of any session: the primary session and a backup session.
Session persistence: Sessions are only backed up in memory of another instance for the purpose of failover
Web Server supports session replication for only Java web applications. If you are using non-Java applications such as CGI or PHP, the session data cannot be replicated.
You can enable session replication in a cluster either using the Admin Console or the CLI. Before you enable session replication, make sure that your browser is cookie enabled.
The server.xml file contains the information related to session replication. A sample server.xml file with session replication enabled is given below:
<cluster>
<local-host>hostA</local-host>
<instance>
<host>hostB</host>
</instance>
<instance>
<host>hostC</host>
</instance>
<instance>
<host>hostD</host>
</instance>
<instance>
<host>hostA</host>
<session-replication/>
</cluster>
If you are using the default values for the following elements, the entry for these elements will not be available in the server.xml configuration file:
|
Port number (default is 1099) |
|
Protocol (default is jrmp) |
|
Encrypted (default is false) |
|
Getattribute Triggers Replication (default is true) |
|
Replica Discovery MaxHops (default is –1) |
|
Startup Discovery Timeout (default is 0. Relies on Java API to get system timimg. In non Unix based operating systems, it may not be accurate.) |
|
Cookie Name (default is CLUSTERSESSIONLOCATOR) |
For more information about these session replication properties, see the Sun Java System Web Server 7.0 Update 3 Administrator’s Configuration File Reference.
To enable the server to replicate the session, the web application must also be enabled for session replication.
To enable session replication for a web application, modify the sun-web.xml configuration file located in the <web-application>/WEB-INF directory.
The modification needed in the sunweb.xml is as follows:
Change the element <session-manager/> to <session-manager persistence-type="replicated">
The sample sun-web.xml file with session replication enabled is given below:
<sun-web-app>
<session-config>
<session-manager persistence-type="replicated">
</session-manager>
</session-config>
</sun-web-app>
After modifying the sunweb.xml file, either rebuild the web application or re-jar the application to create a web application archive (a war file).
Restart all the instances to make the web application available on all the instances.
The web application is accessible from all the nodes in the cluster. To access the web application, in a browser, type the following:
http://webserver-name/webapplication-name/
A directory that is accessible to all nodes is the best way to store the applications for deployment. This directory, however, need not be accessible to the Administration Server. It is recommended to make directory-based deployments of web applications that are more than One MB in size.
For creating search collections, ensure that the search collection resides in a common directory that is accessible to all the nodes.
The Administration Server can monitor all the instances in a cluster. The monitoring feature in Web Server provides information on the state of runtime components and processes that can be used to:
Identify performance bottlenecks
Tune the system for optimal performance
Aid capacity planning
Predict failures
Perform root cause analysis in case of failures
|
|
Solaris Zones are an application and resource management feature of Solaris 10. A zone environment typically consists of resources such as process management, memory, network configuration, file systems, package registries, user accounts, shared libraries, and in some cases, installed applications. Zones provide a means of creating virtualized operating system environments within an instance of Solaris, allowing one or more processes to run in isolation from other activity on the system. It also provides an abstraction layer that separates applications from physical attributes of the machine on which they are deployed, such as physical device paths and network interface names, and network routing tables. This isolation prevents processes running within a given zone from monitoring or affecting processes running in other zones, regardless of user ID and other credential information.
A zone is a sandbox within which one or more applications can run without affecting or interacting with the rest of the system.
For detailed information about Solaris Zones, see the System Administration Guide — Solaris Containers-Resource Management and Solaris Zones at http://docs.sun.com/app/docs/doc/817-1592.