0 оценок0% нашли этот документ полезным (0 голосов)
15 просмотров31 страница
Managing server group configuration Options (c) 2006 BEA Systems, Inc. Determine appropriate Data-Dependent Routing (DDR) criteria for a distributed Tuxedo application Configure the SERVICES and ROUTING sections to support DDR Determine and set the appropriate environment variables for DDR buffer types. Implement Server Group Migration for failover scenarios.
Managing server group configuration Options (c) 2006 BEA Systems, Inc. Determine appropriate Data-Dependent Routing (DDR) criteria for a distributed Tuxedo application Configure the SERVICES and ROUTING sections to support DDR Determine and set the appropriate environment variables for DDR buffer types. Implement Server Group Migration for failover scenarios.
Managing server group configuration Options (c) 2006 BEA Systems, Inc. Determine appropriate Data-Dependent Routing (DDR) criteria for a distributed Tuxedo application Configure the SERVICES and ROUTING sections to support DDR Determine and set the appropriate environment variables for DDR buffer types. Implement Server Group Migration for failover scenarios.
Configuration Options At the end of this module, you will be able to: Determine appropriate Data-Dependent Routing (DDR) criteria for a distributed Tuxedo application Configure the SERVICES and ROUTING sections to support DDR Determine and set the appropriate environment variables for DDR buffer types Implement Server Group Migration for failover scenarios Module 10 Managing Server Group Configuration Options-1 2006 BEA Systems, Inc. 290 Road Map 1. Data-Dependent Routing (DDR) DDR Use Case Scenario ROUTING Section Parameters Using RANGES for Server Group Mapping FML32 and VIEW32 Buffer Type Considerations 2. Server Group Migration Managing Server Group Configuration Options-2 2006 BEA Systems, Inc. 291 What Is Data-Dependent Routing? A mechanism whereby a service request is routed to a server within a specific group based on data in the request buffer Client passes data buffer with the service request; data buffer contains data fields Request is routed to a particular server group based on the value of a specific data field DDR is defined in the configuration; however DDR criteria can be dynamically updated while the application is running. Managing Server Group Configuration Options-3 2006 BEA Systems, Inc. 292 Data-Dependent Routing Example
OPEN CLOSE Group BANKB1 BRANCH: 1-4 ACCOUNT: 10000-49999 WITHDRAW DEPOSIT INQUIRY Client tpcall(WITHDRAW, FML w/ ACCOUNT 20000); Routing Fields: ACCOUNT BRANCH tpcall(OPEN, FML w/BRANCH 5); Group BANKB2 Group BANKB3
OPEN CLOSE BRANCH: 5-7 ACCOUNT: 50000-79999 WITHDRAW DEPOSIT INQUIRY OPEN CLOSE BRANCH: 8-10 ACCOUNT: 80000-109999 WITHDRAW DEPOSIT INQUIRY ACCT 1 tpcall(INQUIRY, FML w/ ACCOUNT 90001); TLR 4 ACCT 2 TLR 5 ACCT 3 TLR 6 Managing Server Group Configuration Options-4 2006 BEA Systems, Inc. 293 DDR Configuration The Big Picture *SERVICES WITHDRAW ROUTING=AccountID DEPOSIT ROUTING=AccountID INQUIRY ROUTING=AccountID OPEN ROUTING=BranchID CLOSE ROUTING=BranchID
*ROUTING AccountID BUFTYPE=FML32 FIELD=ACCOUNT RANGES=10000-49999:BANKB1, 50000-79999:BANKB2,80000-109999:BANKB3 BranchID BUFTYPE=FML32 FIELD=BRANCH RANGES=1-4:BANKB1,5-7:BANKB2,8-10:BANKB3 UBBCONFIG A ROUTING parameter is declared for each service that is to be routed A server within the selected Server Group will ultimately process the request DDR configuration based on the example presented in the previous slide: Managing Server Group Configuration Options-5 2006 BEA Systems, Inc. 294 Configuring the ROUTING Section DDR configuration requires editing the SERVICES and ROUTING sections. The FIELD must be contained within the request buffer sent by the client. Buffers must be of type FML, VIEW or XML The syntax of the ROUTING section is: ROUTING section syntax: *ROUTING CRITERIA-NAME BUFTYPE={FML|FML32|VIEW:subtype|VIEW32:subtype|XML},{..} FIELD=field_name RANGES=val1-val2:group1,val3-val4:group2,*:groupN FIELDTYPE={SHORT|LONG|FLOAT|DOUBLE|CHAR|STRING} UBBCONFIG Managing Server Group Configuration Options-6 2006 BEA Systems, Inc. 295 Use of the FIELDTYPE Parameter For XML buffers, you need to define the data type of the field which has been selected for DDR. The data type of FML and VIEW fields are already known. Use the FIELDTYPE parameter only when specifying a FIELD in an XML buffer type. STRING is the default ROUTING Section Example: *ROUTING OrderItem BUFTYPE=XML FIELD=ORDER/LINE/@ITEM FIELDTYPE=LONG RANGES= . . . UBBCONFIG Managing Server Group Configuration Options-7 2006 BEA Systems, Inc. 296 Specifying DDR Ranges Setting the RANGES parameter requires mapping values to valid Server Group names in the GROUPS section. The values must be appropriate to the data type of FIELD. Overlapping ranges allowed, but maps to the first group if both groups are available. The * can also be used as a default if no criteria is matched
ROUTING Section Example: *ROUTING CustBackup BUFTYPE=VIEW:customer FIELD=custID RANGES=1-50000:GROUP1,25000-75000:GROUP2,*:GROUP3 UBBCONFIG Managing Server Group Configuration Options-8 2006 BEA Systems, Inc. 297 Review: Buffer Usage in Tuxedo Client Process Server Process My Data STRING Buffer: Text Data CARRAY Buffer: Binary data bytes (transparent) ..011000. Fields: AccountId (string), MyBalance (float) Fields: Name, Street, City, State, ZipCode FML Buffer: Any pre- defined FML field (name/value) can be present in the buffer VIEW Buffer: All the defined fields (the C data structure) are always present <name> Harry Smith </name> XML Buffer (not in Tuxedo 6.5): Text data with data item tags Managing Server Group Configuration Options-9 2006 BEA Systems, Inc. 298 FML/FML32 and VIEW/VIEW32 Buffers FML and VIEW buffers are composed of fields that contain data For FML, there is no pre-determined list of fields that must be contained in the buffer. For VIEW, the fields are pre-determined and become the corresponding C-structure elements. Two versions: 16-bit and 32-bit FML, FML32; VIEW, VIEW32 32-bit versions are the most commonly used FML and VIEW fields are defined in files created by the application developer. Managing Server Group Configuration Options-10 2006 BEA Systems, Inc. 299 FML and VIEW Files FML files define the fields used in the application.
VIEW text files are compiled into binary files using specific file extensions: .V for UNIX or .vv for Windows
10 0101 1110 Example FML definition file: *base 2700 # name number type flags comments ACCOUNT 10 long - - ACCT_TYPE 11 char - - ADDRESS 12 string - - AMOUNT 13 float - - Optionally, VIEW struct members can be mapped to FML fields 10 0101 1110 Example VIEW text file: VIEW auditInfo #type cname fbname count flag size null_value long b_id - 1 - - 0 float balance AMOUNT 1 - - 0.0 string errmsg - 1 - 80 END ACCOUNT is assigned #2710 Managing Server Group Configuration Options-11 2006 BEA Systems, Inc. 300 Setting Environment Variables When booting the application, DDR criteria involving FML or VIEW buffer fields needs to be set in the BB. Field information is accessed through environment variables. FIELDTBLS32 Comma separated list of needed FML files FLDTBLDIR32 List of directories containing the files VIEWFILES32 Comma separated list of needed VIEW files VIEWDIR32 List of directories containing the files 10 0101 1110 FML32/VIEW32 settings in a Windows ENVFILE: FIELDTBLS32=acctFields,customerFields VIEWFILES32=audInfo.vv,custData.vv,order.vv FLDTBLDIR32=C:\appData\bank;C:\appData\general VIEWDIR32=C:\appData\bank;C:\appData\general In UNIX, use : to separate directories Managing Server Group Configuration Options-12 2006 BEA Systems, Inc. 301 Section Review Establish data-dependent routing criteria for a distributed application Configure the ROUTING section to support DDR Set the appropriate environment variables to support FML32 and VIEW32 buffer types In this section, we learned how to: Managing Server Group Configuration Options-13 2006 BEA Systems, Inc. 302 Road Map 1. Data-Dependent Routing (DDR) 2. Server Group Migration Server Migration Configuration Requirements Server Migration Administrative Tasks Managing Server Group Configuration Options-14 2006 BEA Systems, Inc. 303 Server Groups So far we have used server groups to: Group system or application servers together as an administrative convenience. Dynamically route service requests based on the content of the data in the request (DDR). There are two more uses for Server Groups: Transactions: configuring XA Transaction support (covered in the TRAN module). Server Migration: transferring servers (in groups) to be activated on another machine. Managing Server Group Configuration Options-15 2006 BEA Systems, Inc. 304 Server Migration The Tuxedo Administrator can configure the Tuxedo application and perform runtime operations to maintain availability with minimal service disruption. Enables planning for and recovery from failures or down-time associated with: Machine crashes or scheduled maintenance Network link failures partitioned machines Tuxedo application server failures Distributed transaction problems Managing Server Group Configuration Options-16 2006 BEA Systems, Inc. 305 Before Machine Failure Tuxedo Domain Machine A [Master] Group Red Server 1 Server 2 Server 3 Machine B Group Green Server 7 Server 8 Server 9 Machine C Group Black Server 13 Server 14 Server 15 Machine D Group Cyan Server 19 Server 20 Server 21 Managing Server Group Configuration Options-17 2006 BEA Systems, Inc. 306 After Machine Failure Tuxedo Domain Machine A [Master] Group Red Server 1 Server 2 Server 3 Machine B Group Green Server 7 Server 8 Server 9 Machine C Group Black Server 13 Server 14 Server 15 Machine D Group Cyan Server 19 Server 20 Server 21 DOWN Group Green Server 7 Server 8 Server 9 Managing Server Group Configuration Options-18 2006 BEA Systems, Inc. 307 Server Migration Scope Group Migration deactivation of a server group on a machine and subsequent reactivation on a backup machine. All server executables must be staged on the backup. Machine Migration migration of all servers in all groups on a machine to a backup machine. All server groups must be configured for migration to the same backup machine. Administrator uses tmadmin to perform migration: migg for group migration migm for machine migration Managing Server Group Configuration Options-19 2006 BEA Systems, Inc. 308 Migration Configuration Application must be MP model; OPTIONS must also specify MIGRATE Configure primary and backup LMIDs in the GROUPS section of the UBBCONFIG file Configure all servers in the group as RESTARTable *RESOURCES MODEL MP OPTIONS LAN,MIGRATE *GROUPS GROUP1 GRPNO=1 LMID=SITE1,SITE2 *SERVERS simpserv SRVGRP=GROUP1 SRVID=10 RESTART=Y SITE1 is the primary machine SITE2 is the backup machine UBBCONFIG Server is RESTARTable MODEL must be MP; OPTIONS must include MIGRATE Managing Server Group Configuration Options-20 2006 BEA Systems, Inc. 309 Group Migration Administration First, shut down the server group with the -R option: tmshutdown R g GROUP1 Once servers are shut down, the BB indicates that the servers in this group are dead, but migrating Next, use the migrategroup(migg) command of tmadmin to migrate server groups for this group of servers. Syntax for migrategroup(migg): migrategroup (migg) [-cancel] group_name
migrategroup(migg)example: > migg GROUP1 Managing Server Group Configuration Options-21 2006 BEA Systems, Inc. 310 Scheduled Server Group Migration If the servers are still running on the primary machine:
GROUP1 is now migrated! Binary TUXCONFIG is updated to reflect LMID=SITE2,SITE1 All servers in GROUP1 are now booted on SITE2 Example of a scheduled server migration:
C:\> tmshutdown -R -g GROUP1 Shutting down server processes... Server ID = 1 Group ID = GROUP1 machine = SITE1: shutdown succeeded 1 process stopped.
C:\> tmadmin
> migg GROUP1 migg successfully completed > quit
shutdown servers on the primary machine with tmshutdown -R execute tmadmin migrate group with migrategroup Managing Server Group Configuration Options-22 2006 BEA Systems, Inc. 311 Recovery Server Group Migration Example of a recovery server migration:
> boot -g GROUP1 Booting server processes ... exec simpserv -A : on SITE2 -> process id=22699 ... Started. 1 process started. > quit > migg GROUP1 migg successfully completed. C:\> tmadmin
> pclean SITE1 Cleaning the DBBL. Pausing 10 seconds waiting for system to stabilize. 3 SITE1 servers removed from bulletin board use pclean to update BB migrate group with migrategroup boot migrated servers on alternate machine execute tmadmin from MASTER machine If the primary machine has failed: (This example assumes that SITE1 is not the MASTER) Managing Server Group Configuration Options-23 2006 BEA Systems, Inc. 312 Machine Migration Administration First, shut down all servers with the -R option: tmshutdown R l SITE1 Once all servers are shutdown, the BB indicates that all of the servers are dead, but migrating. Next, use the migratemachine(migm) command of tmadmin to migrate all server groups on this machine to the backup machine. Syntax for migratemachine(migm): migratemachine (migm) [-cancel] LMID
migratemachine(migm)example: > migm SITE1 Managing Server Group Configuration Options-24 2006 BEA Systems, Inc. 313 Scheduled Machine Migration If the servers are still running on the primary machine:
SITE1 servers are now migrated! Binary TUXCONFIG is updated to reflect LMID=SITE2,SITE1 All servers in SITE1 are now booted on SITE2 Example of a scheduled machine migration:
C:\> tmshutdown -R -l SITE1 Shutting down server processes... Server ID = 1 Group ID = GROUP1 machine = SITE1: shutdown succeeded 1 process stopped.
C:\> tmadmin
> migm SITE1 migm successfully completed > quit
Shut down servers on the primary machine with tmshutdown -R execute tmadmin migrate all groups with migratemachine Managing Server Group Configuration Options-25 2006 BEA Systems, Inc. 314 Recovery Machine Migration Example of a recovery machine migration:
> boot -l SITE1 Booting server processes ... exec simpserv -A : on SITE2 -> process id=22699 ... Started. 1 process started. > quit > migm SITE1 migm successfully completed. C:\> tmadmin
> pclean SITE1 Cleaning the DBBL. Pausing 10 seconds waiting for system to stabilize. 3 SITE1 servers removed from bulletin board use pclean to update BB migrate all groups with migratemachine boot migrated servers on alternate machine execute tmadmin from MASTER machine If the primary machine has failed: (This example assumes that SITE1 is not the MASTER) Managing Server Group Configuration Options-26 2006 BEA Systems, Inc. 315 Canceling a Migration A migration cannot be cancelled after the migg or migm commands have been executed. If you wish to migrate back, just repeat the sequence of steps. Cancel a migration by using the cancel option of migg or migm , for example: migg cancel GROUP1 In effect, the cancel option merely cancels the R flag used earlier by tmshutdown. The server entries are now deleted from the BB. Managing Server Group Configuration Options-27 2006 BEA Systems, Inc. 316 Canceling a Migration Example Example use of cancel option to cancel a migration:
> quit > psr -g GROUP1 a.out Name Queue Name Grp Name ID RqDone Ld Done Current Service ---------- ---------- -------- -- ------ ------- --------------- simpserv 00001.00001 GROUP1 1 - - ( - ) > boot -g GROUP1 Booting server processes... exec simpserv -A: on SITE1 ->process id_27636 ... Started. 1 process started. > migg -cancel GROUP1 c:\> tmadmin tmadmin - Copyright 1987-1990 AT&T; 1991-1993 USL. ... > psr -g GROUP1 a.out Name Queue Name Grp Name ID RqDone Ld Done Current Service ---------- ---------- -------- -- ------ ------- --------------- simpserv 00001.00001 GROUP1 1 - - (DEAD MIGRATING) > psr -g GROUP1 TMADMIN_CAT:121: No such server We just did a tmshutdown -R -g GROUP1 There are no active GROUP1 servers We reboot servers in GROUP1 We cancel migration Managing Server Group Configuration Options-28 2006 BEA Systems, Inc. 317 Section Review Configure the UBBCONFIG to enable Server Group Migration Execute the administrative tasks required for migrating groups of servers or machine failover In this section, we learned how to: Managing Server Group Configuration Options-29 2006 BEA Systems, Inc. 318 Lab Exercise For details on the exercise, refer to the Lab Guide. If questions arise, ask the instructor. The instructor will determine the stop time. Lab 11 SRVG: Configure Data-Dependent Routing and Server Group Migration Managing Server Group Configuration Options-30 2006 BEA Systems, Inc. 319 Module Review Determine appropriate Data-Dependent Routing (DDR) criteria for a distributed application Configure the SERVICES and ROUTING sections Determine and set the appropriate environment variables for DDR buffer types Implement Server Group Migration for failover scenarios In this module, we learned how to: Managing Server Group Configuration Options-31