How do I remove the stale NSP allowlist entries?

Purpose

After an NSP system upgrade, hostname entries in the NSP allowlist that the NSP cannot resolve to an IP address may prevent NSP access. The following steps describe how to check for and remove stale NSP allowlist entries.

Note: You must perform the procedure in each data center of a DR NSP deployment.

Steps
 

Log in as the root user on the NSP cluster host.


Open a console window.


Enter the following:

kubectl exec -n $(kubectl get pods -A | awk '/nspos-tomcat/ {print $1;exit}') -it nspos-tomcat-0 -c nspos-tomcat -- bash ↵


Enter the following:

grep "could not normalize or resolve host" /opt/nsp/os/tomcat/logs/LaunchPad.log | grep -v grep ↵

Any stale allowlist entries are listed.


If the command returns any output lines like the following, the NSP allowlist includes hostname entries that you must remove; otherwise, go to Step 13.

<timestamp> could not normalize or resolve host: hostname

Record the hostname in each output line.


Enter the following to open a command shell on the PostgreSQL pod:

kubectl exec -n $(kubectl get pods -A | awk '/nspos-postgresql-primary/ {print $1;exit}') --stdin --tty nspos-postgresql-primary-0 -- /bin/bash ↵


Enter the following:

cd /opt/nsp/os/pgsql/bin ↵


Enter the following to log in to the PostgreSQL database:

./psql -U username password

where username and password are the PostgreSQL credentials, which are available from technical support

A PostgreSQL prompt is displayed.


Enter the following:

select * from whitelist.whitelistedhost; ↵

The hosts in the NSP allowlist are listed; the hostname is in the rightmost column.


10 

Record the dbid value of each hostname recorded in Step 5.


11 

Enter the following to delete the unresolved hosts from the allowlist:

delete from whitelist.whitelistedhost where dbid in (host1_ID,host2_ID...hostn_ID); ↵

where host1_ID to hostn_ID is a comma-separated list of the IDs of the hosts to remove

The hosts are removed from the allowlist.


12 

Enter the following to log out of the PostgreSQL database:

quit ↵


13 

Close the console window.

End of steps