설치 및 업그레이드 > 설치 및 구성 안내서 > PTC Solution Installer 사용 > Windchill 솔루션 설치 > 선택적 제품 설정 > Windchill Index Search 설치 > Windchill Index Search 사후 설치 구성 > 클라우드 모드로 색인 검색 서버 구성
  
클라우드 모드로 색인 검색 서버 구성
클라우드 모드로 색인 검색 서버를 설치한 경우 다음 단계를 수행합니다.
* 
Java 8 이상을 사용 중인지 확인합니다. 그렇지 않으면 다음 명령을 실행하기 전에 SOLR_JAVA_HOME 환경 변수를 설정합니다.
Windows: SET SOLR_JAVA_HOME=<PATH_TO_JAVA_8>
Unix: export SOLR_JAVA_HOME=<PATH_TO_JAVA_8>
Zookeeper 노드 설정 및 시작
1. 각 Zookeeper 노드에 대한 데이터 디렉토리를 작성합니다. 예:
Windows:
D:\ptc\commondata\zkdata\node1
D:\ptc\commondata\zkdata\node2
D:\ptc\commondata\zkdata\node3
Unix:
/opt/ptc/commondata/zkdata/node1
/opt/ptc/commondata/zkdata/node2
/opt/ptc/commondata/zkdata/node3
2. 이름이 "myid"인 파일을 작성하여 Zookeeper 노드를 식별합니다. 이 파일의 컨텐트가 Zookeeper 노드를 식별해야 합니다.
예를 들어, 다음 myid 파일의 컨텐트는 번호 1입니다.
Windows:
D:\ptc\commondata\zkdata\node1\myid
Unix:
/opt/ptc/commondata/zkdata/node1/myid
2node2/myid에 입력하고 3node3/myid에 입력합니다.
* 
이는 Zookeeper에 지정되는 ID이며, 다음 단계에서 zoo.cfg에 사용됩니다.
3. 다음 Zookeeper 구성 파일을 작성합니다.
<INDEX_SEARCH_HOME>\zookeeper\conf\zoo.cfg
여기서 <INDEX_SEARCH_HOME>은 색인 검색 서버가 설치된 설치 디렉토리입니다.
node1에 대해 다음 컨텐트를 추가합니다.
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=D:\\ptc\\commondata\\zkdata\\node1 OR /opt/ptc/commondata/zkdata/node1
# the port at which the clients will connect
clientPort=<port#>
server.1=<host1>.ptcnet.ptc.com:2888:3888
server.2=<host2>.ptcnet.ptc.com:2889:3889
server.3=<host3>.ptcnet.ptc.com:2890:3890
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
다음 등록 정보는 고유해야 하며 각 Zookeeper 노드에 대해 지정되어야 합니다.
dataDir
Zookeeper 노드에 대한 데이터 디렉토리입니다.
clientPort
Zookeeper가 요청에 대해 수신하는 포트입니다.
4. 다음 명령을 실행하여 모든 Zookeeper 노드를 시작합니다.
Windows:
<INDEX_SEARCH_HOME>\zookeeper\bin\zkServer.cmd
Unix:
sh <INDEX_SEARCH_HOME>\zookeeper\bin\zkServer.sh start
* 
Zookeeper 노드가 시작되면 앙상블 구성(zoo.cfg)에 지정된 다른 Zookeeper 노드와의 통신을 시작합니다.
시작하는 동안 노드가 다른 Zookeeper 노드에 연결할 수 없음을 보고하는 로그 또는 콘솔의 오류를 볼 수 있습니다. 이는 노드가 시작되지 않았기 때문입니다. 이러한 오류는 무시해도 좋습니다.
Solr 코어 작성(클라우드)
* 
Java 8 이상을 사용 중인지 확인합니다. 그렇지 않으면 다음 명령을 실행하기 전에 SOLR_JAVA_HOME 환경 변수를 설정합니다.
Windows: SET SOLR_JAVA_HOME=<PATH_TO_JAVA_8>
Unix: export SOLR_JAVA_HOME=<PATH_TO_JAVA_8>
1. 다음 명령을 사용하여 명령 프롬프트를 열고 Solr을 시작합니다.
Solr 시작(Windows):
<INDEX_SEARCH_HOME>/bin/Index_Search_Server.bat start
Solr 중지(Windows):
<INDEX_SEARCH_HOME>/bin/Index_Search_Server.bat stop
Solr 시작(Unix):
sh <INDEX_SEARCH_HOME>/bin/Index_Search_Server.sh start
Solr 중지(Unix):
sh <INDEX_SEARCH_HOME>/bin/Index_Search_Server.sh stop
여기서 <INDEX_SEARCH_HOME>은 색인 검색 서버가 설치된 설치 디렉토리입니다.
2. 명령 프롬프트에서 <INDEX_SEARCH_HOME>/solr/bin으로 이동하고 다음 명령을 실행하여 필수 모듈에 대한 코어를 작성합니다.
Windows:
solr.cmd create -c <컬렉션 이름> -n <ConfigSet 이름> -d <ConfigSet 경로> -shards <샤드 수> -replicationFactor <복제본 수(Solr 노드)>
Unix:
solr create -c <컬렉션 이름> -n <ConfigSet 이름> -d <ConfigSet 경로> -shards <샤드 수> -replicationFactor <복제본 수(Solr 노드)>
* 
설치 시 이 명령을 한 번만 실행합니다. Zookeeper는 전체 Solr 클라우드에서 코어를 사용할 수 있도록 해줍니다.
Windchill Index Search
Windows:
solr.cmd create -c wblib -n wblib -d D:\ptc\IndexSearchServer_Solr1\solr_schemas\wblib -shards 1 -replicationFactor 2
Unix:
solr create -c wblib -n wblib -d /opt/ptc/IndexSearchServer_Solr1/solr_schemas/wblib -shards 1 -replicationFactor 2
Windchill PartsLink
Windows:
solr.cmd create -c clfstructurelib -n clfstructurelib -d D:\ptc\IndexSearchServer_Solr1\solr_schemas\clfstructurelib -shards 1 -replicationFactor 2
Unix:
solr create -c clfstructurelib -n clfstructurelib -d /opt/ptc/IndexSearchServer_Solr1/solr_schemas/clfstructurelib -shards 1 -replicationFactor 2
S1000D
Windows:
solr.cmd create -c sisaadlib -n sisaadlib -d D:\ptc\IndexSearchServer_Solr1\solr_schemas\sisaadlib -shards 1 -replicationFactor 2
Unix:
solr create -c sisaadlib -n sisaadlib -d /opt/ptc/IndexSearchServer_Solr1/solr_schemas/sisaadlib -shards 1 -replicationFactor 2
* 
선택적 모듈이 설치되지 않아도 Windchill Index Search, Windchill PartsLink 및 S1000D에 대한 코어를 작성하는 것이 좋습니다. 따라서 나중에 이러한 모듈을 설치하려는 경우 해당 코어를 작성할 필요가 없습니다.
3. Solr 관리자 인터페이스를 열고 Solr이 실행 중이며 코어를 사용 가능한지 확인합니다.
http://<SOLR_HOSTNAME>:<SOLR_PORT>/solr
클라우드 모드에 대해 Solr 스키마 업데이트(선택 사항)
Solr 스키마를 업데이트하려면 다음 단계를 수행합니다.
1. <INDEX_SEARCH_HOME>/solr_schemas로 이동하고 필수 업데이트를 수행합니다.
2. <INDEX_SEARCH_HOME>/solr/server/scripts/cloud-scripts로 이동하고 다음 명령을 실행하여 업데이트된 스키마를 Zookeeper에 업로드합니다.
Windows:
zkcli.bat -cmd upconfig -confname <configset 이름> -z <Zookeeper 호스트 이름:포트 엔트리의 쉼표로 구분된 목록> -confdir <schema_config 경로>
Unix:
zkcli.sh -cmd upconfig -confname <configset 이름> -z <Zookeeper 호스트 이름:포트 엔트리의 쉼표로 구분된 목록> -confdir <schema_config 경로>
예:
Windows:
zkcli.bat -cmd upconfig -confname wblib -z host1.ptcnet.ptc.com:2181,host2.ptcnet.ptc.com:2182,host3.ptcnet.ptc.com:2183 -confdir <INDEX_SEARCH_HOME>\solr_schemas\wblib\conf
Unix:
sh zkcli.sh -cmd upconfig -confname wblib -z host1.ptcnet.ptc.com:2181,host2.ptcnet.ptc.com:2182,host3.ptcnet.ptc.com:2183 -confdir <INDEX_SEARCH_HOME>\solr_schemas\wblib\conf
기존 Solr 클라우드에서 Solr 노드 추가 또는 제거
Solr 노드 추가
1. 클라우드 모드로 색인 검색 서버 설치에 설명된 대로 색인 검색 서버를 설치하고 Zookeeper 호스트, Solr 호스트, Solr 데이터 디렉토리, Solr 포트, Solr 사용자 및 Solr 암호에 대한 적절한 입력을 제공합니다.
2. Solr 노드를 시작합니다.
3. Solr URL을 사용하여 다음 API를 호출하여 이 새 노드에서 복제본을 작성하고 해당 복제본을 Solr에 추가합니다.
<SOLR_URL>/solr/admin/collections?action=ADDREPLICA&collection=<Collection_name>&shard=<shard_name>
예:
Windchill Index Search:
http://host1.ptcnet.ptc.com:9501/solr/admin/collections?action=ADDREPLICA&collection=wblib&shard=shard1
Windchill PartsLink:
http://host1.ptcnet.ptc.com:9501/solr/admin/collections?action=ADDREPLICA&collection=clfstructurelib&shard=shard1
S1000D:
http://host1.ptcnet.ptc.com:9501/solr/admin/collections?action=ADDREPLICA&collection=sisaadlib&shard=shard1
* 
또한 복제본이 작성되어야 하는 노드를 지정하도록 추가 매개변수를 포함할 수 있습니다. 예를 들어,
http://host1.ptcnet.ptc.com:9501/solr/admin/collections?action=ADDREPLICA&collection=wblib&shard=shard1&node=127.0.0.1:9501_solr
입니다.
Solr 노드 제거
1. Solr URL을 사용하여 다음 API를 호출하여 Solr 클라우드에서 복제본을 삭제합니다.
<SOLR_URL>/solr/admin/collections?action=DELETEREPLICA&collection=<Collection_name>&shard=<shard_name>&replica=<replica_node_naeme>
* 
샤드 이름(shard) 및 복제본 노드 이름(coreNodeName) 값은 <INDEX_SEARCH_HOME>/solr/server/solr/<collection_core_name> 아래에 있는 core.properties 파일에서 찾을 수 있습니다.
예:
Windchill Index Search:
http://host1.ptcnet.ptc.com:9501/solr/admin/collections?action=DELETEREPLICA&collection=wblib&shard=shard1&replica=core_node1
Windchill PartsLink:
http://host1.ptcnet.ptc.com:9501/solr/admin/collections?action=DELETEREPLICA&collection=clfstructurelib&shard=shard1&replica=core_node1
S1000D:
http://host1.ptcnet.ptc.com:9501/solr/admin/collections?action=DELETEREPLICA&collection=sisaadlib&shard=shard1&replica=core_node1
2. 제거된 Solr 노드에 대한 설치 파일을 삭제할 수 있습니다.
기존 Solr 클라우드에서 Zookeeper 노드 추가 또는 제거
Zookeeper 노드 추가
1. 클라우드 모드로 색인 검색 서버 설치에 설명된 대로 색인 검색 서버를 설치하고 Zookeeper 호스트, Solr 호스트, Solr 데이터 디렉토리, Solr 포트, Solr 사용자 및 Solr 암호에 대해 적절한 입력을 제공합니다.
2. "Zookeeper 노드 설정 및 시작" 단원에 설명된 대로 zoo.cfg를 추가하여 Zookeeper 노드를 구성합니다.
3. 새 노드에 대한 엔트리를 추가하도록 모든 기존 Zookeeper 노드에 대한 zoo.cfg를 업데이트합니다.
4. 모든 Zookeeper 노드를 다시 시작합니다.
5. 새 Zookeeper 노드를 추가하도록 모든 Solr 노드의 solrserver.properties를 업데이트합니다.
xconfmanager -s wt.index.zookeeperHosts=<Zookeeper 호스트 이름:포트 엔트리의 쉼표로 구분된 목록> -t config/solrserver.properties -p
6. 모든 Solr 노드를 다시 시작합니다.
7. 새 Zookeeper 노드를 추가하도록 wt.properties를 업데이트합니다.
xconfmanager -s wt.index.zookeeperHosts=<Zookeeper 호스트 이름:포트 엔트리의 쉼표로 구분된 목록> -t codebase/wt.properties -p
8. Windchill를 다시 시작합니다.
Zookeeper 노드 제거
1. 노드에 대한 엔트리를 제거하도록 모든 기존 Zookeeper 노드에 대한 zoo.cfg를 업데이트합니다.
2. 모든 Zookeeper 노드를 다시 시작합니다.
3. Zookeeper 노드를 제거하도록 모든 Solr 노드의 solrserver.properties를 업데이트합니다.
xconfmanager -s wt.index.zookeeperHosts=<Zookeeper 호스트 이름:포트 엔트리의 쉼표로 구분된 목록> -t config/solrserver.properties -p
4. 모든 Solr 노드를 다시 시작합니다.
5. Zookeeper 노드를 제거하도록 wt.properties를 업데이트합니다.
xconfmanager -s wt.index.zookeeperHosts=<Zookeeper 호스트 이름:포트 엔트리의 쉼표로 구분된 목록> -t codebase/wt.properties -p
6. Windchill를 다시 시작합니다.
Solr에 대한 기본 인증 구성(클라우드 모드)
1. 명령 프롬프트를 열고 <INDEX_SEARCH_HOME>/solr/server/scripts/cloud-scripts로 이동합니다.
2. 다음 명령을 실행하여 security.json을 Zookeeper 노드 앙상블에 로드합니다.
Windows:
zkcli.bat -cmd putfile /security.json <INDEX_SEARCH_HOME>/config/solr/security.json -z <Zookeeper 호스트 이름:포트 엔트리의 쉼표로 구분된 목록>
Unix:
sh zkcli.sh -cmd putfile /security.json <INDEX_SEARCH_HOME>/config/solr/security.json -z <Zookeeper 호스트 이름:포트 엔트리의 쉼표로 구분된 목록>
* 
색인 검색 서버에 대한 등록 정보를 설정하기 위해 xconfmanger가 실행될 때마다 제공된 사용자 이름 및 암호를 사용하여 <INDEX_SEARCH_HOME>/config/solr/security.json을 생성합니다. 이 파일은 Solr 클라우드에 대한 인증 정보를 설정하거나 변경하기 위해 Zookeeper 노드 앙상블에 로드될 수 있습니다.
3. Solr 관리자 인터페이스를 열고 사용자 이름 및 암호를 묻는 메시지가 표시되는지 확인합니다.
http://<SOLR_HOSTNAME>:<SOLR_PORT>/solr
Solr 사용자 또는 암호 변경
Solr 사용자 또는 암호를 변경할 때 Windchill Index Search 클라이언트 및 서버를 모두 업데이트해야 합니다.
1. Windchill 셸을 열고 다음 명령을 실행하여 Windchill Index Search 클라이언트에 대한 암호 또는 사용자를 변경합니다.
xconfmanager -s wt.index.solrAdminUser=<New_User> -t codebase/WEB-INF/conf/index.solrAuth.properties -p
xconfmanager -s wt.index.solrAdminPassword=<New_Password> -t codebase/WEB-INF/conf/index.solrAuth.properties -p
2. Windchill를 다시 시작합니다.
3. 명령 프롬프트에서 <INDEX_SEARCH_HOME>/bin으로 이동하고 다음 명령을 실행하여 Windchill Index Search 서버에 대한 암호 또는 사용자를 변경합니다.
Windows:
xconfmanager -s wt.index.server.solrAdminUser=<New_User> -t config/solrserver.properties -p
xconfmanager -s wt.index.server.solrAdminPassword=<New_Password> -t config/solrserver.properties -p
Unix:
sh xconfmanager -s wt.index.server.solrAdminUser=<New_User> -t config/solrserver.properties -p
sh xconfmanager -s wt.index.server.solrAdminPassword=<New_Password> -t config/solrserver.properties -p
4. 위에서 설명한 단계를 수행하여 <INDEX_SEARCH_HOME>/config/solr/security.json을 Zookeeper 노드 앙상블에 로드합니다.
5. Solr 및 Zookeeper 노드를 다시 시작합니다.
클라우드 색인 검색 서버(Solr)에 대한 SSL 구성
시작하려면 먼저 PEM 형식으로 변환된 인증서 및 키를 단일 파일로 가지고 있어야 합니다.
* 
인증서 전용 파일이 없는 경우 선택적으로 인증서 및 키 파일에서 해당 파일을 생성할 수 있습니다.
1. 키 도구 유틸리티를 사용하여 JKS 키스토어를 PKCS12 형식으로 변환합니다.
keytool -importkeystore -srckeystore solr-ssl.keystore.jks -destkeystore solr-ssl.keystore.p12 -srcstoretype jks -deststoretype pkcs12
2. openssl 명령(
openssl pkcs12 -nokeys -in solr-ssl.keystore.p12 -out solr-ssl.cacert.pem
)을 사용하여 키가 아닌 인증서만 포함하는 PKCS12 형식의 키스토어를 PEM 형식으로 변환합니다.
Solr에 대한 SSL 구성
Solr을 실행 중인 모든 노드에 대해 Windchill Index Search 서버를 구성합니다. 모든 노드에 대해 동일한 인증서 및 키 파일을 사용합니다.
1. 인증서(JKS) 파일을 <Index_Search_Home>/solr/server/etc에 복사합니다.
2. 공통 SSL 관련 시스템 등록 정보를 설정합니다.
SSL 설정을 활성화하려면 다음 파일에서 SOLR_SSL_*부터 등록 정보 세트의 설명을 제거하고 업데이트합니다.
Windows: bin\solr.in.cmd
예:
set SOLR_SSL_KEY_STORE=etc/solr-ssl.keystore.jks
set SOLR_SSL_KEY_STORE_PASSWORD=secret)
set SOLR_SSL_TRUST_STORE=etc/solr-ssl.keystore.jks
set SOLR_SSL_TRUST_STORE_PASSWORD=secret
REM Require clients to authenticate
set SOLR_SSL_NEED_CLIENT_AUTH=false
REM Enable clients to authenticate (but not require)
set SOLR_SSL_WANT_CLIENT_AUTH=false
Unix: bin/solr.in.sh
예:
bin/solr.in.sh example SOLR_SSL_* configuration
SOLR_SSL_KEY_STORE=etc/solr-ssl.keystore.jks
SOLR_SSL_KEY_STORE_PASSWORD=secret
SOLR_SSL_TRUST_STORE=etc/solr-ssl.keystore.jks
SOLR_SSL_TRUST_STORE_PASSWORD=secret
# Require clients to authenticate
SOLR_SSL_NEED_CLIENT_AUTH=false
# Enable clients to authenticate (but not require)
SOLR_SSL_WANT_CLIENT_AUTH=false
여기서 "secret"는 인증서를 작성할 때 제공되는 암호입니다.
3. Windchill 셸을 열고 다음 명령을 실행하여 프로토콜을 색인 검색 서버에 연결될 때 색인 검색 클라이언트에서 사용할 HTTPS로 설정합니다.
xconfmanager -s wt.index.solrProtocol=https -t codebase/wt.properties -p
4. SSL을 사용하도록 Windchill이 구성된 경우 Windchill 외부에서 사용 중인 모든 Java 클라이언트에 연결하는 데 인증서가 필요합니다.
결과적으로 인증서를 Solr 클라우드의 Solr 노드에서 사용 중인 JVM으로 가져와야 합니다. 이렇게 하면 Solr 노드가 Windchill에 연결하고 색인을 위한 문서를 다운로드할 수 있습니다.
인증서 파일을 JVM 신뢰 스토어(Solr 노드의 JDK/JVM)에 추가합니다.
a. Solr 노드에서 사용하는 Java 위치로 이동하여 <JAVA>/jre/lib/security 아래에 있는 cacerts 파일의 경로를 확인합니다.
b. <JAVA>/jre/bin으로 이동하여 새 인증서를 가져옵니다. cacerts에 쓸 수 있는 권한을 가진 사용자로 다음 키 도구 유틸리티를 실행합니다.
keytool -import -file <인증서 파일> -alias <고유 이름> -keystore <cacerts 파일 경로>
예를 들어,
keytool -import -file D:\SolrWithSSL\solr-5.4.1\server\etc\solr-ssl.cacert.pem -alias Key_Alias -keystore ../lib/security/cacerts
입니다.
* 
JVM 키스토어의 기본 암호는 "changeit"입니다.
5. Windchill를 다시 시작합니다.
Zookeeper에 대한 SSL 구성
1. Solr 노드를 시작하기 전에 urlScheme 클러스터 전체 등록 정보를 https로 설정해야 합니다.
명령 프롬프트를 열고 <INDEX_SEARCH_HOME>/solr/server/scripts/cloud-scripts로 이동하고 다음 명령을 실행합니다.
Windows:
zkcli.bat -zkhost <Zookeeper 호스트 이름:포트 엔트리의 쉼표로 구분된 목록> -cmd clusterprop -name urlScheme -val https
예:
zkcli.bat -zkhost host1.ptcnet.ptc.com:2181,host2.ptcnet.ptc.com:2182,host3.ptcnet.ptc.com:2183 -cmd clusterprop -name urlScheme -val https
Unix:
sh zkcli.sh -zkhost <Zookeeper 호스트 이름:포트 엔트리의 쉼표로 구분된 목록> -cmd clusterprop -name urlScheme -val https
예:
sh zkcli.sh -zkhost host1.ptcnet.ptc.com:2181,host2.ptcnet.ptc.com:2182,host3.ptcnet.ptc.com:2183 -cmd clusterprop -name urlScheme -val https
* 
Zookeeper 노드를 다시 시작할 때마다 urlScheme 명령을 실행해야 합니다.
2. Solr 클라우드(Zookeeper 노드 및 Solr 노드)를 다시 시작한 다음 Solr 관리 인터페이스로 이동하여 Solr이 SSL과 함께 실행 중인지 확인합니다.
* 
SSL의 알려진 문제의 경우 다음 사이트를 참조하십시오.