Practices for Lesson 12 Practices Overview
Practice 12-1: Investigating Node Manager Problems
Duration: 35 minutes Skills Learned
At the end of this practice, you should be able to:
• Debug node manager client communication
• Enroll node manager with a domain
• Debug remote server startup issues
• Configure node manager to use standard and custom scripts Overview
The WebLogic node manager is a simple process that accepts remote commands to start and stop WebLogic Server instances on the same machine. These commands are often generated by a domain’s administration server via the administration console. In addition to requiring SSL by default, the Java node manager only accepts commands from trusted domains. Node manager can launch server processes by using the same scripts that you use to start them manually, or it can launch a generic Java process and initialize its environment by using parameters sent by the client. The node manager setup used in this practice is shown in the following diagram:
Instructions
1. Set up the practice.
a. Kill MedRecSvr1 if running. Start the administration server if not running.
b. Locate a Lab Framework prompt or start a new one. Change directories to
<CURRENT_LAB>.
c. Execute the following:
ant setup_exercise The Lab Framework:
− Creates an initial Java node manager configuration.
− Defines a new machine for MedRecSvr1.
− Initializes remote start settings for MedRecSvr1.
2. Attempt to start a server by using the node manager.
a. Launch a new Terminal and change directories to <LAB_WORK>/nodemanager.
b. Execute the startNM.sh script.
Tip: If not overridden, the default node manager home directory is within the WLS product installation at <WEBLOGIC_HOME>/common/nodemanager.
c. Confirm that the node manager has started successfully and is running on port 5555.
Oracle University and Sentra inversiones y servicios LTDA use only
Tip: The node manager is started with the –v option, meaning that all node manager log messages are also written to standard output.
d. Inspect the contents of the <LAB_WORK>/nodemanager/nodemanager.domains file.
e. Verify that the MedRecDomain is listed in this file and that its path is correct.
f. Launch the console. In the Domain Structure panel, click the domain name.
g. Click the Control > Servers tab.
In the Servers table, note the machine assigned to MedRecSvr1.
h. Try to Start the server MedRecSvr1.
This operation fails with an error stating that the node manager is not available 3. Debug node manager client communication.
a. From the Domain Structure panel, select Environment > Machines.
b. Select MedRecMch1.
c. Click the Configuration > Node Manager tab.
Verify that the node manager address and port settings for this local machine are correct.
d. Click the Monitoring > Node Manager Status tab.
Notice that once again, the admin server claims that the node manager is not available.
e. Locate and view the latest output from the administration server.
f. Notice several error messages related to node manager communication. For example:
<Error> <NodeManager> <BEA-300033> <Could not execute command
"getVersion" on the node manager. Reason: "Access to domain 'MedRecDomain' for user 'Kikw8dIvaR' denied".>
This type of error typically means that the credentials being sent from the admin server are not those that the node manager expects.
4. Enroll a node manager with a domain.
a. From a Lab Framework prompt, navigate to <LAB_WORK>/nodemanager.
b. Launch WLST (interactive mode).
c. Connect to the administration server and use the nmEnroll command:
connect('weblogic','Welcome1','localhost:7020')
nmEnroll('/home/oracle/wls11g_trouble/work/domains/MedRecDomain' )
d. Confirm that the command executed successfully, and then exit WLST.
5. Observe remote server startup problems.
a. Return to the console.
b. Try the Monitoring > Node Manager Status tab again for MedRecMch1.
The Status should now indicate Reachable.
c. Repeat the previous steps to start MedRecSvr1 from the console.
This time the command should succeed.
d. Click the Monitoring > Health tab.
Verify that the current State of MedRecSvr1 is now FAILED_NOT_RESTARTABLE.
6. Debug server startup problems.
Oracle University and Sentra inversiones y servicios LTDA use only
a. View the latest node manager output. Confirm that the node manager logged messages similar to the following:
<INFO> <MedRecDomain> <MedRecSvr1> <Server failed during startup so will not be restarted>
...
<WARNING> <Exception while starting server 'MedRecSvr1'>
java.io.IOException: Server failed to start up. See server output log for more details.
b. Use the node manager log messages to determine the location of the standard output log file for MedRecSvr1 (it uses the .out file extension by default).
c. Examine MedRecSvr1.out. Locate the exception that caused the startup failure:
Exception in thread "Main Thread"
java.lang.NoClassDefFoundError: weblogic/Server Could not find the main class: weblogic.Server.
Program will exit.
Tip: The node manager may rotate through several output files while starting a server.
You can search multiple files, if necessary.
d. Use either the server output log or the node manager log to determine the command that the node manager ran to launch the server. Identity the classpath being used. For example:
java ... -Djava.class.path=... weblogic.Server
Are the locations defined in this classpath valid? Compare them to your actual file system.
e. Use the node manager log messages to determine the location of the startup.properties file recorded for MedRecSvr1.
f. View the contents of startup.properties. Confirm that the classpath value is defined here.
g. Return to the console.
h. Locate and view MedRecSvr1.
i. Click Configuration > Server Start.
Note the settings for Class Path and Arguments.
7. Configure node manager to use start scripts.
To avoid configuration errors like those above, we update the node manager configuration to simply call the standard server start script, startWebLogic.sh.
a. Edit <LAB_WORK>/nodemanager/nodemanager.properties. b. Add the following lines:
StartScriptEnabled=true StopScriptEnabled=true
c. Save and close the file. Kill and restart the node manager.
d. Use the console to try to start MedRecSvr1 a third time.
e. Monitor the domain again. Confirm that MedRecSvr1 eventually starts successfully and is in the “RUNNING” state.
f. Inspect the latest node manager output log for MedRecSvr1. From the server’s output, determine what heap settings the server was started with. For example:
Oracle University and Sentra inversiones y servicios LTDA use only
JAVA Memory arguments: -Xms512m -Xmx512m
Recall that the original server start settings specified a maximum heap size of 768m.
g. Use the console or WLST to stop MedRecSvr1.
8. Develop and use a custom server start script.
a. Create and edit a new file: <LAB_WORK>/domains/MedRecDomain/bin/
startMedRecServers.sh.
b. Add logic to set different heap options for different servers, by using the WLS environment variable USER_MEM_ARGS. For example:
if [ ${SERVER_NAME} = "MedRecSvr1" ] ; then export USER_MEM_ARGS="-Xms512m -Xmx756m"
else
export USER_MEM_ARGS="-Xms512m -Xmx512m"
fi
c. At the end of this script execute the standard WLS start script with the necessary parameters:
cd <LAB_WORK>/domains/MedRecDomain/bin
./startManagedWebLogic.sh ${SERVER_NAME} ${ADMIN_URL}
d. Save your changes. Modify the file’s permissions so that it is executable.
e. Edit nodemanager.properties once again. Add the following line:
StartScriptName=startMedRecServers.sh f. Save your changes and restart the node manager.
Tip: Notice that MedRecSvr1 is not automatically started when the node manager starts. This is due to the fact that the server was gracefully shut down and did not fail.
g. Use the console or WLST to start MedRecSvr1 again.
h. Use the server output to verify that it is now running with the correct heap settings.
Tip: Notice that for custom start scripts, the node manager also logs all environment variables for troubleshooting purposes.
i. Return to the console and Lock it.
j. Return to the Configuration > Server Start tab for MedRecSvr1.
k. Edit the following values:
Field Value
Class Path <blank>
Arguments <blank>
Password/Confirm Password Welcome1 Save and Activate your changes.
9. Test automatic restart.
a. From a Linux terminal, determine the process IDs associated with MedRecSvr1:
ps –ef | grep MedRecSvr1 b. Using the terminal, kill these processes:
kill -9 <pid1> <pid2>
Oracle University and Sentra inversiones y servicios LTDA use only
c. Observe the node manager output while the server is restarted.
d. Use the console or WLST to confirm that the server is running again.
Oracle University and Sentra inversiones y servicios LTDA use only
Solution Instructions
1. If the <LAB_WORK>/domains/MedRecDomain location does not yet exist, follow the Solution Instructions for the “Developing a Custom Monitoring Script” practice.
2. If not already done, perform the section of the instructions entitled “Set up the practice.”
3. Launch the Lab Framework command shell by executing the
<STUDENT>/bin/prompt.sh file.
4. Change the current directory to <CURRENT_LAB>.
5. Execute the following:
ant setup_solution The Lab Framework:
− Updates the node manager’s configuration
− Adds a custom start script to the domain
− Enrolls the node manager with the domain
− Removes any start settings for MedRecSvr1