Rotate certificates
Change a node's certificates without restarting it.
Change a node's certificates without restarting it, before they expire or when you suspect a key has leaked.
Requirements
- Access to
teseladb adminon the node, or a user that can runrotateCertificates.
Cluster PKI certificate
Shell
teseladb admin cert rotateThe node generates a new key and certificate, signed by the cluster CA.
Your own certificates
If the node uses your files (--tlsCertificateKeyFile), replace them on disk and ask the node to load them again:
JavaScript
db.adminCommand({ rotateCertificates: 1 });Check
Connections opened after the rotation get the new certificate, and the ones that were already open keep working with the old one until they close.
Common problems
rotateCertificatesfails withInvalidSSLConfiguration(140) because a file is not valid. The message names the file.