ZooKeeper에 대한 SSL/TLS 구성
ThingWorx HA 클러스터링을 사용할 때 ZooKeeper에 대한 SSL 또는 TLS를 구성할 수 있습니다.
ZooKeeper 구성
1. 실행 중인 ZooKeeper 버전에서 SSL 또는 TLS를 지원하는지 확인합니다.
2. SSL 인증서 및 신뢰 저장소를 가져옵니다.
인증서에 유일하게 허용되는 확장은 JKS, PEM 및 PKCS12(p12)입니다.
3. apache-zookeeper-[버전]-bin/conf로 이동하여 zoo.cfg를 업데이트하거나 만듭니다.
4. 다음 엔트리를 추가합니다.
dataDir=/<path-to-zookeeper-data>/data
dataLogDir=/<path-to-zookeeper-datalog>/datalog
secureClientPort=2281
tickTime=2000
initLimit=5
syncLimit=2
autopurge.snapRetainCount=3
autopurge.purgeInterval=0
maxClientCnxns=60
admin.enableServer=true
standaloneEnabled=false
quorumListenOnAllIPs=true
sslQuorum=true
ZooKeeper 노드 간에 쿼럼을 활성화하려면 zoo.cfg 파일에서 sslQuorum=true 변수를 설정합니다. 노드는 자동 생성된 SSL을 사용하여 쿼럼을 보호합니다.
5. <ZooKeeper 경로>/bin/zkServer.sh를 수정합니다.
.
export SERVER_JVMFLAGS="
-Dzookeeper.serverCnxnFactory=org.apache.zookeeper.server.NettyServerCnxnFactory
-Dzookeeper.ssl.keyStore.location=<path-to-zookeeper-certificates>/zookeeper.p12
-Dzookeeper.ssl.keyStore.password=<certificate-password>
-Dzookeeper.ssl.trustStore.location=<path-to-zookeeper-certificates>/truststore.p12
-Dzookeeper.ssl.trustStore.password=<truststore-password>
-Dzookeeper.ssl.quorum.keyStore.location=<path-to-zookeeper-certificates>/zookeeper.p12
-Dzookeeper.ssl.quorum.keyStore.password=<certificate-password>
-Dzookeeper.ssl.quorum.trustStore.location=<path-to-zookeeper-certificates>/truststore.p12
-Dzookeeper.ssl.quorum.trustStore.password=<truststore-password>
-Dzookeeper.ssl.quorum.hostnameVerification=false
6. ZooKeeper를 시작합니다.
./zkServer.sh start
7. 로그에서 구성이 올바른지 확인합니다.
tail -f apache-zookeeper-3.5.6-bin/logs/<zookeeper-log-file>
ThingWorx 구성
1. ZooKeeper 인증서를 인스턴스에 복사하거나 ThingWorx를 실행하는 시스템에서 이 인증서를 사용할 수 있는지 확인합니다.
2. platform-settings.json을 수정하여 PlatformSettingsConfig와 동일한 수준에서 파일의 끝에 다음을 루트 요소로 포함합니다.
"ZookeeperSettings": {
"SSLEnabled": "true",
# If SSL is enabled, you must include the following; trust store is optional:
"KeyStorePath": "<path-to-zookeeper-certificates>/zookeeper.p12",
"KeyStorePass": "<certificate-password>",
"TrustStorePath": "<path-to-zookeeper-certificates>/truststore.p12",
"TrustStorePass": "<truststore-password>"
"SASLEnabled": "false",
# If SASL is enabled, you must include the following:
"JaasConfPath": "/tmp1/jaas.conf",
"Krb5ConfPath": "/tmp1/krb5.conf"
}
3. 기본 ZooKeeper 포트 2181을 검색하여 보안 포트 2281로 바꿉니다.
4. 모든 CoordinatorHosts 엔트리 및 address-resolver > connection ports가 업데이트되어 zoo.cfgsecureClientPort 값과 일치하는지 확인합니다.
Ignite 구성
1. Ignite 인증서를 ThingWorx 인스턴스에 복사하거나 Ignite 서버를 실행하는 시스템에서 이 인증서를 사용할 수 있는지 확인합니다.
2. ZOOKEEPER_CONNECTION 환경 변수를 설정하고, Ignite를 시작하는 데 사용되는 JVM_XOPTS 환경 변수를 찾아 다음과 같이 업데이트합니다.
# zookeeper1 represents the host name where zookeeper is available and 2281 the secure port from zoo.cfg
export ZOOKEEPER_CONNECTION=zookeeper1:2281,zookeeper2:2281,zookeeper3:2281
# update the JVM_XOPTS
JVM_XOPTS=-Dzookeeper.clientCnxnSocket=org.apache.zookeeper.ClientCnxnSocketNetty -Dzookeeper.client.secure=true -Dzookeeper.ssl.keyStore.location=<path-to-zookeeper-certificates>/zookeeper.p12 -Dzookeeper.ssl.keyStore.password=<keystore-password> -Dzookeeper.ssl.trustStore.location=<path-to-zookeeper-certificates>/truststore.p12 -Dzookeeper.ssl.trustStore.password=<truststore-password>
Connection Server 구성
1. ZooKeeper 인증서를 인스턴스에 복사하거나 Connection Server를 실행하는 시스템에서 이 인증서를 사용할 수 있는지 확인합니다.
2. Connection Server 구성 파일에서 보안 포트를 사용하도록 cx-server.discovery.connectionString에 대한 포트를 업데이트합니다.
예를 들면 다음과 같습니다. cx-server.discovery.connectionString = "{zookeeper-host}:2281"
3. 다음 시스템 속성을 CONNECTION_SERVER_OPTS 환경 변수에 추가합니다.
예를 들면 다음과 같습니다.
export CONNECTION_SERVER_OPTS="
-Dzookeeper.clientCnxnSocket=org.apache.zookeeper.ClientCnxnSocketNetty
-Dzookeeper.client.secure=true
-Dzookeeper.ssl.keyStore.location=<path-to-zookeeper-certificates>/zookeeper.p12
-Dzookeeper.ssl.keyStore.password=<keystore-password>
-Dzookeeper.ssl.trustStore.location=<path-to-zookeeper-certificates>/truststore.p12
-Dzookeeper.ssl.trustStore.password=<truststore-password>"
ThingWorx Security 관리 도구를 사용하여 암호 암호화
platform-settings.json 파일에 일반 암호를 삽입하는 것을 방지하려는 경우 보안 도구를 사용하여 twx-keystore 내의 암호를 암호화하면 됩니다. 키 저장소 암호 및 신뢰 저장소 암호에 각각 encrypt.zk.keystore.passwordencrypt.zk.truststore.password를 사용하여 암호를 암호화해야 합니다.
./security-common-cli keystore.conf set encrypt.zk.keystore.password "ptcptc"
그런 다음 ThingWorx가 키 저장소에서 암호를 선택하도록 platform-settings.json 파일을 변경합니다.
"KeyStorePass": "encrypt.zk.keystore.password",
"TrustStorePass": "encrypt.zk.truststore.password"
도움이 되셨나요?