
私たちは SNMP を使用する監視アプリケーションを持っており、bin/setenv.sh
ファイル内の次のオプションを使用して Tomcat サーバーで SNMP を有効にしています。
#
# SNMP for Tomcat
#
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.snmp.interface=10.101.21.31"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.snmp.port=1651"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.snmp.acl=false"
Tomcat の起動時にはまったく問題はなく、すべてがクリーンです。しかし、Tomcat を停止するときにこのエラーが発生します。
[tomcat@webserver1 bin]$ ./catalina.sh stop
JAVA_OPTS: %JAVA_OPTS%
Using CATALINA_BASE: /opt/tomcat7.1
Using CATALINA_HOME: /opt/tomcat7.1
Using CATALINA_TMPDIR: /opt/tomcat7.1/temp
Using JRE_HOME: /usr
Using CLASSPATH: /opt/tomcat7.1/bin/bootstrap.jar:/opt/tomcat7.1/bin/tomcat-juli.jar
Error: Failed to start SNMP adaptor with address: /10.101.21.31:1651 (Address already in use)
とにかく、Tomcat を強制終了するのではなく、正常に停止することはできますか?
答え1
CATALINA_OPTS
の代わりにを使用する必要がありますJAVA_OPTS
。catalina.sh
スクリプトではその違いを非常にわかりやすく説明しています。
# CATALINA_OPTS (Optional) Java runtime options used when the "start",
# "run" or "debug" command is executed.
# Include here and not in JAVA_OPTS all options, that should
# only be used by Tomcat itself, not by the stop process,
# the version command etc.
# Examples are heap size, GC logging, JMX ports etc.
JAVA_OPTS
が に設定されているということは%JAVA_OPTS%
、何か問題があることを示しています (おそらく、win32 管理者によって作成されたスクリプトです)。