疫情期间,利用业余时间继续实践总结,此次将昨日的单机windchill修改为集群。
效果如下:
操作步骤如下:
1. 将源单机作为master服务器,设置host文件以及修改机器名(master.ptc.com)
切记机器名一定要改,而且要重启才生效。此处三台虚拟机重启了两台,就单忘记了这台未重启。耽误相当多的时间。在slave机器出现“注册从属缓存失败”。
127.0.0.1 pdm.ptc.com
192.168.158.128 ccs.ptc.com
192.168.158.129 pdmdb.ptc.com
192.168.158.130 master.ptc.com
192.168.158.131 slave1.ptc.com
192.168.158.132 slave2.ptc.com
2. 在master机器上执行:
xconfmanager -s java.rmi.server.hostname=master.ptc.com -t codebase/wt.properties
xconfmanager -s wt.cache.master.slaveHosts="master.ptc.com slave1.ptc.com slave2.ptc.com 192.168.158.130 192.168.158.131 192.168.158.132" -t codebase/wt.properties
xconfmanager -s wt.rmi.server.hostname=pdm.ptc.com -t codebase/wt.properties
xconfmanager -s wt.cache.master.hostname=master.ptc.com -t codebase/wt.properties
xconfmanager -s ie.ldap.serverHostName=master.ptc.com -t codebase/WEB-INF/ieStructProperties.txt
xconfmanager -s wt.server.codebase=http\://pdm.ptc.com/Windchill -t codebase/wt.properties
xconfmanager -s wt.cache.master.codebase=http\://master.ptc.com/Windchill -t codebase/wt.properties
以上修改记得一定要检查下是否真实修改。
3.修改
<Apache>/conf/extra/app-Windchill-AuthProvider.xml
<Apache>/conf/extra/app-Windchill-Solr-AuthProvider.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--Web App Auth Providers List-->
<providers>
<provider>
<name>Windchill-EnterpriseLdap</name>
<ldapUrl>ldap://master.ptc.com:389/ou=people,cn=EnterpriseLdap,cn=Windchill_10.2,o=ptc</ldapUrl>
<bindDn>cn=Manager</bindDn>
<bindPwd>manager</bindPwd>
</provider>
<provider>
<name>Windchill-AdministrativeLdap</name>
<ldapUrl>ldap://master.ptc.com:389/ou=people,cn=AdministrativeLdap,cn=Windchill_10.2,o=ptc</ldapUrl>
<bindDn>cn=Manager</bindDn>
<bindPwd>manager</bindPwd>
</provider>
</providers>
修改后
启动windchill shell,改变目录到Apache主目录,执行以下命令:
ant -f webAppConfig.xml regenWebAppConf
ant -f webAppConfig.xml regenWebAppConf -DappName=Windchill-Solr
4.启动master,确保能够访问登录后关闭。
5.拷贝master虚拟机至slave1,设置host以及修改机器名slave1
127.0.0.1 pdm.ptc.com
192.168.158.128 ccs.ptc.com
192.168.158.129 pdmdb.ptc.com
192.168.158.130 master.ptc.com
192.168.158.131 slave1.ptc.com
192.168.158.132 slave2.ptc.com
执行命令:
xconfmanager -s java.rmi.server.hostname=slave1.ptc.com -t codebase/wt.properties
xconfmanager -s wt.cache.master.slaveHosts="master.ptc.com slave1.ptc.com slave2.ptc.com 192.168.158.130 192.168.158.131 192.168.158.132" -t codebase/wt.properties
xconfmanager -s wt.rmi.server.hostname=pdm.ptc.com -t codebase/wt.properties
xconfmanager -s wt.cache.master.hostname=master.ptc.com -t codebase/wt.properties
xconfmanager -s ie.ldap.serverHostName=master.ptc.com -t codebase/WEB-INF/ieStructProperties.txt
xconfmanager -s wt.server.codebase=http\://pdm.ptc.com/Windchill -t codebase/wt.properties
xconfmanager -s wt.cache.master.codebase=http\://master.ptc.com/Windchill -t codebase/wt.properties
6.拷贝master虚拟机至slave2,设置host以及修改机器名slave2
127.0.0.1 pdm.ptc.com
192.168.158.128 ccs.ptc.com
192.168.158.129 pdmdb.ptc.com
192.168.158.130 master.ptc.com
192.168.158.131 slave1.ptc.com
192.168.158.132 slave2.ptc.com
执行命令:
xconfmanager -s java.rmi.server.hostname=slave2.ptc.com -t codebase/wt.properties
xconfmanager -s wt.cache.master.slaveHosts="master.ptc.com slave1.ptc.com slave2.ptc.com 192.168.158.130 192.168.158.131 192.168.158.132" -t codebase/wt.properties
xconfmanager -s wt.rmi.server.hostname=pdm.ptc.com -t codebase/wt.properties
xconfmanager -s wt.cache.master.hostname=master.ptc.com -t codebase/wt.properties
xconfmanager -s ie.ldap.serverHostName=master.ptc.com -t codebase/WEB-INF/ieStructProperties.txt
xconfmanager -s wt.server.codebase=http\://pdm.ptc.com/Windchill -t codebase/wt.properties
xconfmanager -s wt.cache.master.codebase=http\://master.ptc.com/Windchill -t codebase/wt.properties
综上,结束。步骤简单,中间会有一些环境等各方面的问题。出现问题搜索ptc官方知识库,基本都能寻找到一些思路。
各位朋友如果在实践中发现此短文有疏忽,欢迎指正,谢谢大家!
2020/02/12 夜