Naina Bhattacharya
Create Your Web Server 7 Cluster
Sun Java System Webserver 7.0 is now available and one of the features
I tried was the clustering feature. This is new in 7.0. This feature
allows you to maintain a server farm and administer a whole bunch of
webservers from a single place. Its all rather simple. Heres how you
can go about making your own cluster.
For this you need to first install one administration server and one or
more admin agents. The admin agents have to be then registered to the
admin server individually for them to be able to be admininstered. This
step can be done either during installation of the agents or after
installation through the command line interface.
This post is divided into three parts
1. Installaling the admin server and admin agent
2. Registering the admin agents to the admin server
3. Start using the cluster
Step 1: Install your admin server and your admin agent(s)
The admin server and the admin agent have to be on different machines. Start by installing your admin server. There are two ways you can install:
a. Through the GUI
b. Through the command line interface
The admin server(same as in 6.1) is the server you can log into to administer all the machines in a cluster.
You can choose the Express installation option which will install an administration server on the port 8989.
Alternatively, choose the option "Custom Installation" after accepting the licence agreement. To install the admin server choose the option "Install server as Administration Server". You need to specify the SSL port and may or may not choose a non SSL port. If a non SSL port is selected an admin agent is created in the admin server node and this need not be registered to the admin server explicitly.
Admin agent is new in WS 7.0. In WS 7.0 there is support for implicit clustering. An admin agent is nothing but an admin server configured differently. An admin agent does not provide a GUI interface. It is simply an agent for the admin server to command. One node in the server farm has the admin server installed. All other nodes in the server farm will have admin agents installed. An admin agent is registered with an admin server upon installation. This will make the admin server aware of that admin agent.
To install the admin agent , choose Custom installation and then "Install server as administration Agent". You cannot use an Express install to for a agent.Specify a port for installation. This is an SSL port. All communication between admin server and admin agent is always secure. This install will ask you if you want to register the agent to the admin server. For more information on registration read the next section.
Once you do this, you can install as many agents as you want. And voila! You have the servers ready to setup a cluster.
Step 2: Register your admin agents to the admin server
The admin agents have to be registered to the admin server for them to be part of the server-farm or the cluster. The admin agents will not start up unless they are registered to an admin server.
There are two ways of registering:
a. During installation: When you custom install an admin agent, it will ask you if you want to register the agent to the admin server. If you want to register it to an admin server then the admin server has to be installed and started. If the admin server is not started, registration will fail.
b. Through the command line interface
Go to the <install-dir>/bin/ of the agent. An agent can be installed from the agent ONLY. You cannot go to the CLI of the admin server and register any agent.
Execute ./wadm --user <admin-user> --port <SSL port> --host <node name>
This port is the one specified during install. Host is the hostname of the node where the admin server is installed. This will take you to the wadm prompt. At the prompt execute
wadm> register-agent
This will pick up the necessary information of host and port from the server.xml of the agent and register the agent to the admin server.
Once the admin agent is up you can start the admin agent also.
One place where it is easy to get confused is the existence of the admin-server directory in an agent under the install-dir. Starting this merely means the admin-server can coomunicate with the admin-agent. This does not mean you can administer the agent from itself.
Step 3: Start Using the Cluster
You can use the wadm on any of the nodes on the server farm to connect to the admin server. (As described in Step 2).
So now you have your cluster all up and running. Now you can create configs, deploy them on the local and remote nodes, create instances and modify them all from one single place!
In my next post I will talk about admininstering the server farm and some of the things I ran into. Till then,
Happy Clustering!
Posted at 06:04AM Aug 16, 2006 by naina in Sun | Comments[4]
Posted by Promothash on August 18, 2006 at 11:33 AM PDT #
please can u help me with my config with webserver 7. document root
vserver1 document root C:\fm3j port:80 working daclag.com
vserver2 document root C:\jari port:8080 not working jari.daclag.com ?
if i put the folder in C:\fm3j\jari working jari.daclag.com
thank you if you have time please email me
Posted by robert on April 27, 2008 at 03:20 AM PDT #
server.xml and obj.conf
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2006 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
-->
<server>
<cluster>
<local-host>carolino</local-host>
<instance>
<host>carolino</host>
</instance>
</cluster>
<log>
<log-file>../logs/errors</log-file>
<log-level>info</log-level>
</log>
<jvm>
<java-home>C:/Java/jdk1.6.0_04</java-home>
<server-class-path>C:/Program Files/Sun/WebServer7/lib/webserv-rt.jar;C:/Program Files/Sun/WebServer7/lib/pwc.jar;C:/Program Files/Sun/WebServer7/lib/ant.jar;${java.home}/lib/tools.jar;C:/Program Files/Sun/WebServer7/lib/ktsearch.jar;C:/Program Files/Sun/WebServer7/lib/webserv-jstl.jar;C:/Program Files/Sun/WebServer7/lib/jsf-impl.jar;C:/Program Files/Sun/WebServer7/lib/jsf-api.jar;C:/Program Files/Sun/WebServer7/lib/webserv-jwsdp.jar;C:/Program Files/Sun/WebServer7/lib/container-auth.jar;C:/Program Files/Sun/WebServer7/lib/mail.jar;C:/Program Files/Sun/WebServer7/lib/activation.jar</server-class-path>
<debug>false</debug>
<debug-jvm-options>-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7896</debug-jvm-options>
<jvm-options>-Djava.security.auth.login.config=login.conf</jvm-options>
<jvm-options>-Xms128m -Xmx256m</jvm-options>
</jvm>
<thread-pool>
<max-threads>128</max-threads>
<stack-size>131072</stack-size>
</thread-pool>
<default-auth-db-name>keyfile</default-auth-db-name>
<auth-db>
<name>keyfile</name>
<url>file</url>
<property>
<name>syntax</name>
<value>keyfile</value>
</property>
<property>
<name>keyfile</name>
<value>keyfile</value>
</property>
</auth-db>
<acl-file>default.acl</acl-file>
<mime-file>mime.types</mime-file>
<access-log>
<file>../logs/access</file>
</access-log>
<http-listener>
<name>http-listener-1</name>
<port>80</port>
<server-name>carolino</server-name>
<default-virtual-server-name>carolino</default-virtual-server-name>
</http-listener>
<http-listener>
<name>http-listener-2</name>
<port>8080</port>
<server-name>jari</server-name>
<default-virtual-server-name>jari</default-virtual-server-name>
</http-listener>
<virtual-server>
<name>carolino</name>
<http-listener-name>http-listener-1</http-listener-name>
<host>daclag.com</host>
<object-file>carolino-obj.conf</object-file>
<document-root>C:/fm3j</document-root>
</virtual-server>
<virtual-server>
<name>jari</name>
<http-listener-name>http-listener-2</http-listener-name>
<host>jari.daclag.com</host>
<object-file>jari-obj.conf</object-file>
<document-root>C:\jarie</document-root>
</virtual-server>
</server>
obj.conf
<Object name="default">
AuthTrans fn="match-browser" browser="*MSIE*" ssl-unclean-shutdown="true"
NameTrans fn="ntrans-j2ee" name="j2ee"
NameTrans fn="document-root" root="/var/websites/$urlhost"
NameTrans fn="pfx2dir" from="/mc-icons" dir="C:/Program Files/Sun/WebServer7/lib/icons" name="es-internal"
PathCheck fn="nt-uri-clean"
PathCheck fn="check-acl" acl="default"
PathCheck fn="find-pathinfo"
PathCheck fn="find-index-j2ee"
PathCheck fn="find-index" index-names="index.html,home.html,index.jsp"
ObjectType fn="type-j2ee"
ObjectType fn="type-by-extension"
ObjectType fn="force-type" type="text/plain"
Service method="(GET|HEAD)" type="magnus-internal/directory" fn="index-common"
Service method="(GET|HEAD|POST)" type="*~magnus-internal/*" fn="send-file"
Service method="TRACE" fn="service-trace"
Error fn="error-j2ee"
AddLog fn="flex-log"
</Object>
<Object name="j2ee">
Service fn="service-j2ee" method="*"
</Object>
<Object name="es-internal">
PathCheck fn="check-acl" acl="es-internal"
</Object>
<Object name="cgi">
ObjectType fn="force-type" type="magnus-internal/cgi"
Service fn="send-cgi"
</Object>
<Object name="send-precompressed">
PathCheck fn="find-compressed"
</Object>
<Object name="compress-on-demand">
Output fn="insert-filter" filter="http-compression"
</Object>
Posted by robert on April 27, 2008 at 04:34 AM PDT #
Thanks i got it. Yes
Posted by robert on April 28, 2008 at 03:13 AM PDT #