psi-probe,lambda probe

http://bbs.csdn.net/topics/360186829

如果是7.x的版本要加入

<role rolename="manager-gui"/>
  <user username="admin" password="admin" roles="manager-gui"/>

是6.x 是加入
<role rolename="admin"/>
<role rolename="manager"/>
<user username="admin" password="admin" roles="admin,manager"/>

 

http://zhumeng8337797.blog.163.com/blog/static/100768914201291695341706/

手上接触Tomcat的项目越来越多,虽说tomcatmanager本身带了很简单的监控服务器状态的工具,但是那个对服务器的详细状态和集群的监控来说还是太简陋了,找了下发现Lambda Probe这个工具还不错,监控得很详细。

 

安装:
1.
Lambda Probe官方网站下载最新的Lambda Probe(目前是1.7b),直接下载BINARIES解压得到probe.war

下载地址 wget   http://www.lambdaprobe.org/downloads/1.7/probe.1.7b.zip

   unzip   probe.1.7b.zip


2.  

关闭正在运行的Tomcat

 

3.       probe.war文件复制:  mv  probe.war  /usr/local/tomcat6.0.20/webapps/

 

4.       /usr/local/tomcat6.0.20/conf/tomcat-users.xml下确保添加了manager用户

如下:

vi    /usr/local/tomcat6.0.20/conf/tomcat-users.xml   增中以下内容:

<role rolename="manager"/>
<user username="用户名" password="密码" roles="manager"/>

 

5.编辑/etc/profile.d/java.sh,增加JAVA_OPTS环境参数,这个参数是用来载入-Dcom.sun.management.jmxremote,以让Lambda Probe取得服务器环境状态。
        
JAVA_OPTS=-Dcom.sun.management.jmxremote
        
export JAVA_OPTS

以上内容放到Java环境变量中

 

 

 

6. 启动Tomcat,使用管理账户登录:  http://IP:8080/probe/   接着输入刚才设置的用户名和密码

 

 

7.下载messages_zh_CN.properties 汉化文件 ( 关闭Tomcat )

wget   http://www.deepseabug.cn/blog/wp-content/uploads/file/20090416/messages_zh_CN.zip 解压并且复制          

mv  messages_zh_CN.properties   /usr/local/tomcat6.0.20/webapps/probe/WEB-INF/

 

8. 启动Tomcat,使用管理账户登录http://IP:8080/probe/

  看到中文,说明汉化成功!

 Lambda Probe监控Tomcat - ^o^星禾じ☆v - 环境不景气,自己要争气!

 

 

 

http://tonrenyuye.blog.163.com/blog/static/300125762008971557183/

 

Tomcat中JDBCRealm的配置  

2008-10-07 13:05:57|  分类: tomcat|字号 订阅

 
 
在配置Tomcat的JDBCRealm的时候,有几个应该注意的地方

   1. 数据库JDBC驱动应该放在${tomcat.home}/server/lib目录下,而不能放在webapps的lib目录下,二者的class loader不同
   2. tomcat在启动时只会自动装载后缀为.jar的jar包,因此如果使用oracle9i的驱动,应把class12.zip改名为class12.jar
   3. 最好将JDBCRealm的配置信息放在webapp的context配置文件中,而不要放在server.xml中


e.g.
<!-- ======================================================================= -->
<!-- This file is deployed to Tomcat 4.1.x using the "setup-tomcat" ant      -->
<!-- task. You can also manually copy it to Tomcat's webapps directory.      -->
<!-- ======================================================================= -->

<!-- To use Tomcat's MemoryRealm (in $CATALINA_HOME/conf/tomcat-users.xml)
     simply comment out both of the Realm's below.  MemoryRealm is the 
     default realm for all applications, specified in 
     $CATALINA_HOME/conf/server.xml.
     
     To use Tomcat's JDBCRealm, JNDIRealm or JAASRealm, uncomment the 
     appropriate section below.  All of these 3 realms require supplemental
     drivers (JAR files) in $CATALINA_HOME/common/lib.
     
     jdbc/mysql: http://www.mysql.com/downloads/api-jdbc-stable.html
                 - JAR: mysql-connector-java-2.0.14-bin.jar
     jdbc/postgresql: http://www.postgresql.org/
                 - JAR: postgresql-jdbc3-7.3.jar
     jndi/ldap:  http://java.sun.com/products/jndi/index.html#download
                 - JAR: ldap.jar
     jaas:       http://free.tagish.net/jaas/index.jsp
                 - JAR: tagishauth.jar

     NOTE: For the JAASRealm, you must also add the path to NTSystem.dll to
     your $PATH environment variable.
     
