coldfusion mx server administration j2ee deployment and clustering adam wayne lehman...
Post on 26-Dec-2015
221 Views
Preview:
TRANSCRIPT
ColdFusion MX Server
Administration
ColdFusion MX Server
AdministrationJ2EE Deployment and
Clustering
Adam Wayne Lehmanadrocknaphobia@gmail.com
J2EE Deployment and Clustering
Adam Wayne Lehmanadrocknaphobia@gmail.com
Adam Wayne LehmanAdam Wayne Lehman• Senior Systems Engineer, U.S.
Department of State– OSAC.gov
• U.S. Department of State Adobe User Group Manager
• 10 years of web development experience
• Adrocknaphobia.com
OverviewOverview• Installing ColdFusion MX (multi-server mode)
– JRun Directory Structure• Server Directory Structure• JRun Management Console• EAR/WAR Deployment
– Web Application Overview• JRun Tools
– Server Instance Management– External Web Servers– Windows Services
• JRun Clustering– Example Infrastructures
ColdFusion MX Server Administration
ColdFusion MX Server Administration
Considerations forInstalling ColdFusion MX
Considerations forInstalling ColdFusion MX
Drive SetupDrive Setup• C: Operating System• J: JRun and installed COTS applications• W: Web and application files
• S: Swap / Virtual Memory (PageFile.sys)– HD space equal to the amount of system RAM
• L: Log Files
optional
Installing ColdFusion MXInstalling ColdFusion MX
Installing ColdFusion MXInstalling ColdFusion MX• Install multi-server configuration• Internal JRun web
server only (stand-alone)
Installing ColdFusion MXInstalling ColdFusion MX
JRunJRun• Full version of JRun installed• Download and install the most
recent JRun Updater
JRun 4 Updater 6Build Number 106363
Installing ColdFusion MXInstalling ColdFusion MX
JRun Directory StructureJRun Directory Structure<JRun-root>
– Bin– JRE– Lib– Logs– Servers– Verity
JRun Utilities and Executables.
(JRun Launcher, Webserver Config, JRun Services, etc.)
Installing ColdFusion MXInstalling ColdFusion MX
JRun Directory StructureJRun Directory Structure<JRun-root>
– Bin– JRE– Lib– Logs– Servers– Verity
Java Runtime Environment
MX 7 ships with version 1.4.2
Installing ColdFusion MXInstalling ColdFusion MX
JRun Directory StructureJRun Directory Structure<JRun-root>
– Bin– JRE– Lib– Logs– Servers– Verity
JRun Java ClassesIncluded JVM classpath
Installing ColdFusion MXInstalling ColdFusion MX
JRun Directory StructureJRun Directory Structure<JRun-root>
– Bin– JRE– Lib– Logs– Servers– Verity
JRun Log Files
Installing ColdFusion MXInstalling ColdFusion MX
JRun Directory StructureJRun Directory Structure<JRun-root>
– Bin– JRE– Lib– Logs– Servers– Verity Server Instances
Installing ColdFusion MXInstalling ColdFusion MX
JRun Directory StructureJRun Directory Structure<JRun-root>
– Bin– JRE– Lib– Logs– Servers– Verity
Verity Search Server
Installing ColdFusion MXInstalling ColdFusion MX
ColdFusion MX Server Administration
ColdFusion MX Server Administration
Application Directory StructureApplication Directory Structure
Directory StructureDirectory Structure• Application Folder
– Application– ColdFusion
• Cache
– Components– CustomTags– Lib– Logs– SERVER-INF
Application / Web root directory
Application Directory StructureApplication Directory Structure
Directory StructureDirectory Structure• Application Folder
– Application– ColdFusion
• Cache
– Components– CustomTags– Lib– Logs– SERVER-INF
ColdFusion EAR/WAR files.
Application Directory StructureApplication Directory Structure
Directory StructureDirectory Structure• Application Folder
– Application– ColdFusion
• Cache
– Components– CustomTags– Lib– Logs– SERVER-INF
ColdFusion Component Base Directory
Application Directory StructureApplication Directory Structure
Directory StructureDirectory Structure• Application Folder
– Application– ColdFusion
• Cache
– Components– CustomTags– Lib– Logs– SERVER-INF
Custom Tag Base Directory
Application Directory StructureApplication Directory Structure
Directory StructureDirectory Structure• Application Folder
– Application– ColdFusion
• Cache
– Components– CustomTags– Lib– Logs– SERVER-INF
Java classes (JARs) and other deployed web applications (WARs)
Application Directory StructureApplication Directory Structure
Directory StructureDirectory Structure• Application Folder
– Application– ColdFusion
• Cache
– Components– CustomTags– Lib– Logs– SERVER-INF Log files
* If not storing on a separate drive
Application Directory StructureApplication Directory Structure
Directory StructureDirectory Structure• Application Folder
– Application– ColdFusion
• Cache
– Components– CustomTags– Lib– Logs– SERVER-INF
JRun server files
Application Directory StructureApplication Directory Structure
ColdFusion MX Server Administration
ColdFusion MX Server Administration
JRun Management Console(JMC)
JRun Management Console(JMC)
JMC vs CF AdminJMC vs CF Admin• JMC runs in a separate process
outside of all ColdFusion instances.– JMC can be disabled when not in use.– ColdFusion instances can be managed
while offline.• CF Admin provides limited
functionality.• Pre-MX 7 clusters may exhibit
strange behaviors when managed through CF Admin.
JRun Management Console (JMC)JRun Management Console (JMC)• JRun Admin located at
http://127.0.0.1:8000• Login
– Username: admin (case-sensitive)– Password: CFIDE password set during
installation* username/password stored in<jrun-root>\servers\admin\jrun-users.xml
• Default servers installed under <jrun-root>/servers
JRun Management ConsoleJRun Management Console
JRun Management ConsoleJRun Management Console• 3 Servers Installed
– Samples : Generic J2EE server instance– CFusion : ColdFusion MX server instance– Admin : JRun Administrator instance
• Remove CFusion and Samples server– Remove the server without removing
any associated files or directories
JRun Management ConsoleJRun Management Console
Creating A New ServerCreating A New Server1.Select Create a New
Server in the JRunManagement Console.
2.Specify the ApplicationFolder as the JRunServer Directory.
3.Remove thedefault-ear directoryfrom your ApplicationFolder.
4.Start the server.
JRun Management ConsoleJRun Management Console
JRun Management ConsoleJRun Management Console
JNDI Java Naming and Directory Interface – Servers use this port to communicate within the cluster
HTTP Built-in JRun web server
Proxy Interface allowing external web servers to communicate with JRun
JRun Management ConsoleJRun Management Console
EAR/WAR DeploymentEAR/WAR Deployment• Archive deployment
– Entire structure is contained in a single archive– Compact– Easy to version and swap– Recommended for a single deployment
• Expanded deployment– Hot deployment– Easy to edit and update files– Recommended for a clustered deployment
EAR/WAR DeploymentEAR/WAR Deployment
Archive DeploymentArchive Deployment1. Run the ColdFusion installation to create the
EAR/WAR archiveEAR : Enterprise Application ArchiveWAR : Web Application Archive
• An EAR may contain multiple WARs
2. Copy the EAR/WAR to <Application Folder>/ColdFusion
3. Select the server in the JRun Management Console to view the J2EE Components
4. Add a new Enterprise Application / Web Application
5. Select the EAR/WAR6. Deploy
EAR/WAR DeploymentEAR/WAR Deployment
Expanded DeploymentExpanded Deployment1. Expand the EAR/WAR directory structure.2. Copy the CFIDE, META-INF, and WEB-INF
directories to <Application Root>/ColdFusion.– Do not copy the CFIDE if you do not wish to
deploy the ColdFusion Administrator.
3. Start the server.– The EAR/WAR will be automatically deployed
when the server starts.
EAR/WAR DeploymentEAR/WAR Deployment
Web Application OverviewWeb Application OverviewJRun Management ConsoleJRun Management Console
Web Application OverviewWeb Application Overview• Context Path Host: Restricts the host address
of the application.• Context Path: The base context path of the
application.– Context Path Host + Context Path = Application URL
• Document Root: Application root directory.– <Application Folder>/Application
• Dynamic Reload/Compile: JRun dynamically recompiles and reloads servlets, JSPs, servlet helper classes, and JSP helper classes when a servlet or JSP is called. (Disabled by default).
JRun Management ConsoleJRun Management Console
Web Application OverviewWeb Application Overview• Directory Browsing: Allow users to
browse directories if a file is not specified.• File Serving: Allow the application to
process templates.• File-based Session Persistence /
Session Replication: Enables session sharing across a cluster
• Replication Buddy: Determines the servers in the cluster to share sessions with.
JRun Management ConsoleJRun Management Console
Web Application XMLWeb Application XML
<jrun-web-app><enable-jrun-web-services>false</enable-jrun-web-services><session-config>
<persistence-config><active>false</active>
</persistence-config><replication-config>
<active>false</active></replication-config>
</session-config><virtual-mapping>
<resource-path>/</resource-path><system-path>W:\CFMX7\Application</system-path>
</virtual-mapping><context-root>/</context-root><compile>false</compile><reload>false</reload><uri-character-encoding>UTF-8</uri-character-encoding>
</jrun-web-app>
<Application Folder>/ColdFusion/WEB-INF/jrun-web.xml
JRun Management ConsoleJRun Management Console
Internal Web ServersInternal Web Servers
• ProxyService: Interacts with external web servers (IIS, Apache, etc.)
• WebService: Built-in JRun web server.
JRun Management ConsoleJRun Management Console
ColdFusion MX Server Administration
ColdFusion MX Server Administration
JRun ToolsJRun Tools
Configuring External Web ServersConfiguring External Web Servers
• Web Server Configuration Tool (WSConfig.exe)– Found under <JRun Root>\bin– Both GUI & Command Line
JRun ToolsJRun Tools
Configuring External Web ServersConfiguring External Web Servers• JRun Host / Server: JRun
server instance or cluster running ColdFusion
• Web Server: Type of web server
• IIS Web Site: Available IIS web sites which are not already connected to JRun
• Configure web server for ColdFusion MX:– Sets common properties of
the web server when using ColdFusion. (Specifies index.cfm as a default document)
JRun ToolsJRun Tools
Register Windows ServicesRegister Windows Services
JRunSVC Tool (JRunSVC.exe)– Found under <JRun Root>\bin– Command line only– Install, remove, start, and stop the JRun
server's Windows service.
jrunsvc -install jrun_server [service_name [service_display_name [service_description]]] jrunsvc -[remove|start|stop service_name]
* Wrap the service name in quotes (“”) if the name contains any spaces.
JRun ToolsJRun Tools
JRun Server ManagementJRun Server Management• JRun Launcher Tool (JRun.exe)
– Found under <JRun Root>\bin– Both GUI & command-line
• Start, stop and restart JRun instances without the need for the running admin service or a web browser.
JRun ToolsJRun Tools
Coldfusion MX Server Administration
Coldfusion MX Server Administration
JRun ClusteringJRun Clustering
InfrastructureInfrastructure
Load Balancer
InternetJRUN Web Connector
JRUN
A
C
B
JRUN Web Connector
JRUN
A
C
B
Web Server A
Web Server B
JRun ClusteringJRun Clustering
InfrastructureInfrastructure• Load Balancer: Balances web requests to
multiple web servers.• Web Server: Responds to web requests
and directs processing or requests to JRun. (IIS, Apache, etc.)
• JRun Web Connector: Software process which directs processing requests from the web server to JRun.
• JRun: Application server running multiple instance of ColdFusion MX.
• ColdFusion MX: If you need a definition, please exit the room quietly.
JRun ClusteringJRun Clustering
JRun ClusteringJRun Clustering• JRun provides enterprise-level server
clustering for maximum reliability and scalability. Clustering is built into the web server connectors and the JRun kernel:– At the web server connector level, clustering
enables load balancing and automatic failover between the web server and the web containers.
– At the kernel level, clustering enables load balancing and automatic failover for clusterable server objects, such as EJBs, JNDI trees, or any clusterable custom service.
• JRun servers use the JINI technology to dynamically locate their peers in the cluster, eliminating the risk inherent to a single point of failure. (multi-casting)
JRun ClusteringJRun Clustering
Basic RequestBasic Request
JRUN Web Connector
JRUN
A
C
B
Web Server A
Internet
JRun ClusteringJRun Clustering
Basic RequestBasic Request1. The page request is received by the
Web Server.2. The Web Server passes a process
request to the JRun Web Connector.3. The JRun Web Connector passes the
process request to the JRun server instance running ColdFusion MX.
JRun ClusteringJRun Clustering
Basic RequestBasic Request• Single Point of Failure
– If any part of the infrastructure fails, the application goes offline.
JRun ClusteringJRun Clustering
Balanced RequestBalanced Request
Load Balancer
InternetJRUN Web Connector
JRUN
A
C
B
JRUN Web Connector
JRUN
A
C
B
Web Server A
Web Server B
JRun ClusteringJRun Clustering
Balanced RequestBalanced Request1. The page request is directed through
the load balancer to the Web Server.• Any available Web Server may handle
the request.
2. The Web Server passes a process request to the JRun Web Connector.
3. The JRun Web Connector passes the process request to the JRun server instance running ColdFusion MX.
JRun ClusteringJRun Clustering
Balanced RequestBalanced Request• Single Point of Failure
– The Load Balancer only creates redundancy within the Web Servers.
– During a ColdFusion MX failure users are redirected to a different ColdFusion MX instance.
• All session data is lost.– The Load Balancer is not always aware that
ColdFusion MX has failed.• Most load balancers are unable to monitor the health of
a server beyond the web server.• The load balancer will continue to forward requests
towards a slow running or hung ColdFusion MX server.– When a Web Server fails, a healthy ColdFusion
MX is no longer utilized (and vice-versa).
JRun ClusteringJRun Clustering
Clustered RequestClustered Request
Load Balancer
InternetJRUN Web Connector
JRUN
A
C
B
JRUN Web Connector
JRUN
A
C
B
Web Server A
Web Server B
In-Memory Session
Replication
JRun ClusteringJRun Clustering
Clustered RequestClustered Request1. Follows the same path to the JRun
Web Connector as the balanced request.
2. The JRun Web Connector forwards the process request to a JRun server instance running ColdFusion MX.
• Any available ColdFusion MX instance may handle the request.
JRun ClusteringJRun Clustering
Single Point of FailureSingle Point of Failure• The clustered infrastructure does not
have a single-point-of failure.
JRun ClusteringJRun Clustering
Except for the Load Balancer….
and every piece of networking equipment…
• In a clustered environment the parts of the infrastructure most likely to fail are redundant.
Coldfusion MX Server Administration
Coldfusion MX Server Administration
Creating A JRun ClusterCreating A JRun Cluster
Register Remote ServerRegister Remote Server1. Select Register Remote Server in the
JRunManagement Console.
2. Specify the Host Name, JRun Server Name and JNDI Port Number of the server you wish to register.
• Use the IP address of theremote server ratherthan the host name.
Creating A JRun ClusterCreating A JRun Cluster
Creating a ClusterCreating a Cluster1. Select Create a New Cluster in the JRun
Management Console.2. Specify the Cluster Name.3. Add Servers to the cluster. (Do not
include the admin server)4. Restart all servers
in the cluster.
Creating A JRun ClusterCreating A JRun Cluster
Session ReplicationSession ReplicationOn Web Application Overview page:1. Check Enable Session Replication2. Specify * as a New Replication
Buddy and click the Add button.3. Set persistence config to false in
the jrun-web.xml file.4. Restart the server.
Session replication does not work with
file-based session persistence.
Creating A JRun ClusterCreating A JRun Cluster
Web Application XMLWeb Application XML
<jrun-web-app><enable-jrun-web-services>false</enable-jrun-web-services><session-config>
<persistence-config><active>false</active>
</persistence-config><replication-config>
<active>true</active></replication-config>
</session-config><virtual-mapping>
<resource-path>/</resource-path><system-path>W:\CFMX7\Application</system-path>
</virtual-mapping><context-root>/</context-root><compile>false</compile><reload>false</reload><uri-character-encoding>UTF-8</uri-character-encoding>
</jrun-web-app>
<Application Folder>/ColdFusion/WEB-INF/jrun-web.xml
Creating A JRun ClusterCreating A JRun Cluster
Connecting A ClusterConnecting A Cluster1. Use the Web Server Configuration Tool to
connect the cluster to an external web server following the same process used to connect a single instance.
2. Select the cluster in JRun Serverdrop-down.
– Ensure that all members of the cluster are running before using the Web Server Configuration Tool.
– When using multiple NICs specify the local IP address of the NIC card under JRun Host
3. Restart all servers in the cluster.
Creating A JRun ClusterCreating A JRun Cluster
Testing A ClusterTesting A ClusterThe following ColdFusion code willoutput the JRun server instance name:
<cfoutput>
#createObject(‘java’, ‘jrunx.kernel.JRun’).getServerName()#
</cfoutput>
Creating A JRun ClusterCreating A JRun Cluster
ReferenceReference• Clustering ColdFusion MX for J2EE for JRun
http://www.macromedia.com/devnet/coldfusion/j2ee/articles/endtoend.html
• JRun Administrator’s Guidehttp://livedocs.macromedia.com/jrun/4/JRun_Administrators_Guide
• JRun Command-line Toolshttp://livedocs.macromedia.com/jrun/4/JRun_SDK_Guide/apis4.htm
Full-Day CourseFull-Day Course• ColdFusion Server Administration
– CFUnited Pre-Conference Course– June 26, 2006– North Bethesda Marriott– Additonal Topics
• JRun 4.5 (Cheeta)• Build servers and clusters• Performance Tuning
– My Birthday!
Coldfusion MX Server Administration
Coldfusion MX Server Administration
Q & A?Q & A?
top related