【发布时间】:2014-04-04 19:02:58
【问题描述】:
我正在尝试在单个上运行 2 个 tomcat 实例。我已经更新了两个 tomcat 实例的 server.xml,以便 http/https 端口不同。我还更新了 setenv.sh 中的 CATALINA_OPTS 以便远程 jmx 端口不同。
Tomcat 1 的 CATALINA_OPTS:
CATALINA_OPTS="-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=7061 \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false \
-javaagent:/mnt/production/tomcat/bin/remoteagent.jar"
Tomcat 2 的 CATALINA_OPTS:
CATALINA_OPTS="-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=7065 \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false \
-javaagent:/mnt/production/tomcat/bin/remoteagent.jar \
-Djava.security.auth.login.config=$CATALINA_HOME/conf/crowd.conf"
但是当我尝试启动第二个 tomcat 实例时,我在端口 3000 上遇到了绑定异常。我对第一个 tomcat 实例的日志进行了 grep,我在 catalina 日志文件中看到了以下行:
Created service URL service:jmx:rmi://localhost:3001/jndi/rmi://localhost:3000/jmxrmi
我将整个 tomcat 目录 grep 为 3000,但没有关于端口 3000 的配置。所以我认为这是一些默认配置。有人知道如何修改此配置。
【问题讨论】:
-
tomcat的版本是多少? 6 还是 7?
-
看看这个,它可能会帮助stackoverflow.com/questions/16110528/…