D83175GC10_ag.pdf
118
0
0
Full text
(2) Disclaimer This document contains proprietary information and is protected by copyright and other intellectual property laws. You may copy and print this document solely for your own use in an Oracle training course. The document may not be modified or altered in any way. Except where your use constitutes "fair use" under copyright law, you may not use, share, download, upload, copy, print, display, perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the express authorization of Oracle. The information contained in this document is subject to change without notice. If you find any problems in the document, please report them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not warranted to be error-free. Restricted Rights Notice If this documentation is delivered to the United States Government or anyone using the documentation on behalf of the United States Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or disclose these training materials are restricted by the terms of the applicable Oracle license agreement and/or the applicable U.S. Government contract. Trademark Notice Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.. Author Bill Bell Technical Contributors and Reviewers Jose Alvarez, Maria Billings, Mark Lindros, Takyiu Liu, Will Lyons, Serge Moiseev, TJ Palazzolo, Madhavi Siddireddy, Matthew Slingsby, Kevin Tate Editors Raj Kumar, Anwesha Ray Graphic Designer Rajiv Chandrabhanu Publishers Nita Brozowski,Sujatha Nagendra, Michael Sebastian This book was published using:. Oracle Tutor. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Copyright © 2014, Oracle and/or its affiliates. All rights reserved..
(3) Practices for Lesson 1: Course Overview .....................................................................................................1-1 Practices for Lesson 1: Overview ...................................................................................................................1-2 Practices for Lesson 2: Troubleshooting: Overview ....................................................................................2-1 Practices for Lesson 2: Overview ...................................................................................................................2-2 Practice 2-1: Accessing and Setting Up the Practice Environment ................................................................2-3 Practice Solution: Accessing and Setting Up the Practice Environment ........................................................2-7 Practice 2-2: <OPTIONAL> Running RDA .....................................................................................................2-8 Practice Solution: <OPTIONAL> Running RDA .............................................................................................2-13 Practices for Lesson 3: WebLogic Server Diagnostic Framework: Overview ............................................3-1 Practices for Lesson 3: Overview ...................................................................................................................3-2 Practice 3-1: Harvesting Diagnostic Metrics ...................................................................................................3-3 Practice Solution: Harvesting Diagnostic Metrics ...........................................................................................3-10 Practice 3-2: Monitoring Diagnostic Metrics ...................................................................................................3-11 Practice Solution: Monitoring Diagnostic Metrics ...........................................................................................3-13 Practices for Lesson 4: Diagnostic Instrumentation ....................................................................................4-1 Practices for Lesson 4: Overview ...................................................................................................................4-2 Practice 4-1: Configuring and Monitoring Diagnostic Events .........................................................................4-3 Practice Solution: Configuring and Monitoring Diagnostic Events ..................................................................4-8 Practice 4-2: Tracing a Client Request ...........................................................................................................4-9 Practice Solution: Tracing a Client Request ...................................................................................................4-13 Practices for Lesson 5: JVM Troubleshooting ..............................................................................................5-1 Practices for Lesson 5: Overview ...................................................................................................................5-2 Practice 5-1: Troubleshooting a JVM .............................................................................................................5-3 Practice Solution: Troubleshooting a JVM .....................................................................................................5-10 Practices for Lesson 6: Troubleshooting Servers ........................................................................................6-1 Practices for Lesson 6: Overview ...................................................................................................................6-2 Practice 6-1: Investigating Server Problems ..................................................................................................6-3 Practice Solution: Investigating Server Problems...........................................................................................6-10 Practices for Lesson 7: Troubleshooting Applications ................................................................................7-1 Practices for Lesson 7: Overview ...................................................................................................................7-2 Practice 7-1: Investigating Application Problems ...........................................................................................7-3 Practice Solution: Investigating Application Problems....................................................................................7-7 Practices for Lesson 8: Troubleshooting JDBC ............................................................................................8-1 Practices for Lesson 8: Overview ...................................................................................................................8-2 Practice 8-1: Investigating JDBC Problems ...................................................................................................8-3 Practice Solution: Investigating JDBC Problems ............................................................................................8-8 Practices for Lesson 9: Troubleshooting Node Manager .............................................................................9-1 Practices for Lesson 9: Overview ...................................................................................................................9-2 Practice 9-1: Investigating Node Manager Problems .....................................................................................9-3 Practice Solution: Investigating Node Manager Problems .............................................................................9-7 Practices for Lesson 10: Troubleshooting Clusters .....................................................................................10-1 Practices for Lesson 10: Overview .................................................................................................................10-2 Practice 10-1: Investigating Proxy Problems ..................................................................................................10-3 Practice Solution: Investigating Proxy Problems ............................................................................................10-8 Practice 10-2: Investigating Cluster Replication Problems .............................................................................10-9 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Oracle WebLogic Server 12c: Troubleshooting Workshop Table of Contents i. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Table of Contents.
(4) Practices for Lesson 11: Troubleshooting Security .....................................................................................11-1 Practices for Lesson 11: Overview .................................................................................................................11-2 Practice 11-1: Troubleshooting Changes by Using Auditing ..........................................................................11-3 Practice Solution: Troubleshooting Changes by Using Auditing ....................................................................11-7 Practice 11-2: <OPTIONAL> Recovering the Lost Admin Password .............................................................11-8 Practice Solution: <OPTIONAL> Recovering the Lost Admin Password .......................................................11-11. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practice Solution: Investigating Cluster Replication Problems .......................................................................10-13. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Oracle WebLogic Server 12c: Troubleshooting Workshop Table of Contents ii.
(5) THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Chapter 1. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1: Course Overview. Chapter 1 - Page 1. Oracle University and In Motion Servicios S.A. use only. Practices for Lesson 1: Course Overview.
(6) Practices Overview There are no practices for this lesson.. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practices for Lesson 1: Overview. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 1: Course Overview Chapter 1 - Page 2.
(7) Chapter 2. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Troubleshooting: Overview Chapter 2 - Page 1. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practices for Lesson 2: Troubleshooting: Overview.
(8) Practices Overview In these practices, you access your practice environment and run some scripts to set up the WebLogic Server domain. There is also an optional practice to run the Oracle Remote Diagnostic Agent. The practice environment consists of your main computer, which is referred to as the “gateway machine,” and two Linux hosts, known as “host01” and “host02.” You access the Linux hosts from the gateway machine by using VNC Viewer. Here is a diagram of the setup, and what will be running on each host:. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Troubleshooting: Overview Chapter 2 - Page 2. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practices for Lesson 2: Overview.
(9) Overview In this practice you access your practice environment for the first time. You also run some scripts to set up the WebLogic Server domain. Finally, you use the administration console to investigate the domain. Here is a diagram of the domain the scripts create:. Assumptions You are sitting at your classroom machine or have been assigned a remote machine.. Tasks 1.. Access host01. a. From your gateway machine, double-click the VNC Viewer - host01 icon on the desktop. You connect to host01 as the oracle user. The Username field is not displayed. Enter oracle in the Password field (it is displayed as ******) and press the Enter key.. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Troubleshooting: Overview Chapter 2 - Page 3. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practice 2-1: Accessing and Setting Up the Practice Environment.
(10) 2.. Unless stated otherwise, you will be working within the VNC session of host01 for the remainder of this practice. Run the scripts to set up your domain. a. Open a Terminal window. Note: There is a launcher for a Terminal window in the panel at the top of the desktop.. b.. Navigate to /practices/tshoot/practice02-01. $> cd /practices/tshoot/practice02-01. Note: − The files you need for all the practices are found under /practices/tshoot.. c.. − Remember that you can use the Tab key to auto-complete directory and file names as you type them Run the main script, setup.sh, which calls the other scripts that set up the WebLogic Server domain. $> ./setup.sh. Important Note: These scripts will take a few minutes to complete. As they run they will print informational messages to the Terminal window. Don’t worry if there is sometimes a pause in the messages. Be patient and let all the scripts run. The command prompt will return when all the scripts have completed their work. These are the scripts that are called: − 1-createdomain.sh: This script calls the WLST script create_domain.py, which creates a domain called wlsadmin in the directory /u01/domains/tshoot. The WLST script configures the domain with an administration server running on host01.example.com on port 7001. It also defines a cluster named cluster1, which includes two managed servers: server1 running on host01.example.com on port 7011, and server2 running on host02.example.com, also on port 7011. − 2-packdomain.sh: This script runs the pack utility to create a managed server template based on the new domain. The template file is named wlsadmin.jar and placed in the /tmp directory. − 3-copydomain.sh: This script uses secure copy to copy the template file over to host02. It then uses secure shell to call the unpack script on host02. − 4-unpackdomain.sh: This script runs on host02 and calls the unpack utility to create a copy of the domain on this host. − 5-startnodemanagers.sh: This script first calls the Node Manager start script on host01, and then uses secure shell to call the Node Manager start script on host02.. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Troubleshooting: Overview Chapter 2 - Page 4. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. b..
(11) 3.. − 6-ohs.sh: This script copies the OHS configuration file, mod_wl_ohs.conf (configuring OHS to be the proxy for the domain’s cluster), from the practice directory over to the configuration directory of an OHS instance. It then uses opmnctl to start that OHS instance. After OHS starts, the script calls opmnctl again to print out the status. You should see that the instance of OHS, called ohs1, is “Alive” and running HTTP on port 7777. Take note of some utility scripts available to you. a. In a Terminal window, navigate to /practices/tshoot/utilities. See what scripts are there. $> cd /practices/tshoot/utilities $> ls The utility scripts are: − killallnodemanagers.sh: This script calls the killnodemanager.sh script twice: first on host01 and then, by using ssh, on host02. − killnodemanager.sh: This script finds the process ID of the Node Manager process running on a host and kills that process. − startadmin.sh: This script calls the domain script to start the administration server, if the administration server is not already running. − startallnodemanagers.sh: This script calls the startnodemanager.sh script twice: first on host01 and then, by using ssh, on host02.. b.. 4.. − startnodemanager.sh: This script calls the script to start the Node Manager on a machine, if it is not already running. If you want to look at these scripts, you can open them by using the gedit editor. If you do this, please ensure you close the editor without making any changes to the scripts. For example, if you want to look at the script that starts the admin server: $> gedit startadmin.sh. Note: Exit the editor by selecting File > Quit. c. Close the Terminal window. d. Exit the VNC Viewer. Use the web browser on the gateway machine to access the WebLogic Server administration console. Use the administration console to start the managed servers and look around at the domain. a. If the VNC Viewer is still open, close it. Note: Although you can use a web browser on one of the host machines to access the administration console, there is no need to access either host machine when you need the administration console, because you can use the web browser on the gateway machine. b. On the gateway machine, double-click the Mozilla Firefox icon on the desktop. Note: You can make Firefox your default browser if you want to. c. When the web browser opens, enter the URL for the administration console: http://host01.example.com:7001/console Note: The URL for the administration console is the host and port of the administration server followed by the context path of the admin console application. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Troubleshooting: Overview Chapter 2 - Page 5. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. − startadmin.sh: This script, in the /practices/tshoot/utilities directory, calls the domain script to start the administration server..
(12) e. f. g. h. i.. j. k.. On the welcome page, enter the Username of weblogic and the Password of Welcome1. Then click the Login button. Note: You can have Firefox remember the password if you want to. In the Domain Structure, expand Environment and select Servers. Click the Control tab. Select the check boxes next to server1 and server2. Then click the Start button. When asked whether you are sure, click Yes. Wait a moment, and refresh the browser. Wait until both managed servers have the state of RUNNING. Use the administration console to view the servers, machines, and clusters defined in the domain. Answer the following questions: − What ports are the servers running on? − Which servers are on which machines? − What address and port does each Node Manager run on? Hint: Remember that a Node Manager configuration is under a machine’s configuration. − What messaging mode does the cluster use? Log out of the administration console. Close the web browser.. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Troubleshooting: Overview Chapter 2 - Page 6. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. d..
(13) There is no solution for this practice.. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practice Solution: Accessing and Setting Up the Practice Environment. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Troubleshooting: Overview Chapter 2 - Page 7.
(14) Overview In this practice, you run the Oracle Remote Diagnostic Agent. You then view some of its output. This practice can be performed at any time during the course, whenever you have extra time.. Assumptions You completed “Practice 2-1: Accessing and Setting Up the Practice Environment” and the domain has been successfully created. All instances of WebLogic Server are running.. Tasks 1.. 2.. Access host01. a. From your gateway machine, double-click the VNC Viewer - host01 icon on the desktop. You connect to host01 as the oracle user. The Username field is not displayed. Enter oracle in the Password field (it is displayed as ******) and press the Enter key. Run the RDA utility to create a configuration file. a. Open a Terminal window, and run the domain’s script to set up environment variables. $> /u01/domains/tshoot/wlsadmin/bin/setDomainEnv.sh b.. Navigate to the location of the RDA utility. $> cd /u01/app/fmw/oracle_common/rda. c.. Run RDA with the WebLogic Server profile to set up your configuration file. $> ./rda.sh –Sp WebLogicServer -------------------------------------------S00INI: Initializes the Data Collection -------------------------------------------RDA uses the output file prefix... ... Note: As RDA asks questions or gives commands, you type your response and press the Enter key. To accept the default, just press the Enter key. See the table in the next step for the proper responses. d. Use this table to answer the RDA questions and commands: Step. Question / Command. Response. a.. Enter the prefix to be used for all the generated files.. (press Enter for the default of RDA). b.. Enter the directory used for all the files to be generated.. /home/oracle/rda_output. c.. Do you want to keep report packages from previous runs (Y/N)?. (press Enter). d.. Enter the Oracle home to be used for data analysis.. /u01/app/fmw. e.. Enter the network domain name for this. example.com. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Troubleshooting: Overview Chapter 2 - Page 8. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practice 2-2: <OPTIONAL> Running RDA.
(15) Question / Command. Response. server. f.. Do you want RDA to perform the network ping tests (Y/N)?. (press Enter). g.. Enter the location of the directory where the domains to analyze are located.. /u01/domains/tshoot. h.. Data Collection Type: 1. Collect for a single server (offline mode) 2. Collect for a single server (…) 3. Collect for multiple servers (…) Enter the item number.. 3. i.. … Enter the number corresponding to the domain directory name, or * to select all domains, or . to terminate the list.. *. j.. … Enter the number corresponding to the server directory name, or * to select all servers, or . to terminate the list.. *. k.. Enter the username for the Oracle WebLogic Server connection for ‘wlsadmin’ domain.. weblogic. l.. Are custom scripts used to start Oracle WebLogic Servers (Y/N)?. (press Enter). m.. Enter the maximum number of thread dumps to capture when a data collection module requires online collections.. 2. n.. Enter the interval (in milliseconds) between the thread dumps.. (press Enter). e.. 3.. Verify that the configuration file has been created. $> ls setup.cfg setup.cfg Run RDA again to collect data. a. In the same Terminal window, run RDA again. $> ./rda.sh -------------------------------------------RDA Data Collection Started ... -------------------------------------------Processing ... b. Various messages print out. Eventually RDA will ask for a password. Enter Welcome1 each time and press Enter. Enter 'weblogic' user password for 'wlsadmin' domain: Welcome1 Please re-enter it to confirm: Welcome1 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Troubleshooting: Overview Chapter 2 - Page 9. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Step.
(16) 4.. You can review the reports by ... ... $> View the RDA output. a. In the same Terminal window, list the contents of the output directory. $> cd /home/oracle/rda_output $> ls Note: Many, many files and directories are present. One of them is the archive file, RDA.RDA_host01.zip. Also notice the main HTML page, RDA__start.htm. b. View the starting page of the HTML output by using the Firefox web browser (there are two underscore characters in the file name). $> firefox RDA__start.htm. Note: Notice the main index at the top left. The overview links are currently at the bottom left. The main overview is in the display area. Ignore any messages in the Terminal window. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Troubleshooting: Overview Chapter 2 - Page 10. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Note: The password is not displayed. c. Wait for RDA to collect data. This may take several minutes. When RDA is finished, it prints out that the data collection is finished and the prompt returns. ... Processing ... -------------------------------------------RDA Data Collection Ended ... --------------------------------------------.
(17) The top part of the index has links that show the machine’s configuration.. d.. The part under “Oracle WebLogic Server” has links for WebLogic Server data.. Note: − The “Oracle WebLogic Server Overview” link has installation information such as the version and patches applied. − The “Domain” link has links to domain scripts and configuration files. − The individual server links contain server information including log files, deployed application deployment descriptors, diagnostic images, and thread dumps. e. Select the link in the main index called ‘server1’ Server. Click some links in the ‘server1’ Server frame (below the “Main Index”). Try some such as:. 5.. − server1.state (under $SH/data/nodemanager) Note: This is the state of the server as kept by Node Manager. − server1.log (under Log Files) Note: This is the latest server log. − JVM Runtime (WLST Collections > Server Runtime) Note: This is information about the JVM under which this server is running. f. Click around other areas as you have time and interest. Clean up. a. Close the web browser on host01. b. Return to the host01 Terminal window. c. Remove the rda_output directory. $> cd /home/oracle $> rm –rf rda_output Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Troubleshooting: Overview Chapter 2 - Page 11. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. c..
(18) Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Warning: This command permanently deletes a directory, all its subdirectories, and files. Use with caution. d. Close the Terminal window. e. Exit the VNC Viewer.. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Troubleshooting: Overview Chapter 2 - Page 12.
(19) There is no solution for this practice.. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practice Solution: <OPTIONAL> Running RDA. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Troubleshooting: Overview Chapter 2 - Page 13.
(20) Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 2: Troubleshooting: Overview Chapter 2 - Page 14.
(21) Chapter 3. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 3: WebLogic Server Diagnostic Framework: Overview Chapter 3 - Page 1. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practices for Lesson 3: WebLogic Server Diagnostic Framework: Overview.
(22) Practices Overview In these practices you set up WebLogic Diagnostic Framework harvesters, watches, and notifications. You also use the Monitoring Dashboard to view diagnostic information as charts and graphs.. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practices for Lesson 3: Overview. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 3: WebLogic Server Diagnostic Framework: Overview Chapter 3 - Page 2.
(23) Scenario Users have reported intermittent database problems with the contacts application. Before you speak to the development team, you decide to gather some data. The WebLogic Server Diagnostics Framework (WLDF) allows you to collect and record server and application metrics over time for later analysis. WLDF also supports watch conditions that can trigger notifications, such as posting a JMS message or capturing a diagnostic image.. Overview In this practice you configure some archive policies. You also create a new system-level WLDF diagnostic module. In that module you configure metric collectors (harvesters) for several MBean types, trigger notifications under various MBean watch conditions, and access diagnostic archives to inspect recorded metrics.. Assumptions You completed “Practice 2-1: Accessing and Setting Up the Practice Environment” and the domain has been successfully created. All instances of WebLogic Server are running.. Tasks 1.. 2.. Access host02 and run the database setup script. a. From your gateway machine, double-click the VNC Viewer - host02 icon on the desktop. You connect to host02 as the oracle user. The Username field is not displayed. Enter oracle in the Password field (it is displayed as ******) and press the Enter key. b. Open a Terminal window, navigate to the current practice directory and run the database setup script, initdatabase.sh. $> cd /practices/tshoot/practice03-01 $> ./initdatabase.sh Note: − You run the script on host02 because that is where the database is running. − This script calls a SQL*Plus script that initializes the database. Note that this script first drops the sequence and table it creates, so it can be run multiple times. Therefore, the first time it runs you will see messages that the sequence and table do not exist. Ignore those messages. c. Close the Terminal window. d. Exit the host02 VNC Viewer. Access host01 and run the main setup script. a. From your gateway machine, double-click the VNC Viewer - host01 icon on the desktop. You connect to host01 as the oracle user. The Username field is not displayed. Enter oracle in the Password field (it is displayed as ******) and press the Enter key. Note: You access the two Linux hosts from the gateway machine many times in these practices. Rather than give specific directions each time, in this and subsequent practices it will be assumed you know what to do if you are instructed to “access host01” or “access host02.” Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 3: WebLogic Server Diagnostic Framework: Overview Chapter 3 - Page 3. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practice 3-1: Harvesting Diagnostic Metrics.
(24) Open a Terminal window, navigate to the current practice directory and run the setup script, setup.sh. $> cd /practices/tshoot/practice03-01 $> ./setup.sh. This script calls: − A WLST script to create a data source called datasource1 − A WLST script to deploy a web application that uses the data source − A WLST script that sets up a JMS Server, a JMS module, and a JMS queue (for WLDF notifications) Note: − Ignore any messages about connecting to the admin server with an insecure protocol. In the classroom, it does not matter that you access the admin server through a nonsecure port.. 3.. − Also ignore the message about WLContext.close() being called in a different thread. This message always appears when you deploy with WLST and does not have any real effect. − Wait until all the scripts run, and the prompt returns, before continuing. c. Close the Terminal window. d. Minimize the host01 VNC Viewer to use later. Access the WebLogic Server administration console from the gateway machine. a. On your gateway machine’s desktop, double-click the Mozilla Firefox web browser icon. b. In the web browser, enter the URL to the administration console: http://host01.example.com:7001/console c.. 4.. On the console welcome page, enter the Username as weblogic and Password as Welcome1. Then click the Login button.. Note: You access the administration console from the gateway machine web browser many times in these practices. Rather than give specific directions each time, in this and subsequent practices, it will be assumed you know what to do when you are instructed to “use (or access) the administration console.” Check the type and location of the WLDF diagnostic archives. Set the maximum size of a server’s archive file. Set a server’s archive retirement policy. a. In the Domain Structure, expand Diagnostics (click the “+” sign) and then select Archives. Note: In this and subsequent practices, the instructions for accessing something in the Domain Structure will be abbreviated. For this case, the abbreviation is: In the Domain Structure, select Diagnostics > Archives. b. Notice the type of archive and their location for each server. The default archive type is a file store archive. c. Select server1 in the table. Under the Configuration tab, you can see that the Type of archive is a File Store. Note: The other type of archive is a database archive. In the admin console a database archive displays its type as JDBC. d.. You want to make a change to the configuration, so lock it. In the Change Center, click the Lock & Edit button. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 3: WebLogic Server Diagnostic Framework: Overview Chapter 3 - Page 4. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. b..
(25) To save disk space, you decide to limit the size of this server’s archive file to 50 megabytes. Set the Preferred Store Size to 50.. f. g.. Save this change by clicking the Save button. Activate the changes by clicking the Activate Changes button in the Change Center. Note: You will make changes to the domain configuration many times in these practices. In this and subsequent practices, it will be assumed you no longer need specific directions when you are instructed to “lock the configuration,” “save changes,” or “activate changes.” Because you do not want to keep harvested diagnostic archive information forever, you want old data to be retired. Scroll down and notice that the default is for Data Retirement Enabled to be selected. Create a new data retirement policy for harvested data. Scenario: You want to retire harvested archive data after two days, start the first retirement task at midnight, and run the retirement task every 8 hours. Lock the configuration again. Click the New button above the Data Retirement Policies table. Use the table below to fill in the information for the policy, and then click OK.. h.. i.. j.. Step. 5.. Field. Choice or Value. a.. Name. retirement-policy-1. b.. Archive Name. HarvestedDataArchive. c.. Retirement Age. 48. d.. Retirement Time. 0. e.. Retirement Period. 8. f.. Enabled. Selected. k. Activate the changes when you are done. Check the location of diagnostic images for server1 (running on host01). As a first step in gathering information, perform an “on demand” capture of a diagnostic image. a. Return to the Domain Structure and select Diagnostics > Diagnostic Images. Notice the location of diagnostic images for all the servers, particularly server1. b. Select the option button next to server1 and click the Capture Image button. c. When you capture a diagnostic image, you are allowed to change the destination directory and timeout. (The timeout specifies how long WebLogic Server waits, in minutes, in between diagnostic image captures.) Make note of the location of diagnostic images. Leave the defaults as they are and click OK. d. Minimize the web browser to use later.. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 3: WebLogic Server Diagnostic Framework: Overview Chapter 3 - Page 5. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. e..
(26) Access host01. Use the File Browser on host01 to navigate to the location where the image was saved: /u01/domains/tshoot/wlsadmin/servers/server1/logs/ diagnostic_images. Tip: The File Browser can be found in the panel under Applications > System Tools. Once it opens, click File System under the Places panel to start your navigation.. f.. In the File Browser, right-click the .zip file (its name starts with “diagnostic_image_”). Select Open with Archive Mounter. Then in the Places panel of the File Browser (on the left), select the “drive” that has the same name as the zip file. Note: The information stored in the diagnostic image zip file is saved in various XML files. Most have the extension of .img.. g.. Look at the contents of the image.summary file. Right-click it and select Open with gedit. Note: If not given that choice in the pop-up menu, select Open with Other Application. Then select gedit and click the Open button. In this file, can you find the operating system and version? Can you find under which JVM WebLogic Server is running? Tips: Use the Search > Find menu option to search for os.name and os.version. Then search for java.vendor and java.version.. h.. i.. 6.. Return to the File Browser and open the JDBC.img file with gedit to look at its contents. Note: Notice the information about the data source called datasource1. j. Close the editor when you are finished. k. In the File Browser, right-click the “drive” that represents the zip file. Select Unmount. l. Close the File Browser. m. Minimize the VNC Viewer to use later. Create a new diagnostic system module. Note: To create harvesters (metric collectors), watches, and notifications, you first create a diagnostic module to contain them. a. Return to the administration console and lock the configuration. b. In the Domain Structure, select Diagnostics > Diagnostic Module. c. Click the New button. d. Give the module the Name server1-diagnostics. Then click OK. e.. Edit the new module. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 3: WebLogic Server Diagnostic Framework: Overview Chapter 3 - Page 6. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. e..
(27) c. d.. Click the New button. Leave the MBean Server location as ServerRuntime and click Next.. e.. Note: Because this diagnostic module is targeted to a managed server, only the Server Runtime MBeans apply. Ensure that Select an MBean Type from the following list is selected. From the drop-down list, select the weblogic.management.runtime. JDBCConnectionPoolRuntimeMBean. Click Next.. f.. 8.. Move the following attributes from the Available column to the Chosen column: − ActiveConnectionsCurrentCount (the number of connections currently in use by applications) − CurrCapacity (the current count of JDBC connections in the connection pool in the data source) − LeakedConnectionCount (the number of leaked connections) Note: A leaked connection is a connection that was reserved from the data source but was not returned to the data source. g. Click Next. h. Note the available values for Collected Instances, but make no selection. Note: If you do not identify specific MBean instances, WLDF collects the selected attributes from all available instances. i. Click Finish. j. Do not activate changes yet. Create a diagnostic notification. a. Click the Configuration > Watches and Notifications tabs of the diagnostic module. b. Scroll down and click the Notifications tab. c. Click the New button. d. For the Type field, select the JMS Message option. Click Next e. f.. Enter jms-notification as the Notification Name. Ensure that Enable Notification is selected. Click Next. Enter the following values and then click Finish: Step. Field. Choice or Value. a.. JMS Destination JNDI Name. wldfnotificationqueue. b.. Connection Factory. weblogic.jms.XAConnectionFactory. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 3: WebLogic Server Diagnostic Framework: Overview Chapter 3 - Page 7. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. 7.. Tip: Click the name of the module in the table. f. Click the Targets tab. g. Select server1 (under cluster1) and click Save. Note: Make sure you select server1. It may not be the first server in the list under cluster1. When you select it, cluster1 and Part of the cluster are automatically selected. h. Do not activate changes yet. Define a metric collector (harvester) in the diagnostic module. a. Click the Configuration > Collected Metrics tabs of the diagnostic module. b. Set the Sampling Period to 10000 (10 seconds) and click Save..
(28) 9.. Field JNDI Name. Choice or Value. Note: Be sure you type these values exactly as shown. g. Do not activate changes yet. Create a diagnostic watch. a. Scroll down and click the Watches tab near the bottom of the Watches and Notifications screen. Then click New. b. Enter jdbcwatch for the Watch Name. Confirm that the Watch Type is Collected Metrics. Confirm that Enable Watch is selected. Click Next. c. d.. Click the Add Expressions button. Ensure ServerRuntime is selected and click Next.. e.. Ensure that Select an MBean Type from the following list is selected. From the drop-down list, select the same weblogic.management.runtime. JDBCConnectionPoolRuntimeMBean that is being collected and click Next.. f. g.. Click Next to watch all instances of this MBean. Enter or select the following values and then click Finish: Step. h. i.. Field. Value. a.. Message Attribute ActiveConnectionsCurrentCount. b.. Operator. >. c.. Value. 0. Click Next. Select the Use a Manual Reset Alarm option and click Next.. j.. Move the jms-notification option from the Available column to the Chosen column. k. Click Finish. l. Activate the changes. m. Minimize the web browser. You will be using the admin console later. 10. Trigger WLDF notifications. a. Return to the VNC Viewer for host01. Open a Terminal window and navigate to the current practice directory. Run the script that runs a client that accesses the database, runclient.sh. The client will ask you to press Enter when you want to stop it. Do not do that yet. $> cd /practices/tshoot/practice03-01 $> ./runclient.sh ... This client is still running... When you are ready to stop it, press Enter. Note: This runs a stand-alone Java class that opens connections to the database but does not close them. Wait a minute before proceeding to the next step. b. Do not close the Terminal window. c. Minimize the VNC Viewer. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 3: WebLogic Server Diagnostic Framework: Overview Chapter 3 - Page 8. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Step.
(29) c.. Select the resource (queue) wldfnotificationqueue.. d. e.. Select the Monitoring tab. Notice that there is a message in the queue (Messages Current). You could select the queue and click the Show Messages button, but the message is not a text message, so viewing it by using the admin console is not very interesting. From the Domain Structure panel, select Diagnostics > Log Files. Locate and select the HarvestedDataArchive log file for the server1 server. Click View. Click the Customize this table link. For Time Interval, ensure that Last 5 Minute(s) is selected. Note: This may need to be increased, if you did not just run the client. Under Column Display, update the Chosen column to contain only these fields: − Date − Attribute − Value For Number of rows displayed per page, select 100.. f. g. h. i. j. k.. l.. m. Click Apply. n. Browse the harvester entries. You may need to scroll through a few pages to get to the JDBC connection pool metrics after the client was running. Verify that the MBean attributes are being collected approximately every 10 seconds. 12. Stop the database client. a. Return to the VNC Viewer for host01. b. Find the Terminal window where the database client is running. Press Enter. c. Close the Terminal window. d. Exit the VNC Viewer.. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 3: WebLogic Server Diagnostic Framework: Overview Chapter 3 - Page 9. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. 11. View the notification and collected metrics by using the admin console. a. Access the admin console. In the Domain Structure select Services > Messaging > JMS Modules. b. Select the module called jmsmodule1..
(30) Perform the following tasks if you did not do this practice and want to use the finished solution.. Assumptions You completed “Practice 2-1: Accessing and Setting Up the Practice Environment” and the domain has been successfully created. All instances of WebLogic Server are running.. Solution Tasks 1.. Access host02 by using the VNC Viewer on the gateway machine. Run the database setup script. a. Open a Terminal window, navigate to the current practice directory and run the database setup script, initdatabase.sh. $> cd /practices/tshoot/practice03-01 $> ./initdatabase.sh. 2.. Access host01 by using the VNC Viewer on the gateway machine. Run the solution script. a. Open a Terminal window, navigate to the current practice directory and run the solution script, solution.sh. $> cd /practices/tshoot/practice03-01 $> ./solution.sh Note: − This script creates the WLDF system module with its harvester, watch, and notification. These elements of the WLDF module are not enabled. You could enable them manually by using the administration console. − Ignore any messages that state “No stack trace available.” The script checks for the existence of a resource by trying to access the resource and catching an exception when it does not exist. When there is no Java stack trace and there is also an exception, then this message prints out.. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 3: WebLogic Server Diagnostic Framework: Overview Chapter 3 - Page 10. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practice Solution: Harvesting Diagnostic Metrics.
(31) Overview In this practice you access the Monitoring Dashboard to view harvested metric data.. Assumptions You completed “Practice 3-1: Harvesting Diagnostic Metrics” (or have run the solution). All instances of WebLogic Server are running.. Tasks 1.. Use the Monitoring Dashboard to monitor harvested data. a. Access the administration console and log in. b. On the Home page, click the Monitoring Dashboard link (under Charts and Graphs). c. In the left panel, click the My Views folder. d. Click the drop-down menu arrow (below the tabs).. e.. Select New View. Type over the default name of the new view with: Harvested Diagnostics.. f. g. h. i.. Ensure the new view is selected and click the Metric Browser tab. In the Servers drop-down list, select server1. Select Collected Metrics Only, and click the Go button. In the Types list of available MBeans on this server, locate and select JDBCConnectionPool. Under Instances, select datasource1. Under Metrics, drag the three metrics onto the right panel. As the first one is dragged in, a new chart is created. Drag the other two onto the same chart. Change the chart’s default name by clicking the menu down-arrow in the chart title bar. Select Properties. Under Chart Title, enter JDBC Chart. Click OK.. j. k. l.. m. View the data in the chart. Tip: If you see no data points in the chart, then you must set the time of the chart to include when the metrics were actually collected (rather than the default time). Perform the steps below, if that is the case: − Return to the admin console. − Under Diagnostics > Log Files, select HarvestedDataArchive for server1 and click View. Click Customize this table. For Time Interval, select: Last 1 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 3: WebLogic Server Diagnostic Framework: Overview Chapter 3 - Page 11. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practice 3-2: Monitoring Diagnostic Metrics.
(32) − Make note of the date and time of the collected JDBC attributes. (You may need to scroll to find the ones of interest after the client was running.) − Return to the Monitoring Dashboard. − At the top-right of the chart, click the down arrow for the menu again, and select Properties. − Under Time Range select Custom and enter the Start Time. Use the correct format. For example: In the log file if the Date field was "10/11/13 18:50:41 820" you would enter it here as: "10/11/2013 6:50:41 PM" (do not include the double quotation marks). − Enter a Duration of 5 minutes: 0 00:05 n. o. p.. − Click OK. Look at the chart again. It should contain data points. Close the Monitoring Dashboard. Close the web browser.. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 3: WebLogic Server Diagnostic Framework: Overview Chapter 3 - Page 12. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. hour(s) (or whatever time interval seems best based on when you did the previous practice). Set Number of rows displayed per page to 1000.Click Apply..
(33) There is no solution for this practice.. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practice Solution: Monitoring Diagnostic Metrics. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 3: WebLogic Server Diagnostic Framework: Overview Chapter 3 - Page 13.
(34) Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 3: WebLogic Server Diagnostic Framework: Overview Chapter 3 - Page 14.
(35) Chapter 4. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4: Diagnostic Instrumentation Chapter 4 - Page 1. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practices for Lesson 4: Diagnostic Instrumentation.
(36) Practices Overview In these practices, you create and configure an application-scoped diagnostic module which includes a monitor. You also configure instrumentation on the module to trace a client request.. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practices for Lesson 4: Overview. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4: Diagnostic Instrumentation Chapter 4 - Page 2.
(37) Scenario Users have reported intermittent database problems with the contacts application. You talk to a developer who guesses the problem might be in connecting to the database. You decide to gather some specific information about this application and how long it takes to make a database connection. You use application-scoped instrumentation to be able to gather this information.. Overview In this practice, you configure an application-scoped diagnostic monitor. Application-scoped monitors are part of application-scoped diagnostic modules, so you add a diagnostic module to an application. You select a delegating monitor (it has predefined code locations, but you choose the action to take). After the action has been triggered, you look at the data stored in the event archive.. Assumptions You completed practice “3-1: Harvesting Diagnostic Metrics.” All instances of WebLogic Server are running.. Tasks 1.. 2.. Enable instrumentation on the server named server1. Note: For instrumentation to be available for an application, instrumentation must be enabled on the server to which the application is deployed. a. Access the administration console, log in, and lock the configuration. b. Navigate to your diagnostics module, server1-diagnostics. Tip: In the Domain Structure: Diagnostics > Diagnostic Modules > server1diagnostics. c. Click the Configuration > Instrumentation tabs. d. Select the Enabled check box. Note: It is here that you could add instrumentation to this system-scoped diagnostic module. This practice does not have you do that, however, because you will instead add instrumentation to an application-scoped diagnostic module. e. Save and activate your changes. f. Minimize the admin console for later. Add a WLDF descriptor file to an application. Then redeploy the application. a. Access host01. b. Inspect the contents of the WLDF descriptor file provided under the current practice directory: META-INF/weblogic-diagnostics.xml Tip: Open a Terminal window, navigate to the current practice directory, and use the cat command. $> cd /practices/tshoot/practice04-01 $> cat META-INF/weblogic-diagnostics.xml c.. In a Terminal window run the jar utility to add the WLDF descriptor file to the contacts application. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4: Diagnostic Instrumentation Chapter 4 - Page 3. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practice 4-1: Configuring and Monitoring Diagnostic Events.
(38) Note: − Enter all commands on one line. Commands are sometimes displayed on more than one line due to space limitations. − The jar utility option uf means to update the file specified.. d.. − The file, contacts.war, is updated with the last parameter, the META-INF directory. Using the jar utility or the File Browser and Archive Mounter, inspect the contacts.war file and confirm that the WLDF descriptor file was added to the WAR file’s META-INF directory. Tip: To use the jar utility, run the jar as before, but replace uf with tf (table of contents for the file specified) and remove the META-INF at the end of the command. $> /u01/app/jdk/bin/jar tf /u01/domains/tshoot/wlsadmin/apps/contacts.war. e. f. g. h.. 3.. Minimize the VNC Viewer to use later. Return to the admin console and lock the configuration. Select Deployments in the Domain Structure. Select the check box next to the contacts application and click Update.. i. Click Finish. j. Activate the changes. Generate a deployment plan for updating the WLDF module in the application by using the admin console. a. In the Deployments table, click the name of the contacts application. b. c. d. e. f.. g.. h.. Click the Configuration > Instrumentation tabs. Lock the configuration again. Ensure Enabled is selected. Scroll down and click the Add Monitor From Library button. Move the JDBC_Around_GetConnection option from the Available column to the Chosen column. Note: This “around” monitor is triggered before and after a database connection is retrieved. Click OK. Note: Because this is a change to the application-scoped diagnostic monitor, and a deployment plan does not yet exist for this application, the “Save Deployment Plan Assistant” is launched.. Set the Path to: /u01/domains/tshoot/wlsadmin/apps/contacts-plan.xml. i. j. k.. Click OK. Return to the application’s Configuration > Instrumentation tabs. In the Included Classes text area enter: Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4: Diagnostic Instrumentation Chapter 4 - Page 4. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. $> cd /practices/tshoot/practice04-01 $> /u01/app/jdk/bin/jar uf /u01/domains/tshoot/wlsadmin/apps/contacts.war META-INF.
(39) 4.. 5.. Note: The class that gets the database connection is in the stcurr package. l. Click Save. m. Do not activate changes yet. Configure the delegating monitor. a. In the Diagnostic Monitors in this Module table, select the new monitor. b. Under Actions, move the TraceElapsedTimeAction from the Available column to the Chosen column. Note: This action makes two event archive entries: one before and one after the specified code location. It is only compatible with “Around” monitor types. c. Click Save. d. Activate all your changes. e. Return to the contacts application’s main configuration page and inspect the Overview tab. Confirm that the Deployment Plan field now has a value. Tip: Make note of the file’s name and location. f. Minimize the admin console for later. g. Return to host01. Use a Terminal window or the File Browser to find and inspect the deployment plan file. The plan now has new variables, which will update the weblogic-diagnostics.xml file. In the plan file, notice that there are now variables that start with “WLDFInstrumentationMonitor.” Note: If you view the deployment plan file by using the gedit editor, make sure you do not make any changes to the file. Deploy the latest version of the application, with the deployment plan. a. Return to the admin console and lock the configuration. b. In the Domain Structure, select Deployments. c. Select the check box next to the contacts application, and click the Update button. d. e. f. g.. 6.. Select Update this application in place with new deployment plan changes. Ensure that the Deployment plan path (under this option) is correct. Click Finish. Activate the changes. Ensure that the contacts application’s state is “Active.”. Run the application and inspect the generated events. a. Use the Firefox web browser on the gateway machine. Enter the URL for the application: http://host01.example.com:7011/contacts b.. Click the browse all contacts link.. c. d. e.. Click the [edit] link on a row. Use the page to update some fields. Click the Update button. Do this a few times. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4: Diagnostic Instrumentation Chapter 4 - Page 5. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. stcurr.*.
(40) 7.. Return to the admin console. From the Domain Structure panel, select Diagnostics > Log Files. g. Locate and select the EventsDataArchive log file for the server1 server. Click View. Note: − If you don’t see any rows in the table, click the Customize this table link. Change the Time Interval to ensure you are going back far enough to see the events created. Click Apply. − If after doing that, you still don’t see any rows, return to the task to “deploy the latest version of the application” and do it again. h. Browse the generated events. Notice the Date column. For each “Before” and “After” event (look in the Type column) you can see how long connecting to the database took by comparing the times. (The number on the end is milliseconds.) View “request performance” in the admin console. Note: Because instrumentation is enabled, and the monitor is an “Around” type, you can view request performance data by using the admin console. a. In the Domain Structure, select Diagnostics > Request Performance. b. For Servers select server1. For Interval select Last 5 mins (or a time that will include running the application). c. Click the Refresh button. d. View the results. To see what is “under” a request, click the “+” next to one.. e.. To see the details of a request, click the string that identifies the request.. f.. The details are displayed below the Requests tree.. Note: Above the details table are the WLDF context ID and the total elapsed time of the request in milliseconds. The details include the class and method, the number of times the method was called in the request, the total milliseconds of the calls, the Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4: Diagnostic Instrumentation Chapter 4 - Page 6. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. f..
(41) Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. g.. average milliseconds of the calls, the application name, the application module, and the method signature. Close the admin console.. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4: Diagnostic Instrumentation Chapter 4 - Page 7.
(42) Perform the following tasks if you did not do this practice and want to use the finished solution.. Assumptions You completed practice “3-1: Harvesting Diagnostic Metrics.” All instances of WebLogic Server are running.. Solution Tasks 1.. Access host01 by using the VNC Viewer on the gateway machine. Run the solution script. a. Open a Terminal window, navigate to the practice directory and run the database setup script, solution.sh. $> cd /practices/tshoot/practice04-01 $> ./solution.sh Note: This script: − Copies the new version of the application and its new deployment plan to the apps directory under the domain. − Calls a WLST script to create a system-scoped diagnostic module (in case it does not already exist). − Calls another WLST script to enable instrumentation in the module (and therefore for the server to which it is targeted). − Calls another WLST script to deploy the application with its deployment plan. (Ignore any messages about WLContext.close() being called in a different thread.). Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4: Diagnostic Instrumentation Chapter 4 - Page 8. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practice Solution: Configuring and Monitoring Diagnostic Events.
(43) Scenario Users have reported intermittent database problems with the contacts application. After some investigation, the problem seems to be JDBC related, but only for certain users. You want to be able to trace a user’s request through JDBC operations. You also want to limit the diagnostic events that are saved to a particular user by using their IP address.. Overview When instrumentation is enabled on a diagnostic module, all WLDF events and log entries associated with a particular client request will be tagged with a unique context ID. These IDs allow administrators to trace all the diagnostic data for a specific request. In some troubleshooting cases, you may wish to go a step further and limit the conditions under which WLDF events are recorded. A diagnostic context ID supports various flags or “dyes” that allow you to filter the types of requests that trigger instrumentation data. You also enable some debug flags on the server so there is more detailed information saved in the logs.. Assumptions You completed practice “4-1: Configuring and Monitoring Diagnostic Events.” All instances of WebLogic Server are running.. Tasks 1.. Generate debug messages in the server log file. a. Access the admin console. Lock the configuration. b. In the Domain Structure, select Environment > Servers. Select server1. c. Click the Debug tab. d. Locate the weblogic > servlet > internal debug scope. e. Select the check box for the internal scope. Click the Enable button. Note: That scope and its children are now enabled. A couple of other scopes (that do not seem like children, but are) are also enabled. That is expected.. f.. Similarly, enable the weblogic > jdbc debug scope. Note: That scope and its children are now enabled. (Not all the children are shown here.). Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4: Diagnostic Instrumentation Chapter 4 - Page 9. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practice 4-2: Tracing a Client Request.
(44) b. c. d. e. f.. 3.. Click the browse all contacts link. Click the [edit] link on a row. Use the page to update some fields. Click the Update button. Do this a few times. Return to the admin console. From the Domain Structure panel, select Diagnostics > Log Files. g. Locate and select the EventsDataArchive log file for the server1 server. Click View. Note: If you don’t see any rows in the table, click the Customize this table link. Change the Time Interval to ensure you are going back far enough to see the events created. Click Apply. h. This time notice the Context ID field. Also notice that it changes with each request, and sometimes there are more rows for one request than another. Note: If the Context ID field is not displayed, click Customize this table. Add the Context ID column to the chosen list and click Apply. i. Write down the last five characters of one of the context IDs. For example, if the context ID is “9d9fbb3a-0e57-4274-94fe-e1b1fb9aaa77-00014a17,” write down “14a17.” Correlate WLDF and server log messages. a. Use the admin console to view the ServerLog for server1. Tip: In the Domain Structure select Diagnostics > Log Files. Select ServerLog for server1. Click View. b. Click Customize this table. Add the Context ID column to the chosen list. Increase the Number of Rows Displayed Per Page to 1000. Click Apply.. c.. d. e.. f.. Tip: You might want to change the order of the columns so the Context ID is first or second. In the Chosen column, select it and move it with the arrows. Browse the recent log entries. Notice that some entries have been assigned context IDs while others have not. The latter are internal messages not associated with a client request. Click Customize this table again. For WLDF Query Expression, enter the following (where nnnnn is the last five characters of the context ID that you wrote down). CONTEXTID LIKE '%nnnnn' Click Apply.. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4: Diagnostic Instrumentation Chapter 4 - Page 10. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. 2.. g. Activate your changes. Run the application again and once again inspect the generated events. a. Use the Firefox web browser on the gateway machine. Enter the URL for the application: http://host01.example.com:7011/contacts.
(45) g.. 4.. Browse the log entries. Notice that you can trace a particular request through extremely detailed JDBC operations, thanks to the context ID and the debug messages. h. Minimize the admin console to use later. Configure dye injection monitoring based on a dye filter, which is a particular IP address. Note: You will pretend that the user having trouble is accessing the contacts application from the web browser on host01. a. Find out the IP address of host01. Access host01. Open a Terminal window and enter the command ifconfig. Make note of the address. $> ifconfig eth0 Link encap:Ethernet HWaddr 00:16:3E:01:01:00 inet addr:192.0.2.11 Bcast:192.0.2.255 .... b. c. d.. Note: Look for the inet addr in the second line of the eth0 print out. Your IP address may be different. Close the Terminal window. Minimize the VNC Viewer to use later. Return to the admin console. Lock the configuration. Locate and edit the system diagnostic module, server1-diagnostics.. e. f.. Under Configuration > Instrumentation click the Add/Remove button. Move DyeInjection from Available to Chosen. Click OK.. g.. In the table, select the dye injection monitor name to edit it. Ensure Enabled is selected. In the Properties text area enter: ADDR1=host01_ip_address Note: For example, if the host01 IP address is 192.0.2.11, you enter: ADDR1=192.0.2.11. h. i. j. k. l. m.. Click Save. Activate your changes. Lock the configuration again. Locate and edit the contacts application (deployment). Click Configuration > Instrumentation. Select the monitor JDBC_Around_GetConnection.. n. o.. Select Enable Dye Filtering. For the Dye Mask, move ADDR1 from Available to Chosen.. p. q.. Click Save. Return to the Deployments table. Tip: You can use the breadcrumbs and select Summary of Deployments. Select the check box next to contacts. Click Update. Select Update this application in place with new deployment plan changes. Click Finish. Activate the changes. Note: Now the application has been updated with a new version of its diagnostic module, updated through its deployment plan.. r. s. t. u.. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4: Diagnostic Instrumentation Chapter 4 - Page 11. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Tip: If you do not see any entries, click Customize this table again and change Time Interval to Last 15 minute(s) (or longer)..
(46) 5.. 6.. Do not close the admin console. Use the File menu of Firefox to open a New Tab or New Window. Test event filtering. a. Retest the contacts application as before, by entering the application URL (http://host01.example.com:7011/contacts) in the new tab or window of the Firefox web browser of the gateway machine. Edit a couple of contacts. b. Return to the admin console and once again view the EventsDataArchive for server1. c. Click Customize this table and ensure that the Time Interval is long enough to include the last testing you just did, but not so long as to include the previous testing. d. You should not see any rows in the Events Log Entries table. That is because the IP address of this browser does not match the dye filter IP address. e. Keep the admin console available. f. Close the window or tab of the Firefox browser accessing the contacts application. g. Access host01. h. Click the Firefox icon in the panel on host01. i. Use this web browser to access the contacts application and edit a few contacts. j. Close the web browser. Exit the VNC Viewer. k. Return to the admin console and again view the EventsDataArchive for server1. l. Click Customize this table and ensure that the Time Interval includes the very latest testing. m. Now there are rows in the Events Log Entries table, because the IP address of the host01 browser matches the dye filter IP address. Edit the server1-dianostics module and disable the instrumentation component. a. b. c.. 7.. Return to the admin console and lock the configuration. From Domain Structure, select Diagnostics > Diagnostic Modules. Select server1-diagnostics.. d. Select Configuration > Instrumentation. e. Deselect Enabled. f. Click Save. g. Activate your changes. Disable the debug flags. a. Access the admin console again. Lock the configuration. b. In the Domain Structure, select Environment > Servers. Select server1. c. Click the Debug tab. d. Locate the weblogic > servlet > internal debug scope. e. Select the check box for the internal scope. Click the Disable button. f. Similarly, disable the weblogic > jdbc debug scope. g. Activate your changes.. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4: Diagnostic Instrumentation Chapter 4 - Page 12. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. v..
(47) There is no solution for this practice.. Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Practice Solution: Tracing a Client Request. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4: Diagnostic Instrumentation Chapter 4 - Page 13.
(48) Oracle University and In Motion Servicios S.A. use only. THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.. Practices for Lesson 4: Diagnostic Instrumentation Chapter 4 - Page 14.
Outline
Configuring and Monitoring Diagnostic Events
Practice Solution: Configuring and Monitoring Diagnostic Events Perform the following tasks if you did not do this practice and want to use the finished solution.
Troubleshooting a JVM
Investigating Server Problems
Practices for Lesson 7: Overview
Investigating JDBC Problems
Practices for Lesson 9: Overview
Practice Solution: Investigating Proxy Problems
Practices for Lesson 11: Overview
Practice Solution: Troubleshooting Changes by Using Auditing There is no solution to this practice.
Related documents