在启动windchill服务的时候,是不是经常会出现MethodServer 无法启动的情况,在排查时,经常会发现没有日志,什么表面问题都无法定位信息。
下面介绍几个常见的排查方法
场景一
ServerManager 可以启动,但处于挂起状态。methodserver没有启动反应
Server Manager日志中的报错如下:
2015-06-29 13:46:21,101 INFO [main] wt.server.manager.startup - ServerManager bound in registry.
2015-06-29 13:46:21,108 INFO [main] wt.manager.CacheMasterNegotiator - Cache master stub name: CacheMaster
2015-06-29 13:46:21,108 INFO [main] wt.manager.CacheMasterNegotiator - Using low-locking algorithm
场景一问题定位:
1.HOSTS 文件中的服务器别名或服务器名称配置映射到了错误的IP地址
2.连接数据库服务器失败
场景一解决办法
1.查看host文件
2.如果是数据库,可能是由于数据库无法识别监听,可以使用plsql 看是否能使用db.properties 文件中的配合进行连接数据库,如果数据无法连接,但用sqlplus可以连接,可能是因为TNS的description有问题, 无法识别host,可以将TNS串的host修改为127.0.0.1尝试下。
3、如果管理员账号可以登录而用户无法登录,考虑数据库密码期限的问题;参考《oracle 用户密码过期-ORA-28001: 口令已经失效》解决
场景二
- 重新托管后 ServerManager 无法启动 Methodserver
- ServerManager 无法启动 Methodserver
- ServerManager.log 文件中的错误消息:
INFO [Thread-3] wt.system.err - java.io.IOException: Server returned HTTP response code: 503 for URL: http://<Windchill_Hostname>/Windchill/wt.properties INFO [Thread-3] wt.system.err - at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1626) INFO [Thread-3] wt.system.err - at java.net.URL.openStream(URL.java:1037) INFO [Thread-3] wt.system.err - at wt.boot.WTRMIHttpToCodebaseSocketFactory$1.run(WTRMIHttpToCodebaseSocketFactory.java:169) INFO [Thread-3] wt.system.err - at wt.boot.WTRMIHttpToCodebaseSocketFactory$1.run(WTRMIHttpToCodebaseSocketFactory.java:159) INFO [Thread-3] wt.system.err - at java.security.AccessController.doPrivileged(Native Method) INFO [Thread-3] wt.system.err - at wt.boot.WTRMIHttpToCodebaseSocketFactory.getJavaRMI(WTRMIHttpToCodebaseSocketFactory.java:157) INFO [Thread-3] wt.system.err - at wt.boot.WTRMIHttpToCodebaseSocketFactory.createSocket(WTRMIHttpToCodebaseSocketFactory.java:71) INFO [Thread-3] wt.system.err - at wt.boot.AsyncConnector.runConnector(AsyncConnector.java:103) INFO [Thread-3] wt.system.err - at wt.boot.AsyncConnector.access$000(AsyncConnector.java:24) INFO [Thread-3] wt.system.err - at wt.boot.AsyncConnector$1.run(AsyncConnector.java:91) [Thread-3] wt.system.err - at wt.boot.AsyncConnector$1.run(AsyncConnector.java:87) [Thread-3] wt.system.err - at java.security.AccessController.doPrivileged(Native Method) INFO [Thread-3] wt.system.err - at wt.boot.AsyncConnector.run(AsyncConnector.java:85) INFO [main] wt.manager.CacheMasterNegotiator - Master stub retrieved: ServerManagerImpl$MasterServerManagerImpl_Stub[UnicastRef2 [liveRef: [endpoint:[<Source_Hostname>:5002,wt.boot.WTRMIMasterSocketFactory@1e240](remote),objID:[-12edfc31:14df83f32aa:-7ffd, 8702960912329086855]]]
- ServerManager.log 文件中的错误消息:
/home/work/ptc/Windchill_11.1/Windchill/tomcat/bin/tomcat-juli.jar /home/work/ptc/Windchill_11.1/Windchill/srclib/wnc/WtAsmAgent.jar INFO [main] wt.server.manager.startup - Registry created: RegistryImpl[UnicastServerRef2 [liveRef: [endpoint:[<node hostname>:5002,wt.boot.WTRMIMasterSocketFactory@1e240](local),objID:[0:0:0, 0]]]] INFO [main] wt.server.manager.startup - ServerManager created: ServerManagerImpl[UnicastServerRef2 [liveRef: [endpoint:[<node hostname>:5002,wt.boot.WTRMIMasterSocketFactory@1e240](local),objID:[0:0:0, 5002]]]] INFO [main] wt.server.manager.startup - ServerManager bound in registry. INFO [main] wt.manager.CacheMasterNegotiator - Cache master stub name: CacheMaster INFO [main] wt.manager.CacheMasterNegotiator - Using low-locking algorithm INFO [main] wt.manager.CacheMasterNegotiator - Master stub retrieved: ServerManagerImpl$MasterServerManagerImpl_Stub[UnicastRef2 [liveRef: [endpoint:[<node hostname>:5002,wt.boot.WTRMIMasterSocketFactory@1e240](remote),objID:[-dafe81f:17ac76e2274:-7ffd, 4891118635048615776]]]]
解决方案
1、确保主机文件中的IP和主机名映射正确
e.g <true host IP> <true FQDN> <Alias FQDN>
2.使用正确的数据库信息更新 <Windchill-Home>\db\db.properties 中的以下属性一个。
a. wt.pom.jdbc.host
b. wt.pom.jdbc.port
c. wt.pom.jdbc.service
3. 确保java.rmi.server.hostname是每个 Windchill 节点中 wt.properties 中每个节点的真实主机名
4. 使用命令备份表RMISTUBS-
- For SQL Server :
select * into <new_table_name> from <dbname>.RMIStubs;
- For Oracle:
create table <new_table_name> as select * from RMISTUBS;
5. 使用以下查询从 RMISTUBS 表中删除行:
- For SQL Server :
delete from <dbname>.RMIStubs;
- For Oracle:
delete from RMISTUBS;
commit;
6. 删除<Windchill home>\Tomcat\instances内容,清除tomcat缓存
7. 重新启动 Windchill
场景三
methodServer 一闪而过,后台没有日志,ServerManager可以启动,且没有异常,没有其他任何异常信息。
这个问题是比较头疼的,因为没有切入点去找到有用的信息
场景二问题定位:
因为没有直接的信息反馈,methodServer 一闪而过,说明MS 是可以启动的。
定位方式:
1.打开methodServer 和 ServerManager日志
- 针对服务器管理器
编辑<Windchill>/codebase/log4j.properties 文件,添加log4j.logger.wt.manager.ServerLauncher=ALL
在Windchill外壳程序上执行 Windchill start
这样会输出启动服务器管理器的完整的命令行到终端上
- 针对方法服务器
编辑<Windchill>/codebase/WEB-INF/log4jServerManager.properties 文件,添加log4j.logger.wt.manager.ServerLauncher=ALL
在Windchill外壳程序上执行 Windchill start
当服务器管理器尝试启动方法服务器时,这样会输出启动完整的命令行到 服务器管理器 日志
2.找到methodServer 和ServerManger的真实启动方式
- 针对服务器管理器
Windchill外壳程序上执行以下命令
windchill wt.manager.BaseServerLauncher -p ServerManager
- 针对方法服务器
Windchill外壳程序上执行以下命令
windchill wt.manager.BaseServerLauncher -p MethodServer
3.拷贝以上命令输出结果,在Windchill shell中,重新输入命令
针对Microsoft Windows操作系统
cmd.exe /C start "ServerManager" /MIN "C:\ptc\Windchill_9.1\Java\jre\bin\java.exe" ... 修改为 "C:\ptc\Windchill_9.1\Java\jre\bin\java.exe"...
针对Unix
xterm -title ServerManager -sb -sl 500 -e /opt/java1.6/jre/bin/java ... 修改为 /opt/java1.6/jre/bin/java ...
输出完第三步的命令之后,可以在Windchill shell中看到错误的异常信息,同时后台会有异常打印。
场景二的定位方式可以适用于所有methodServer 或者 ServerMnaager不能启动的情况