Deploying XBikes on Multiple Computers


This section describes how to install XBikes in a distributed environment, so that the Presentation tier, Business tier, and Data tier are installed on different computers.

Another configuration option is to set up the database on a separate computer. In this case, the configuration settings for the Data tier connection string must to be set appropriately to point to this computer.

Note

In a distributed setup, none of the in-memory adapters work. This is by design because they can work only when all three tier processes run on the same computer. For a .NET Framework-only setup, use the .NET Remoting adapters instead.

Identifying Requirements for Each Computer

This section describes the components that must be installed on each computer in a distributed environment before you install the XBikes application.

Presentation Tier Computer Setup

The Presentation tier computer requires the following components:

  • Windows Server 2003 or Windows 2000 Server with Service Pack 3 or later in Workgroup mode

  • .NET Framework 1.1

  • .NET Framework 1.1 SDK or Visual Studio 2003

  • Internet Information Service — World Wide Web Server

  • ASP.NET Application Server component (Windows 2003 only)

  • Microsoft Enterprise Instrumentation Framework (EIF)

  • JNBridgePro v1.4 Enterprise Edition (run time only)

Note

ASP.NET Session State Service should be running and its startup type should be set to automatic.

Installing XBikes on the Presentation Tier

To install XBikes on the presentation tier computer, complete the following steps.

To install XBikes on the Presentation tier computer

  1. Open Windows Explorer, and then double-click xbikes3tier.msi.

  2. On the xbikes3tier wizard page, click Next.

  3. On the Select Installation Folder page, make sure C:\Xbikes is the installation path, select the Everyone option to install XBikes for all users on the computer, and then click Next.

  4. On the Confirm Installation page, click Next.

  5. On the Install Options page, select Web Tier Only, and then click Next to continue.

  6. In the Winzip Self Extractor dialog box, make sure Unzip to folder is set to C:\xbikes, and then click Unzip.

  7. In the dialog box that shows how many files were unzipped successfully, click OK.

  8. In the Winzip Self-Extractor dialog box, click Close.

    The installation program continues the setup process for a few seconds.

  9. On the Installation Complete page, click Close.

Configuring XBikes on the Presentation Tier

The XBikes Web application uses .NET Remoting to communicate between the tiers when deployed across multiple machines. Before executing the application, you must change the configuration for .NET Remoting to point to the correct machine.

To configure the .NET Remoting on the Presentation tier

  1. Using Notepad, open the Remoting.config from the C:\Xbikes\Net\Xbikes-Web folder.

  2. Find the <wellknown> element, and then set its url attribute to the URL of the .NET Remoting Business tier service interface. You must set the server name to the name of the computer where the Business tier components are installed as shown in the following example.

     <wellknown   url="http://BusinessTierComputer/XBikes-BLL-RemotingServiceInterface/BLLRemotingServiceInterface.rem"   type="XBikes.BLL.ServiceInterface.Net.Remoting.BLLRemotingServiceInterface, XBikes-BLL-RemotingServiceInterface" /> 

  3. Save Remoting.config.

This completes the configuration of the Presentation tier computer.

Business Tier Computer Setup

The Business tier computer requires the following components:

  • Windows Server 2003 or Windows 2000 Server with Service Pack 3 or later in Workgroup mode

  • .NET Framework 1.1

  • .NET Framework 1.1 SDK or Visual Studio 2003

  • Internet Information Service — World Wide Web Server

  • ASP.NET Application Server component (Windows 2003 only)

  • Microsoft Enterprise Instrumentation Framework (EIF)

  • JNBridgePro v1.4 Enterprise Edition (run time only)

Installing XBikes on the Business Tier

To install XBikes on the Business tier computer complete the following steps.

To install XBikes on the Business tier computer

  1. Open Windows Explorer, and then double-click xbikes3tier.msi.

  2. On the xbikes3tier wizard page, click Next.

  3. On the Select Installation Folder page, make sure c:\xbikes is the installation path, select the Everyone option to install XBikes for all users on the computer, and then click Next.

  4. On the Confirm Installation page, click Next.

  5. On the Install Options page, select Business Logic Layer Only. Click Next.

  6. In the Winzip Self Extractor dialog box, make sure Unzip to folder is set to C:\xbikes, and then click Unzip.

  7. In the dialog box that shows how many files were unzipped successfully, click OK.

  8. In the Winzip Self-Extractor dialog box, click Close.

    The installation program continues the setup process for a few seconds.

  9. On the Installation Complete page, click Close.

Configuring XBikes on the Business Tier

The XBikes application is now installed on the Business tier computer. Before you execute the application, you will need to modify the identity of the COM+ to Network Service to allow the application to execute without the need for someone to be logged in. You will also have to configure .NET Remoting.

