This procedure reloads a corrupted or backlevel query server's database by copying the LSMS LNP database. If the LSMS is configured with multiple query servers, reload a query server from another query server (that is currently synchronized with the LSMS) to prevent NPAC-to-network element traffic from being interrupted (see “Reload a Query Server Database from Another Query Server”).
$ su - root
When prompted, enter the root password.# rm /var/TKLC/lsms/free/snapinfo.sql
# lsmsdb -c snapshot
The following output displays:WARNING: This command may cause a brief interruption in traffic being sent from the NPAC to connected network elements and local LSMS provisioning may be INTERRUPTED. Do you want to continue? [Y/N] Y
Creating snapshot of the database partition, please wait... lvcreate -- WARNING: the snapshot will be automatically disabled once it gets full lvcreate -- INFO: using default snapshot chunk size of 64 KB for "/dev/vgapp/dbbackup" lvcreate -- doing automatic backup of "vgapp" lvcreate -- logical volume "/dev/vgapp/dbbackup" successfully created The database is available to the application again. Disk snapshot created successfully. mount: block device /dev/vgapp/dbbackup is write-protected, mounting read-only Snapshot mounted successfully. Created snapinfo.sql file successfully ............ lvremove -- doing automatic backup of volume group "vgapp" lvremove -- logical volume "/dev/vgapp/dbbackup" successfully removedWhen the last two lines shown above (which start with lvremove), the snapshot is complete. However, the database is available to the application before the snapshot is complete, as indicated by the line shown in bold in the example output above. During the creation of a snapshot of the LSMS data, the following occurs:
A read lock is obtained
Table information is flushed
A snapshot is created
The read lock is released
# ftp <IP address of the Query Server>
ftp> cd /usr/mysql1
ftp> bin
ftp> prompt
ftp> mput mysql-snapshot*.tar.gz snapinfo.sql
ftp> bye
# ./mysqladmin -u root -p shutdown
Enter password:<Query Server’s MySQL user root password>
# cd /usr/mysql1
# gunzip -c mysql-snapshot-supDB.tar.gz | tar -xvf -
# rm mysql-snapshot-supDB.tar.gz
Now, extract the data for the snapshot files for each of the LSMS regions starting with the largest regions first. Replace <regionDB> with the regional database name (for example, CanadaDB, MidwestDB, and so forth). Be sure to remove the compressed snapshot files after each database is extracted to guarantee that sufficient disk space is available for all databases.# gunzip -c mysql-snapshot-<regionDB>.tar.gz | tar -xvf -
# rm mysql-snapshot-<regionDB>.tar.gz
# ./mysqld_safe --skip-slave-start &
mysql> reset slave;
mysql> reset master;mysql> source /usr/mysql1/snapinfo.sql
The query server should connect to the master and catch up on any updates that occurred since the snapshot was taken. When a query server has started replicating, a master.info file is stored in the same directory as the error log (for information about where the error log is stored, see Query Server Error Log).