상세 URL : http://java.sun.com/developer/technicalArticles/Programming/GCPortal/
다운로드 사이트 : http://java.sun.com/developer/technicalArticles/Programming/GCPortal/gcPortal.zip
GC 포털은 JVM의 verbosegc 옵션에서 얻어진 정보를 바탕으로 Java application을 분석하고 튜닝을 할 수 있게 하여주는 프로그램입니다. 이 프로그램은 Sun의 Hotspot JVM을 위한 것으로 J2SE 의 일부로 배포됩니다.
GC 포털을 사용하기 위해서는 JVM에 아래 옵션들이 추가되어 있어야 합니다.
-verbose:gc
-XX:+PrintGCTimeStamps
-XX:+PrintGCDetails
참고 : -XX 옵션은 비표준 옵션으로 예고 없이 변경될 수도 있습니다.
설치를 위한 사전 준비사항 :
Installing and running the GC Portal on Tomcat
Step 1. Download the GC Portal software
Download the zip archive containing the gcPortal software for Windows and tomcat, gcPortal_win_Tomcat.zip
Step 2. Extract the gcPortal software from the zip archive
This gcPortal_win_Tomcat.zip archive contains 3 files
- sqlTables.sql
SQL scripts needed to create the Database Tables for use by GC Portal
- gcPortal.war
Web Archive needed to Deploy GC Portal
- ReadMe file
Step 3. Install and configure the Jakarta -tomcat 4.0.6 server
Download jakarta-tomcat-4.0.6.zip from http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.6/bin/
Follow the associated documentation to install, configure and run the jakarta-tomcat server.
Step 4. Install and configure awk and Perl for windows
GC Portal uses awk and perl scripts. To execute these scripts, install and configure Awk and Perl for Windows.
- Download awk95.exe from http://cm.bell-labs.com/cm/cs/who/bwk/awk95.exe
(Don't worry about the '95' -It works on 95/98/NT/2000/XP). Rename awk95.exe to awk.exe
Add the awk.exe executable location to the 'PATH' Environment Variable (for example C:\AWK).
- Download ActivePerl 5.6.1 for windows from http://www.activestate.com/Products/Download/Download.plex?id=ActivePerl
Install ActivePerl 5.6.1 for windows, add the perl binary executable location and perl lib directory location to the 'PATH' Environment Variable (for example C:\Perl\bin and C:\Perl\lib).
- To Setup the Environment Variables, Go to Windows StartMenu and select Start->Settings->Control Panel Click on System -> Click on Advanced Tab -> Click on Environment Variables -> Click on System Variables. Look for Path Environment Variable. If it already exits, Select Path Variable and Click on 'Edit' Button. Add the above perl executable location at the end. If it does not exist, Click on 'New' Button and type the 'Variable Name' as Path and type the 'Variable Value' as the location of the perl executable.
Step 5. Deploy gcPortal on Tomcat server
Create a directory named gcPortal under CATALINA_HOME/webapps directory where CATALINA_HOME is the home directory of jakarta-tomcat-4.0.6 server; for example, C:\jakarta-tomcat-4.0.6
copy the gcPortal.war file from the downloaded gcPortal_win_Tomcat.zip to the CATALINA_HOME/webapps/gcPortal directory you just created and unjar the gcPortal.war file in that directory by following these instructions.
Do the following at Windows Command Prompt
cd CATALINA_HOME/webapps/gcPortal
jar xvf gcPortal.war
Step 6. Configuring the GC Portal
As from the previous step, GC Portal is installed in the following directory
CATALINA_HOME\webapps\gcPortal\
The GC Portal software is organized in the following directory structure:
- The gcPortal root directory contains all the JSPs and HTML files
- The gcPortal/images directory contains gifs and other images
- The gcPortal/WEB-INF contains three sub-directories
- lib directory contains all the jar libraries used by the Portal
- classes directory contains all the class files
- src directory contains all the java source files
- The gcPortal/cache directory contains the charts(graphs) that are generated by the Portal
- The gcPortal/ scripts directory contains all the perl and awk scripts for parsing the verbose:gc log files
- The gcPortal/CaseStudies directory contains the CaseStudies pages and other images
- gcPortal/gclogs directory contains all the verbose:gc log files that users upload. It creates a directory for each user by the username in this directory, a project sub-directory for each user project by the project name within the username directory and stores the raw log files for a given user and project in that project sub-directory.
- The gcPortal/jvmstat1.1 directory contains the jvmstat1.1 needed for running VisualGC 1.1 and associated documentation.
- The gcPortal/jvmstat2.0 directory contains the jvmstat2.0 needed for running VisualGC 1.2 and associated documentation
- The gcPortal/visualGCSample directory contains the jnlp files and classes needed to launch VisualGC from a browser using Java Web Start.
Before accessing the GC Portal, make sure you have 'write' permissions for the following directories under CATALINA_HOME\webapps\gcPortal\
- cache directory where the charts(graphs) are generated
- gclogs directory where all the log files are stored.
- scripts directory
- WEB-INF\lib directory where Properties.txt file is written by the Portal.
Note: The Properties.txt file located in WEB-INF\lib stores values for some of the properties used by the Portal. When GC Portal is run for the first time and the Login page accessed, this file is automatically generated.
To modify any default values used by the Portal to match your configuration, edit the respective entries in the Properties.txtfile. These default values might include:
- Database DRIVER ( default is com.pointbase.jdbc.jdbcUniversalDriver),
- Database Connect String (default might be like jdbc:pointbase://localhost/gcportal ),
- Database username and Password (default is PBPUBLIC/PBPUBLIC),
- User GC log files location (default is ../gcPortal_$/gclogs/)
- Parameters EMAIL_FROM_ADDRESS and EMAIL_HOST used by the Portal.
- Create an entry for the gcPortal web application in Tomcat's web.xml file:
Go to CATALINE_HOME\webapps\ROOT\WEB-INF directory and modify the web.xml to add an entry for the gcPortal web-app.
Follow this instruction
Copy the block of code from <web-app>
........
</web-app>
in CATALINE_HOME\webapps\gcPortal\WEB-INF\web.xml to the web.xml in the CATALINE_HOME\webapps\ROOT\WEB-INF directory.
Step 7. Set up the GC Portal database
GC Portal can be configured to work with any database including Oracle, MySQL, others, if the appropriate JDBC drivers are available. The steps here describe how to configure any database with GC Portal. To configure a Database, open the browser window and type http://machinename:port/gcPortal/dbadmin.html after deploying GC Portal i.e after Step 9 of installation instructions. Fill in the appropriate values for Database Driver Class, Database Connect String, Database user name and Database user password. In the GCPortal User Password field type 'dbadmin' which is the default password for administering GC Portal by a user with GC Portal administration priveliges. The GCPortal user 'dbadmin' with password 'dbadmin' is already created by the sqlTables.sql. script. Only user 'dbadmin' can modify the GCPortal DB settings. After the Database is configured with these values, its recommended for the admin user to login to GCPortal as user 'dbadmin', password 'dbadmin' and change 'dbadmin' user password by clicking on the 'Modify Profile' link on the left hand side of the Home page.
Step 8. Download the third party software used by GC Portal for charting graphs
- Go to http://www.ve.com/servlet.html
- Download the following from KavaChart Downloads: KavaChart 4.0.1 server beans in zip format.
- unzip the downloaded zip file to a temporary directory. It will create 3 directories jsp, asp and javachart.
- Go to the sub-directory named jsp. It has a file called kavachart.war
- Run the following command from the windows Command Prompt
jar xvf kavachart.war.
It will create a directory WEB-INF . - Copy the kcServlet.jar file from Kavachart's WEB-INF\lib directory to
CATALINA_HOME\webapps\gcPortal\WEB-INF\lib
Step 9. Running the GC Portal
Start the Tomcat server:
To start the Tomcat Server from Windows Command Prompt, do
cd CATALINA_HOME\bin\
Issue the following command at the Windows Command Prompt
startup
or
Open the Windows explorer and go to CATALINA_HOME\bin\ directory and double click on the startup.bat file
Open the browser window and
- Type http://machinename:port/gcPortal
- If The server is running and GC Portal deployed, this will be taken to the Home page of GC Portal. To create a New User, Click on 'New User? Sign in Here?' link on the page and create a new user and login. If the database is created properly, this should successfully create a new user. After this, Login with the username and password just created.