-->

<!-- Simchronize-selfcare Application Context -->
<Context path="/simchronize-selfcare" docBase="simchronize-selfcare" debug="99" reloadable="true">
    <Logger className="org.apache.catalina.logger.FileLogger" 
        prefix="simchronize_selfcare_log." suffix=".txt" timestamp="true"/>

    <!--
        
    <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
          driverName="oracle.jdbc.driver.OracleDriver"
       connectionURL="jdbc:oracle:thin:@10.168.195.62:1521:SIMCHRO"
      connectionName="SIMCHR_24" connectionPassword="SIMCHR_24"
           userTable="SIMCHR_SELFCARE_USERS" userNameCol="MSISDN" userCredCol="PASSWD"
       userRoleTable="SIMCHR_SELFCARE_USER_ROLES" roleNameCol="ROLE" />
   -->

    <!-- NOTE: If you want to use a DataSourceRealm, the Resource must be a
               global resource -->
    <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
          driverName="oracle.jdbc.driver.OracleDriver"
       connectionURL="jdbc:oracle:thin:@10.168.195.62:1521:SIMCHRO"
      connectionName="SIMCHR_24" connectionPassword="SIMCHR_24"
           userTable="SIMCHR_SELFCARE_USERS" userNameCol="MSISDN" userCredCol="PASSWD"
       userRoleTable="SIMCHR_SELFCARE_USER_ROLES" roleNameCol="ROLE" />
       
    <Resource auth="Container" type="javax.sql.DataSource"/>
    <ResourceParams >
        <parameter>
            <name>factory</name>
            <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
        </parameter>
        <!-- Maximum number of dB connections in pool. Make sure you
             configure your mysqld max_connections large enough to handle
             all of your db connections. Set to 0 for no limit.
             -->
        <parameter>
            <name>maxActive</name>
            <value>100</value>
        </parameter>
        <!-- Maximum number of idle dB connections to retain in pool.
             Set to 0 for no limit.
             -->
        <parameter>
            <name>maxIdle</name>
            <value>30</value>
        </parameter>
        <!-- Maximum time to wait for a dB connection to become available
             in ms, in this example 10 seconds. An Exception is thrown if
             this timeout is exceeded.  Set to -1 to wait indefinitely.
             -->
        <parameter>
            <name>maxWait</name>
            <value>10000</value>
        </parameter>
        <!-- MySQL dB username and password for dB connections  -->
        <parameter>
            <name>username</name>
            <value>SIMCHR_24</value>
        </parameter>
        <parameter>
            <name>password</name>
            <value>SIMCHR_24</value>
        </parameter>
        <!-- Class name for JDBC driver -->
        <parameter>
            <name>driverClassName</name>
            <value>oracle.jdbc.driver.OracleDriver</value>
        </parameter>
        <!-- Autocommit setting.  This setting is required to make
             Hibernate work.  Or you can remove calls to commit(). -->
        <parameter>
            <name>defaultAutoCommit</name>
            <value>true</value>
        </parameter>
        <!-- The JDBC connection url for connecting to your MySQL dB.
             The autoReconnect=true argument to the url makes sure that the
             mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
             connection.  mysqld by default closes idle connections after 8 hours.
             -->
        <parameter>
            <name>url</name>
            <value>jdbc:oracle:thin:@10.168.195.62:1521:SIMCHRO</value>
        </parameter>
        <!-- Recover abandoned connections -->
        <parameter>
            <name>removeAbandoned</name>
            <value>true</value>
        </parameter>
        <!-- Set the number of seconds a dB connection has been idle 
             before it is considered abandoned. 
             -->
        <parameter>
            <name>removeAbandonedTimeout</name>
            <value>60</value>
        </parameter>
        <!-- Log a stack trace of the code which abandoned the dB 
             connection resources. 
             -->
        <parameter>
            <name>logAbandoned</name>
            <value>true</value>
        </parameter>
    </ResourceParams>
 
</Context>
posted @ 2012-12-18 20:53  陳聽溪  阅读(825)  评论(0)    收藏  举报