Replacing certificates for Netezza Performance Server Replication Services 3.0.X.X
Learn how to switch Netezza Performance Server certificates or renew certificates that are about to expire.
About this task
Procedure
- On Cloud Pak for Data System, turn off NRS monitoring by Platform Manager.
ap apps disable NRS - Stop replication as described in Starting and stopping replication on a given node and return to this procedure.
-
Stop all of the replication systems on all nodes.
docker stop nrs_replmgmt nrs_broker nrs_mirrormaker nrs_zookeeper - Prepare your certificates.
- Generating self-signed certificates
- Select a Cloud Pak for Data System from which you want to generate the certificate authority (CA) files.
- To generate new certificates, make a password file for each node. For example:
echo -n PASSWORD > NODE PASSWORD FILE PATH - Create a password for the certificate authority's key (
cacert.pem) and save it inpassword_file.echo -n PASSWORD > CAKEY PASSWORD FILE PATHThe password must not have any leading or trailing whitespace charatcers. Passwords with leading or trailing whitespace character are rejected by the nrscertmgr script.
Ensure that the file and related certificates are placed in a known directory on all systems, for example /root/mycerts.
Tip:Make sure that you include -n in the command. With this parameter, the password file does not have a terminating new line. With a new line at the end of the password file, the setup might fail.
- Run the nrscertmgr
script.
nrscertmgr generate-cacert --passfile /path/to/cakey_password_fileExample:nrscertmgr generate-cacert --passfile /path/to/cakey_password_file Running command: 'openssl req -new -subj /C=US/ST=CA/CN=localhost -newkey rsa:4096 -nodes -sha256 -x509 -days 3650 -keyout cakey.pem -out cacert.pem -passin pass:***' - Copy
cakey.pem,cacert.pem, andcakey_password_filethat you generated in substeps b and c to the other Cloud Pak for Data System.Ensure that the files are placed in a known directory on all systems, for example /root/mycerts.
- Generating custom certificates:
- Select a Cloud Pak for Data System from which you want to generate the certificate authority (CA) files.
- Create a
index.yamlfile.Populate the file as in the exampleindex.yaml:certs: cacert: cert: /path/to/cacert.pem nodes: replication-node-1.fqdn: cert: /path/to/rn1-ccertfile.pem key: /path/to/rn1-ckeyfile.pem password: /path/to/rn1-cpassword replication-node-2.fqdn: cert: /path/to/rn2-certfile.pem key: /path/to/rn2-ckeyfile.pem password: /path/to/rn2-cpasswordThe passwords must not have any trailing whitespace characters. Use absolute paths.
- Copy
index.yamlthat you generated in substeps b to the other Cloud Pak for Data System.Ensure that the files are placed in a known directory on all systems, for example /root/mycerts.
- Generating self-signed certificates
- Deploy the certificates.
- For self-signed certificates,
run:
./nrscertmgr add-node host_fqdn /path/to/cacert.pem /path/to/cakey.pem /path/to/password --cakey-passfile /path/to/cakey_password_file --out /tmp/certs --deploy - For custom certificates,
run:
./nrscertmgr package-certs host_fqdn /path/to/index.yaml --out /tmp/certs --deploy
- For self-signed certificates,
run:
- On each node, restart all of the containers.
docker restart nrs_replmgmt nrs_broker nrs_mirrormaker nrs_zookeeper - Make sure that
nrs_brokeris running as sometimes it might not come online.
Example:docker ps[root@exegeses1 certs]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 9ce2b4fb8622 replmgmt:3.0.1.0 "/usr/bin/python3 /o…" 12 minutes ago Up 12 minutes nrs_replmgmt ea7a1492d199 mirrormaker:3.0.1.0 "/bin/sh -c $IBM_INS…" 12 minutes ago Up 12 minutes nrs_mirrormaker 6214f5f44404 broker:3.0.1.0 "/bin/sh -c $IBM_INS…" 12 minutes ago Up 12 minutes nrs_broker d1ba0fbc54db zookeeper:3.0.1.0 "/bin/sh -c $IBM_INS…" 12 minutes ago Up 12 minutes nrs_zookeeperIfnrs_brokeris not running, restart it again:docker restart nrs_brokerIf
nrs_brokerdoes not come up after these attempts, make sure the certificates are correct. - Replace the
nzdrcertificates with your new certificates.- If you are using self-signed certificates, replace the
cacertcertification key in /opt/ibm/appliance/storage/nrs/nps/cert/cacert with your newcacert. It is the same file that you used in step 3 for /path/to/cacert.pem.cp /path/to/cacert /opt/ibm/appliance/storage/nrs/nps/cert/cacertThe certificate and key must use the generated cert / key for this particular system which is saved in /tmp/certs/.
Example:cp /tmp/cert/hostname for this system.pem /opt/ibm/appliance/storage/nrs/nps/cert/cert cp /tmp/cert/hostname for this system_key.pem /opt/ibm/appliance/storage/nrs/nps/cert/key - If you are using custom certificates, replace the
cacertinformation inindex.yamlin /opt/ibm/appliance/storage/nrs/nps/cert/cacert with the information from theindex.yamlfile that you used in step 3 for /path/to/index.yaml.cp /path/to/cacert /opt/ibm/appliance/storage/nrs/nps/cert/cacertExample:cp /path/to/cert for this system /opt/ibm/appliance/storage/nrs/nps/cert/cert cp /path/to/key for this system_key.pem /opt/ibm/appliance/storage/nrs/nps/cert/key
- If you are using self-signed certificates, replace the
- Start replication as described in Starting and stopping replication on a given node and return to this procedure.
- On Cloud Pak for Data System, enable monitoring by Platform Manager.
ap apps enable NRS