To configure the COM+ application on the Business tier

  1. In Control Panel, double-click Administrative Tools, and then double-click Component Services. The Component Services Manager loads.

  2. In the tree on the left, expand Component Services, expand Computers, and then expand My Computer.

  3. Expand COM+ Applications. A list of installed COM+ applications is shown in the tree view.

  4. Right-click XBikes, and then click Properties. The XBikes Properties dialog box appears.

  5. Click the Identity tab, and then click the Network Service option.

  6. Click OK. The XBikes Properties dialog box closes.

  7. Close Component Services Manager.

To configure .NET Remoting on the Business tier

  1. In Notepad, open the Remoting.config file. This file is located in the System32 directory located under the system folder, such as C:\Windows, of the computer hosting the Business tier components.

  2. Find the <wellknown> element, and set its url attribute to the URL of the .NET Remoting Data tier service interface. You must set the server name to the name of the computer where the Data tier components are installed as shown in the following example.

     <wellknown   url="http://DataTierComputer/XBikes-DAL-RemotingServiceInterface/DALRemotingServiceInterface.rem"   type="XBikes.DAL.ServiceInterface.Net.Remoting.DALRemotingServiceInterface, XBikes-DAL-RemotingServiceInterface" /> 

  3. Save Remoting.config.

This completes the configuration of the Business tier computer.

Data Tier Computer Setup

The Data tier computer requires the following components:

  • Windows Server 2003 or Windows 2000 Server with Service Pack 3 or later in Workgroup mode

  • .NET Framework 1.1

  • .NET Framework 1.1 SDK or Visual Studio 2003

  • Microsoft Message Queuing (also known as MSMQ)

  • Microsoft SQL Server 2000 with mixed mode security and Service Pack 3

  • Internet Information Service — World Wide Web Server

  • ASP.NET Application Server component (Windows 2003 only)

  • Microsoft Enterprise Instrumentation Framework (EIF)

Installing XBikes on the Data Tier

To install XBikes on the Data tier computer, complete the following steps.

To install XBikes on the Data tier computer

  1. Open Windows Explorer, and then double-click xbikes3tier.msi.

  2. On the xbikes3tier wizard page, click Next.

  3. On the Select Installation Folder page, make sure C:\Xbikes is the installation path, select the Everyone option to install XBikes for all users on the computer, and then click Next.

  4. On the Confirm Installation page, click Next.

  5. On the Install Options page, select Data Access Layer Only. Click Next.

  6. In the Winzip Self Extractor dialog box, make sure Unzip to folder is set to C:\xbikes, and then click Unzip.

  7. In the dialog box that shows how many files were unzipped successfully, click OK.

  8. In the Winzip Self-Extractor dialog box, click Close.

    The installation program continues the setup process for a few seconds.

  9. On the Installation Complete page, click Close.

Configuring XBikes on the Data Tier

The XBikes application is now installed on the Data tier. Before you can execute the application you must configure the queue and database connection settings. To perform the configuration, complete the following steps.

To configure the database connection string

  1. In Notepad, open the Dllhost.exe.config file from the C:\Windows\System32 folder.

  2. Find the start tag of the <SqlServer> element.

  3. Check to make sure the connection string includes the correct server name. The server name is shown in bold below to help you.

     <SqlServer>   <connection>     <add       key="connectionString"       value="server=localhost;database=xbikes;user id=dhb; password=bikes"     />   </connection> </SqlServer> 

    If you need to change the connection string, modify the value attribute appropriately.

  4. Locate the <QueueNames> tag. Change the NET-MSMQ value to include the correct IP address of your computer.

     <Queue>     <QueueNames>         <add key="NET-MSMQ" value="FormatName:DIRECT=TCP:192.168.0.5\Private$\XBikes-OrderQueue" /> 

  5. Save Dllhost.exe.config.

  6. Using Notepad, open XBikes-DAL-MSMQServiceInterface.exe.config from the C:\Xbikes\Net\Xbikes-Dal-Msmqserviceinterface\Bin\Debug folder.

  7. Repeat steps 2 through 4, and then save the file.

Running XBikes on Multiple Computers

To test the installation and execute XBikes complete the following steps on the Presentation tier computer.

To execute XBikes

  1. Load Internet Explorer.

  2. In the Address field, enter the URL http://localhost/XBikes-Web.

The XBikes Web application allows you to browse bikes by type, order bikes, change quantities, and check out your order.

When orders are written, they go to the message queue. To move orders from the .NET Message Queue into the SQL Server database, you must run a DOS console application. Complete the following steps on the Data tier computer.

To run the DOS console application

  1. Open a command prompt.

  2. Type cd /D C:\xbikes\net\xbikes-dal-msmqserviceinterface\bin\Debug, and then press ENTER.

  3. Execute XBikes-DAL-MSMQServiceInterface.exe. One message is read from the queue. The XML representation of the Order is displayed.

  4. If there are more messages on the queue press Y; otherwise press any other key to exit the application.




Application Interoperability. Microsoft. NET and J2EE
Application Interoperability: Microsoft .NET and J2EE: Microsoft(r) .Net and J2ee (Patterns & Practices)
ISBN: 073561847X
EAN: 2147483647
Year: 2003
Pages: 104

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net