Puppetmasterの1つにpuppetdbをインストールしましたが、動作します。しかし、私は2番目のものを操り人形マスターに接続することができません。
コマンド「puppetagent-t」は、2番目のマスターで機能します。
各マスターは独自のノードを扱います(それらはLBではありません)。
Puppetエージェントコマンドを実行したときのpuppetserver.logは次のとおりです。
2017-06-22 15:48:21,255 ERROR [qtp1178717687-64] [c.p.h.c.i.PersistentSyncHttpClient] Error executing http request
javax.net.ssl.SSLHandshakeException: General SSLEngine problem
at Sun.security.ssl.Handshaker.checkThrown(Handshaker.Java:1431) ~[na:1.8.0_65]
at Sun.security.ssl.SSLEngineImpl.checkTaskThrown(SSLEngineImpl.Java:535) ~[na:1.8.0_65]
at Sun.security.ssl.SSLEngineImpl.writeAppRecord(SSLEngineImpl.Java:1214) ~[na:1.8.0_65]
at Sun.security.ssl.SSLEngineImpl.wrap(SSLEngineImpl.Java:1186) ~[na:1.8.0_65]
at javax.net.ssl.SSLEngine.wrap(SSLEngine.Java:469) ~[na:1.8.0_65]
at org.Apache.http.nio.reactor.ssl.SSLIOSession.doWrap(SSLIOSession.Java:263) ~[puppet-server-release.jar:na]
at org.Apache.http.nio.reactor.ssl.SSLIOSession.doHandshake(SSLIOSession.Java:303) ~[puppet-server-release.jar:na]
at org.Apache.http.nio.reactor.ssl.SSLIOSession.isAppInputReady(SSLIOSession.Java:507) ~[puppet-server-release.jar:na]
at org.Apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.Java:122) ~[puppet-server-release.jar:na]
at org.Apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.Java:164) ~[puppet-server-release.jar:na]
at org.Apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.Java:339) ~[puppet-server-release.jar:na]
at org.Apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.Java:317) ~[puppet-server-release.jar:na]
at org.Apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.Java:278) ~[puppet-server-release.jar:na]
at org.Apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.Java:106) ~[puppet-server-release.jar:na]
at org.Apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.Java:590) ~[puppet-server-release.jar:na]
at Java.lang.Thread.run(Thread.Java:745) ~[na:1.8.0_65]
Caused by: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
at Sun.security.ssl.Alerts.getSSLException(Alerts.Java:192) ~[na:1.8.0_65]
at Sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.Java:1728) ~[na:1.8.0_65]
at Sun.security.ssl.Handshaker.fatalSE(Handshaker.Java:304) ~[na:1.8.0_65]
at Sun.security.ssl.Handshaker.fatalSE(Handshaker.Java:296) ~[na:1.8.0_65]
at Sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.Java:1509) ~[na:1.8.0_65]
at Sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.Java:216) ~[na:1.8.0_65]
at Sun.security.ssl.Handshaker.processLoop(Handshaker.Java:979) ~[na:1.8.0_65]
at Sun.security.ssl.Handshaker$1.run(Handshaker.Java:919) ~[na:1.8.0_65]
at Sun.security.ssl.Handshaker$1.run(Handshaker.Java:916) ~[na:1.8.0_65]
at Java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_65]
at Sun.security.ssl.Handshaker$DelegatedTask.run(Handshaker.Java:1369) ~[na:1.8.0_65]
at org.Apache.http.nio.reactor.ssl.SSLIOSession.doRunTask(SSLIOSession.Java:281) ~[puppet-server-release.jar:na]
at org.Apache.http.nio.reactor.ssl.SSLIOSession.doHandshake(SSLIOSession.Java:351) ~[puppet-server-release.jar:na]
... 9 common frames omitted
Caused by: Sun.security.validator.ValidatorException: PKIX path building failed: Sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at Sun.security.validator.PKIXValidator.doBuild(PKIXValidator.Java:387) ~[na:1.8.0_65]
at Sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.Java:292) ~[na:1.8.0_65]
at Sun.security.validator.Validator.validate(Validator.Java:260) ~[na:1.8.0_65]
at Sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.Java:324) ~[na:1.8.0_65]
at Sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.Java:281) ~[na:1.8.0_65]
at Sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.Java:136) ~[na:1.8.0_65]
at Sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.Java:1496) ~[na:1.8.0_65]
... 17 common frames omitted
Caused by: Sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at Sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.Java:146) ~[na:1.8.0_65]
at Sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.Java:131) ~[na:1.8.0_65]
at Java.security.cert.CertPathBuilder.build(CertPathBuilder.Java:280) ~[na:1.8.0_65]
at Sun.security.validator.PKIXValidator.doBuild(PKIXValidator.Java:382) ~[na:1.8.0_65]
... 23 common frames omitted
Jetty.iniにデフォルト設定があります:
[jetty]
# IP address or hostname to listen for clear-text HTTP. To avoid resolution
# issues, IP addresses are recommended over hostnames.
# Default is `localhost`.
# Host = <Host>
# Port to listen on for clear-text HTTP.
port = 8080
# The following are SSL specific settings. They can be configured
# automatically with the tool `puppetdb ssl-setup`, which is normally
# ran during package installation.
# IP address to listen on for HTTPS connections. Hostnames can also be used
# but are not recommended to avoid DNS resolution issues. To listen on all
# interfaces, use `0.0.0.0`.
ssl-Host = 0.0.0.0
# The port to listen on for HTTPS connections
ssl-port = 8081
# Private key path
ssl-key = /etc/puppetdb/ssl/private.pem
# Public certificate path
ssl-cert = /etc/puppetdb/ssl/public.pem
# Certificate authority path
ssl-ca-cert = /etc/puppetdb/ssl/ca.pem
これが私の2番目のマスターのpuppetdb.confです:
[main]
server_urls = https://puppetmaster01.domain.com:8081
Puppetdb ssl-setupを初めて起動したとき、/ etc/puppetlabs/puppet/sslからpuppetmasterssl(ca、privateおよびpublic)がコピーされたと表示されました。そこで、master02からそれらをコピーして、桟橋で指定された3つのファイルに追加しようとしましたが、機能しませんでした。
ご協力いただきありがとうございます!
編集: CA証明書を使用する必要があることを示すドキュメントを見つけました。だから私はそのコマンドでCA証明書を生成しました:
puppet cert generate puppetmaster01.domain.com --allow-dns-alt-names --dns_alt_names=puppetmaster.domain.com,puppetmaster01.domain.com,puppetmaster02.domain.com
これを使用してpuppetdbのsslをセットアップした後:
puppetdb ssl-setup -f
1番目の問題:マスターが機能します。ssl/ certsのノードにssl/certs/ca.pemをコピーしました。新しいSSLを生成できますが、マスターが受信しませんでした。
2番目の問題:すべてのSSLディレクトリを1番目のマスターから2番目のマスターにコピーし、SSLファイルの名前を適切な名前に変更しましたが、puppetエージェントを起動すると-tが表示されます:
Error: Could not retrieve catalog from remote server: Error 403 on SERVER: Forbidden request: puppetmaster01.domain.com(IP_MASTER_02) access to /puppet/v3/catalog/puppetmaster02.domain.com [find] authenticated at :68
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
Error: Could not send report: Error 403 on SERVER: Forbidden request: puppetmaster01.domain.com(172.27.15.24) access to /puppet/v3/report/puppetmaster02.domain.com [save] authenticated at :78
02ではなくmaster01の情報を取得しようとしているようなものです...
CAの使用方法を見つけました。レポパペット/ ssl/caを取得して他のサーバーに配置し、SSLを再生成するだけです。
したがって、使用する最初のマスターで:puppet cert generate puppetmaster01.domain.com --allow-dns-alt-names --dns_alt_names = puppetmaster.domain.com、puppetmaster01.domain.com、puppetmaster02.domain.com
2番目のマスターのすべてのpuppet/ssl/caをコピーし、このマスターのsslを再生成します:puppet cert generate puppetmaster02.domain.com