Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Sep 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also add the ref on conf/broker.conf and site2/docs/reference-configuration.md

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. done.


@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