8 OCNRF Uninstallation

This section explains uninstallation procedure of OCNRF and its details in MySQL.

Deleting the OCNRF deployment

This procedure explains how to delete the OCNRF deployment:
  1. Execute the following command to completely delete or remove the OCNRF deployment:
    $ helm del --purge <helm-release>
    Example:
    $ helm del --purge ocnrf
  2. Execute the following command to delete kubernetes namespace:
    $ kubectl delete namespace <ocnrf kubernetes namespace>
    Example:
    $ kubectl delete namespace ocnrf

Deleting the OCNRF MySQL details

Procedure for Geo-Redundant OCNRF sites

This procedure explains how to delete the OCNRF MySQL database after deletion of OCNRF deployment.

Note:

Procedure can be different for Geo-Redundant OCNRF sites and standalone OCNRF site.
  1. Login to the server/machine which has permission to access the SQL nodes of NDB cluster.
  2. Connect to the SQL node of NDB cluster one by one.
  3. Login to the MySQL prompt using root permission or user, which has permission to delete the table records. For example: mysql -h 127.0.0.1 -uroot -p

    Note:

    This command may vary from system to system, path for mysql binary, root user and root password. After executing this command, user need to enter the password specific to the user mentioned in the command.
  4. Execute the following command to delete data specific to purged site:
    $ DELETE FROM NfScreening WHERE nrfInstanceId = '<OCNRF’s NF Instance ID of Site under deletion>';
    $ DELETE FROM NrfSystemOptions WHERE nrfInstanceId = '<OCNRF’s NF Instance ID of Site under deletion>';
    $ DELETE FROM NfInstances WHERE nrfInstanceId = '<OCNRF’s NF Instance ID of Site under deletion>';
    $ DELETE FROM NfStatusMonitor WHERE nrfInstanceId = '<OCNRF’s NF Instance ID of Site under deletion>';
    $ DELETE FROM NfSubscriptions WHERE nrfInstanceId = '<OCNRF’s NF Instance ID of Site under deletion>';
    
  5. Exit from MySQL prompt and SQL nodes

    Note:

    Execute the commands on any one SQL node on one geo-redundant site. Other Geo-redundant sites will get the data records removed automatically.

    If the last site of a Geo-Redundant OCNRF is getting un-installed, then that site can be considered as a Standalone site as there is no DB replication will take place. Hence, procedure documented under section 5.2.2 and 5.2.3 can be followed for cleaning up OCNRF MySQL resource.

Procedure for standalone OCNRF site

  1. Login to the server/machine which has permission to access the SQL nodes of NDB cluster
  2. Connect to the SQL node of NDB cluster one by one.
  3. Login to the MySQL prompt using root permission or user, which has permission to drop the tables. For example: mysql -h 127.0.0.1 -uroot -p

    Note:

    This command may vary from system to system, path for mysql binary, root user and root password. After executing this command, user need to enter the password specific to the user mentioned in the command.
  4. Execute the following commands to drop the tables:
    $ DROP TABLE IF EXISTS 'NfInstances';
    $ DROP TABLE IF EXISTS 'NfStatusMonitor';
    $ DROP TABLE IF EXISTS 'NfSubscriptions';
    $ DROP TABLE IF EXISTS 'NfScreening';
    $ DROP TABLE IF EXISTS 'NrfSystemOptions';
    
  5. Exit from MySQL prompt and SQL node

    Note:

    Execute the commands on any SQL node of standalone site.

Procedure for complete removal of MySql database and username

This procedure explains the steps to complete removal of MySql database and username in below cases:

  1. OCNRF is not going to be install on that cluster.
  2. Change the MySql database name or MySql user name.

Procedure

  1. Login to the server/machine which has permission to access the SQL nodes of NDB cluster.
  2. Connect to the SQL node of NDB cluster one by one.
  3. Login to the MySQL prompt using root permission or user, which has permission to drop the tables. For example: mysql -h 127.0.0.1 -uroot -p

    Note:

    This command may vary from system to system, path for mysql binary, root user and root password. After executing this command, user need to enter the password specific to the user mentioned in the command.
  4. Execute the following command to remove database:
    $ DROP DATABASE if exists <OCNRF database name>;
     

    Example

    $ DROP DATABASE if exists nrfdb;
    
  5. Execute the following command to remove the MySql User
    $ DROP USER IF EXISTS <OCNRF User Name>;

    Example

     $ DROP USER IF EXISTS nrfusr;
  6. Exit from MySQL prompt and SQL node.

    Note:

    Execute the commands on any SQL node of standalone site.