Migrate the Versa Analytics Database from DSE to Fusion
In Releases 20.2 and later, Versa Analytics nodes support a new database platform called Fusion, which is based on open-source technology. The Fusion database improves scaling and performance and fixes many security vulnerabilities.
The Fusion database replaces the DSA database that was used in Release 16.1R2. The DSA database is now at end of life.
In Release 20.2, the features of the new Fusion database are compatible with the features of the DSE database. All Release 16.1R2 features and reports are available in Release 20.2. To take advantage of the Fusion database features, including the many new features, reports, and vulnerabilities, you must upgrade to the Fusion database.
When you install an Analytics cluster using a Releases 20.2.x iso, ova, or qcow2 image, the Fusion database is automatically installed. If you upgrade from Release16.1R2 to Release 20.2, the database is not upgraded automatically, and you must manually upgrade to the Fusion database by running additional scripts provided by Versa Networks. If you upgrade to Release 20.2 but do not upgrade the database, the DSE database continues to operate as the underlying database.
The Fusion database is backwards compatible with Versa Director and Versa Operating SystemTM (VOSTM) devices that are running Releases 16.1R2S10 and 16.1R2S11.
This article describes how to updated a standalone Analytics node or an Analytics cluster from Release 16.1R2 to Release 20.2 (or to a later release) and then moving the Analytics database from the DSE database to the Fusion database platform
Before You Begin
Before you migrate to or upgrade to the Fusion database, ensure that the Fusion-specific TCP ports are open. These are ports 2181, 2888, and 3888. For more information, see Firewall Requirements.
Upgrade DSE from Version 4.5 to Version 4.8
To upgrade from the DSE to the Fusion database, the Analytics nodes must be running DSE Version 4.8. To determine which version of the DSE database is running issue the following command:
[versa@vsearch1: ~] $ dse -v 4.8.16
If the Analytics nodes are running DSE Version 4.5, follow the procedure in this section to upgrade them to DSE Version 4.8.
To prepare to upgrade the Analytics nodes from DSE Version 4.5 to DSE Version 4.8:
- Check that all Versa services are running:
# vsh status
- Check that all node bindings are active and that they display UN in the first column of the output of the nodetool status command.
- Check that the software package running on the Analytics node is Release 16.1R2S6 or later:
# show system package-info
- Check that there is enough disk space:
# df -h
- Check that there is enough memory
free -h
- Back up the configuration and operating state of all servers in the Analytics cluster:
# cd /opt/versa/scripts/van-scripts # cp -pi vansetup.conf vansetup.conf.YYYYMMDD
- From the contents of the /opt/versa/scripts/van-scripts/vansetup.conf file, make a note of the management (RPC) address and internal address. For an Analytics cluster, make a note of the cluster name for each of the nodes in the cluster.
- Make sure that the cluster name in the vansetup.conf file is the same as the name in the /etc/dse/cassandra/cassandra.yaml file.
To upgrade to DSE Version 4.8:
-
Download the DB upgrade tar and scripts from one of the following links:
-
Transfer the tar file to the Director analytics and search nodes:
scp dse_migration.tar versa@ip-address:/var/tmp/
-
On the Director analytics and search nodes, extract tar file:
# cd /var/tmp # tar xvf dse_migration.tar
-
On the search nodes, export the alarm logs. When you upgrade from the DSE database, raw logs are not lost and historical data is not affected. However, the data stored in the search engine is truncated because the DSE 4.8 database does not support some of the Solr features that are present in DSE 4.5.
-
Download the export and import scripts file, analytics_backup_scripts, from Box.
-
Export the data from the search nodes. For the number of days of backup to export, 30 days (30daysAgo) is common.
-
# cd dse_upgrade # cd /var/tmp/dse_migration/analytics_backup_scripts # mkdir -p /var/tmp/dse_migration/alarm_backup # sudo python vandb-export.py -o export-location -d search -f alarmLog -v E -s days # sudo python vandb-export.py -o /var/tmp/dse_migration/alarm_backup -d search -f alarmLog -v E -s days
-
Check that the alarm log have been exported correctly:
versa@versa-analytics:~$ cd dse_migration/ # versa@versa-analytics:~/dse_migration $ sudo ./scrub.sh /alarm_backup /*.csv
Or:
# cd /var/tmp/dse_migration/alarm_backup # sudo ./scrub.sh exported-filename.csv
-
Edit the dse_migration.conf file on the Director node to add the proper configuration information:
cd /var/tmp/dse_migration vi dse_migration.conf
Populate the fields with management and internal IP addresses of each node and the cluster name. These are the addresses and the cluster name that are in the vansetup.conf file. The management IP address is the address in the rpc_address field in the vansetup.conf file, and it is the eth1 interface, which is the northbound IP address.
The following is an example of the contents of the DSE migration configuration file:
[CLUSTER_CONFIG] search_node_count: 2 analytics_node_count: 2 cluster_name: VAN_CLUSTER [ANALYTICS_NODE_1] management: 10.192.84.112 internal: 192.168.1.10 username: versa [ANALYTICS_NODE_2] management: 10.192.84.113 internal: 192.168.1.11 username: versa [SEARCH_NODE_1] management: 10.192.84.114 internal: 192.168.1.12 username: versa [SEARCH_NODE_2] management: 10.192.84.115 internal: 192.168.1.13 username: versa
- Update the DSE database:
sudo ./upgrade_dse.py
If you are prompted for a password, enter the SSH password for each node. Typically, for the user "versa," the password is versa123.
If the script fails to execute with sudo and displays the error message "Error: Unable to establish SSH connection with analytics-node", execute the command directly:
./upgrade_dse.py
The upgrade typically takes about 30 minutes, and it does impact service.
When the upgrade completes, the message "DSE upgraded" displays on the Analytics and Search nodes.
To verify the upgrade to DSE Version 4.8:
-
On all nodes in the Analytics cluster, use one of the following commands to check that the DSE version is 4.8:
# dse -v 4.8.16
Or:
versa@vanalytics1:/opt/versa/scripts/van-scripts $ cqlsh Connected to VAN1 at 127.0.0.1:9042. [cqlsh 5.0.1 | Cassandra 2.1.19.1484 | DSE 4.8.16 | CQL spec 3.2.1 | Native protocol v3]
-
Optionally, reboot each node:
sudo reboot
-
On the search nodes, import the alarm logs from the .csv file to which you exported them. For example:
# cd /var/tmp/dse_migration/analytics_backup_scripts versa@versa-analytics:~/dse_migration$ sudo python vandb-import-alarm.py -o /var/tmp/dse_migration /alarm_backup /usr/local/lib/python2.7/dist-packages/cassandra_driver-2.1.3.post-py2.7-linux-x86_64.egg/cassandra/util.py:360: UserWarning: The blist library is not available, so a pure python list-based set will be used in place of blist.sortedset for set collection values. You can find the blist library here: https://pypi.python.org/pypi/blist/ Connecting... 1 file(s) found, importing... Importing vsnlog-1.csv... Insert alarmLog complete [time=131.224 sec] Number of logs inserted: 12296
-
Check that the GUI properly displays the imported data properly.
-
On each Analytics node in the cluster, start the cron job that repairs the Analytics database daily, and check that the cron file is created:
# sudo /opt/versa/scripts/van-scripts/vandb-repair-start daily # ls -la /etc/cron.d/vandb-repair
-
On each Analytics node in the cluster, check that the Versa servers are operational, check that the node bindings are active (look for “UN” state in the command output), and check the disk and memory allocations:
# vsh status # nodetool status # df -h # free -h
Upgrade the OS SPack
Before you upgrade to Release 20.2, it is recommended that you update the Analytics nodes to the latest OS SPack image. You can find the OS SPack image at https://versanetworks.app.box.com/v/osspack. For example:
To download and install the OS SPack image:
- Download the OS SPack image to the /home/versa directory:
[versa@vanalytics1: ~] $ cd /home/versa [versa@vanalytics1: ~] $ ls -lrt total 161092 drwxr-xr-x 2 root root 4096 Oct 10 2019 packages -rw-r----- 1 versa versa 46879 Feb 3 01:39 test.txt -rw-r----- 1 versa versa 225 Mar 20 03:25 cookies.txt -rw-r----- 1 versa versa 164898153 Apr 28 06:29 versa-analytics-osspack-20200214.bin
- Make the image executable and install it. For example:
[versa@vanalytics1: ~] $ chmod a+x versa-analytics-osspack-20200214.bin [versa@vanalytics1: ~] $ sudo ./versa-analytics-osspack-20200214.bin [sudo] password for versa:
The installation takes a few minutes, and when it completes you return to the shell prompt.
Upgrade the Software Package
Upgrade the software to Release 20.2, as described earlier in this section.
Upgrade from the DSE to the Fusion Database
To upgrade the Analytics database from DSE to Fusion:
- Download the Fusion migration script from https://versanetworks.app.box.com/s/8pdi9ppyjzfq8cx53s10l3zbwt6k2kbw to the /home/admin or any other user directory on the primary Director node:
admin@director:~$ cd /home/admin admin@director:~$ ls -lrt total 515724 -rw-r----- 1 admin versa 1616 Nov 28 10:28 vs-director-20191128.key -rw-r----- 1 versa versa 257422411 May 4 19:30 versa-director-osspack-20200214.bin -rw-r----- 1 versa versa 270663680 May 6 13:29 fusion_migration.v1.3.tar
- Untar the Fusion migration script:
admin@director:~$ tar -xvf fusion_migration.v1.3.tar fusion_migration/ fusion_migration/.pip/ fusion_migration/.pip/pexpect-4.6.0.dist-info/ fusion_migration/.pip/pexpect-4.6.0.dist-info/INSTALLER
- Check the files in the fusion_migration directory:
admin@director:~/fusion_migration$ ls -lrt total 92 -rw-r----- 1 admin versa 2210 Mar 3 10:13 logger.py -rw-r----- 1 admin versa 104 Mar 18 20:32 logging.properties drwxr-x--- 1 admin versa 4096 Apr 6 16:37 defaults drwxr-x--- 1 admin versa 4096 Apr 7 01:39 packages -rw-r----- 1 admin versa 18242 Apr 29 06:55 device.py -rw-r-x--- 1 admin versa 15289 Apr 29 06:31 session_manager.py -rw-r----- 1 admin versa 1121 Apr 29 07:50 fusion_migration.conf -rw-r-x--- 1 admin versa 31588 Apr 29 07:51 fusion_migration.py -rw-r----- 1 admin versa 815 Apr 29 07:53 README
- Edit the fusion_migration.conf file to add the appropriate data for your Analytics cluster. You can use vi, nano, or any other editor. Enter the management IP address, the internal IP address (the IP address displayed in the output of the nodetool status command), and the username and hostname for all analytics and search nodes. For more information, download the Fusion-Migration.doc.x file from the Box server. For example:
- Enable session logging on the terminal where you are tunning the migration the script is bring run so that all the logs are captured. These logs are useful for troubleshooting if the script fails.
- Run the migration script:
admin@director:~/fusion_migration$ python fusion_migration.py
The migration script takes several minutes to run. When it completes, it displays the message “Fusion migration completed on Analytics & Search nodes”.
-
On each Analytics node in the cluster, check that the Versa servers are operational, check that the node bindings are active (look for “UN” state in the command output), and check the disk and memory allocations:
# vsh status # vsh dbstatus
The following is an example of the command output for an Analytics node that has the personality "analytics":
The following is an example of the command output for an Analytics node that has the personality "search". The output should show "Found 1 Solr nodes" and "Collections: 1" regardless of the number of nodes in the cluster, and the "liveNodes" value should be equal to the number of search nodes in the cluster.