I was looking for training material on JProfiler and I found some 15 videos on youtube created by Ingo Kegel.
He is really very professional! Thanks a lot Ingo! Ingo for President!
Showing posts with label jprofiler. Show all posts
Showing posts with label jprofiler. Show all posts
Sunday, November 1, 2015
Tuesday, February 4, 2014
JProfiler connection through SSH Tunnel
If you don't want to open a firewall for JProfiler, here is a simple trick:
- on the monitored server, run the startManagedWebLogic_jprofiler.sh
- make sure the port 8849 is being listened to (netstat -an | grep 8849)
- open putty
- open a connection to your monitored server, using this setting for SSH tunnel:
(the obscured hostname is the FQDN of the monitored server)
you will notice that on your laptop, BEFORE the connection you have nothing on port 8849, while AFTER you have a LOCAL port open, and being forwarded to the remote host:
(10.56.80.126 is the remote IP, 10.240.21.73 is the local IP... you see several connections, one is my putty open, the others are Tunnel)
You can now open your JProfiler session, but make it point to localhost:8849, not to the remotehost:8849. It works!
- on the monitored server, run the startManagedWebLogic_jprofiler.sh
- make sure the port 8849 is being listened to (netstat -an | grep 8849)
- open putty
- open a connection to your monitored server, using this setting for SSH tunnel:
(the obscured hostname is the FQDN of the monitored server)
you will notice that on your laptop, BEFORE the connection you have nothing on port 8849, while AFTER you have a LOCAL port open, and being forwarded to the remote host:
netstat -an | find "8849" TCP 127.0.0.1:8849 0.0.0.0:0 LISTENING TCP [::1]:8849 [::]:0 LISTENING netstat -an | find "10.56.10.126" TCP 10.240.21.73:58756 10.56.10.126:22 ESTABLISHED TCP 10.240.21.73:58944 10.56.10.126:22 ESTABLISHED TCP 10.240.21.73:58969 10.56.10.126:22 ESTABLISHED
(10.56.80.126 is the remote IP, 10.240.21.73 is the local IP... you see several connections, one is my putty open, the others are Tunnel)
You can now open your JProfiler session, but make it point to localhost:8849, not to the remotehost:8849. It works!
Sunday, February 2, 2014
Configuring JProfiler for WebLogic
Download and install JProfiler 7.2 (the latest is 8 at the time of writing). Enter the licensing information. Run the Session/Integration/New Remote Integration.
Then remote Application Server:
this means that it will generate jprofiler_agent_linux-x64.tar.gz in c:\temp
you must previously have copied startWebLogic.sh (from the DOMAIN_HOME/bin folder) to your c:\temp folder. In the snapshot below I have tried with startManagedWebLogic.sh, but this is NOT recognized as a valid script.... please replace it with startWebLogic.sh script!
as said, startManagedWebLogic.sh is not recognized... use startWebLogic.sh instead!
this time it will work:
and at this point we are ready to attach:
but fiirst you must prepare the Application Server (the Managed Server)
sudo mkdir /opt/jprofiler
sudo chmod soa:soa /opt/jprofiler
The file jprofiler_agent_linux-x64.tar.gz will be created in c:\temp. Copy it to the /opt/jprofiler folder, then:
tar xvzf jprofiler_agent_linux-x64.tar.gz
and that's it for the libraries.
The modification done in startWebLogic.sh is:
added on top:
JAVA_VENDOR=Sun
added above this line: echo "starting weblogic with Java version:":
changed:
The JPROFILER_OPTIONS add a agentpath pointing to the jprofiles libraries in charge of doing the instrumentation and profiling.
BEWARE: if you copy the startWebLogic_jprofiler.sh from a different domain, make sure you change the DOMAIN_HOME !
At this point we must change the startManagedWebLogic.sh and startWebLogic.sh scripts to add the JProfiler libraries.... we shall clone the existing scripts, to allow normal operations to be unaffected.
cd DOMAIN_HOME/bin
cp startManagedWebLogic.sh startManagedWebLogic_jprofiler.sh
vi startManagedWebLogic_jprofiler.sh
change the 2 occurrences of startWebLogic.sh into startWebLogic_jprofiler.sh
copy to DOMAIN_HOME/bin the startWebLogic_jprofiler.sh generated by the jprofiler wizard
to start the profield server, run ./startManagedWebLogic_jprofiler.sh osbpp4ms1 (or whatever is your managed server name).
In the logs you should see:
And you are ready to connect and profile.
Happy profiling!
Then remote Application Server:
this means that it will generate jprofiler_agent_linux-x64.tar.gz in c:\temp
you must previously have copied startWebLogic.sh (from the DOMAIN_HOME/bin folder) to your c:\temp folder. In the snapshot below I have tried with startManagedWebLogic.sh, but this is NOT recognized as a valid script.... please replace it with startWebLogic.sh script!
as said, startManagedWebLogic.sh is not recognized... use startWebLogic.sh instead!
this time it will work:
and at this point we are ready to attach:
but fiirst you must prepare the Application Server (the Managed Server)
sudo mkdir /opt/jprofiler
sudo chmod soa:soa /opt/jprofiler
The file jprofiler_agent_linux-x64.tar.gz will be created in c:\temp. Copy it to the /opt/jprofiler folder, then:
tar xvzf jprofiler_agent_linux-x64.tar.gz
and that's it for the libraries.
The modification done in startWebLogic.sh is:
added on top:
JAVA_VENDOR=Sun
added above this line: echo "starting weblogic with Java version:":
JAVA_VM= export JAVA_VM JPROFILER_OPTIONS="-agentpath:/opt/jprofiler/bin/linux-x64/libjprofilerti.so=port=8849,nowait $JPROFILER_OPTIONS" export JPROFILER_OPTIONS
changed:
echo "starting weblogic with Java version:"
${JAVA_HOME}/bin/java ${JAVA_VM} -version
if [ "${WLS_REDIRECT_LOG}" = "" ] ; then
echo "Starting WLS with line:"
echo "${JAVA_HOME}/bin/java ${JPROFILER_OPTIONS} ${JAVA_VM} ${MEM_ARGS} -Dweblogic.Name=${SERVER_NAME} -Djava.security.policy=${WL_HOME}/server/lib/weblogic.policy ${JAVA_OPTIONS} ${PROXY_SETTINGS} ${SERVER_CLASS}"
${JAVA_HOME}/bin/java ${JPROFILER_OPTIONS} ${JAVA_VM} ${MEM_ARGS} -Dweblogic.Name=${SERVER_NAME} -Djava.security.policy=${WL_HOME}/server/lib/weblogic.policy ${JAVA_OPTIONS} ${PROXY_SETTINGS} ${SERVER_CLASS}
else
echo "Redirecting output from WLS window to ${WLS_REDIRECT_LOG}"
${JAVA_HOME}/bin/java ${JPROFILER_OPTIONS} ${JAVA_VM} ${MEM_ARGS} -Dweblogic.Name=${SERVER_NAME} -Djava.security.policy=${WL_HOME}/server/lib/weblogic.policy ${JAVA_OPTIONS} ${PROXY_SETTINGS} ${SERVER_CLASS} >"${WLS_REDIRECT_LOG}" 2>&1
fi
The JPROFILER_OPTIONS add a agentpath pointing to the jprofiles libraries in charge of doing the instrumentation and profiling.
BEWARE: if you copy the startWebLogic_jprofiler.sh from a different domain, make sure you change the DOMAIN_HOME !
At this point we must change the startManagedWebLogic.sh and startWebLogic.sh scripts to add the JProfiler libraries.... we shall clone the existing scripts, to allow normal operations to be unaffected.
cd DOMAIN_HOME/bin
cp startManagedWebLogic.sh startManagedWebLogic_jprofiler.sh
vi startManagedWebLogic_jprofiler.sh
change the 2 occurrences of startWebLogic.sh into startWebLogic_jprofiler.sh
copy to DOMAIN_HOME/bin the startWebLogic_jprofiler.sh generated by the jprofiler wizard
to start the profield server, run ./startManagedWebLogic_jprofiler.sh osbpp4ms1 (or whatever is your managed server name).
In the logs you should see:
JProfiler> Protocol version 37 JProfiler> Using JVMTI JProfiler> JVMTI version 1.1 detected. JProfiler> 64-bit library JProfiler> Don't wait for frontend to connect. JProfiler> Starting up without initial configuration. JProfiler> Listening on port: 8849. JProfiler> Instrumenting native methods. JProfiler> Can retransform classes. JProfiler> Can retransform any class. JProfiler> Native library initialized JProfiler> VM initialized JProfiler> Hotspot compiler enabled
And you are ready to connect and profile.
Happy profiling!
Labels:
jprofiler
Subscribe to:
Posts (Atom)