Skip to content

Commit

Permalink
[pulsar-broker] Broker auto refresh bk-client certs to avoid cnx fail…
Browse files Browse the repository at this point in the history
…ure after cert refresh (apache#12107)

* [pulsar-broker] Broker auto refresh bk-client certs to avoid cnx failure after cert refresh

* fix readme
  • Loading branch information
rdhabalia authored and ciaocloud committed Oct 16, 2021
1 parent 0304c72 commit eb195bf
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions conf/broker.conf
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,9 @@ bookkeeperTLSCertificateFilePath=
# Path for the trusted TLS certificate file
bookkeeperTLSTrustCertsFilePath=

# Tls cert refresh duration at bookKeeper-client in seconds (0 to disable check)
bookkeeperTlsCertFilesRefreshDurationSeconds=300

# Enable/disable disk weight based placement. Default is false
bookkeeperDiskWeightBasedPlacementEnabled=false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1352,6 +1352,9 @@ public class ServiceConfiguration implements PulsarConfiguration {
@FieldContext(category = CATEGORY_STORAGE_BK, doc = "Path for the trusted TLS certificate file")
private String bookkeeperTLSTrustCertsFilePath;

@FieldContext(category = CATEGORY_STORAGE_BK, doc = "Tls cert refresh duration at bookKeeper-client in seconds (0 to disable check)")
private int bookkeeperTlsCertFilesRefreshDurationSeconds = 300;

@FieldContext(category = CATEGORY_STORAGE_BK, doc = "Enable/disable disk weight based placement. Default is false")
private boolean bookkeeperDiskWeightBasedPlacementEnabled = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ ClientConfiguration createBkClientConfiguration(ServiceConfiguration conf) {
bkConf.setTLSTrustStore(conf.getBookkeeperTLSTrustCertsFilePath());
bkConf.setTLSTrustStoreType(conf.getBookkeeperTLSTrustCertTypes());
bkConf.setTLSTrustStorePasswordPath(conf.getBookkeeperTLSTrustStorePasswordPath());
bkConf.setTLSCertFilesRefreshDurationSeconds(conf.getBookkeeperTlsCertFilesRefreshDurationSeconds());
}

bkConf.setBusyWaitEnabled(conf.isEnableBusyWait());
Expand Down
1 change: 1 addition & 0 deletions site2/docs/reference-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ You can set the log level and configuration in the [log4j2.yaml](https://github
| bookkeeperTLSKeyFilePath | Path for the TLS private key file. | |
| bookkeeperTLSCertificateFilePath | Path for the TLS certificate file. | |
| bookkeeperTLSTrustCertsFilePath | Path for the trusted TLS certificate file. | |
| bookkeeperTlsCertFilesRefreshDurationSeconds | Tls cert refresh duration at bookKeeper-client in seconds (0 to disable check). | |
| bookkeeperDiskWeightBasedPlacementEnabled | Enable/Disable disk weight based placement. | false |
| bookkeeperExplicitLacIntervalInMills | Set the interval to check the need for sending an explicit LAC. When the value is set to 0, no explicit LAC is sent. | 0 |
| bookkeeperClientExposeStatsToPrometheus | Expose BookKeeper client managed ledger stats to Prometheus. | false |
Expand Down

0 comments on commit eb195bf

Please sign in to comment.