You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 14 Next »

Duplicated license server entries after migrating to License Statistics v4.6.1 database

Merging realtime data from two separate license servers under a single server is supported only in case of merging realtime license servers with their duplicates created during upgrade to v4.6. This is possible when, apart from the conditions listed in Merging license server data, duplicated realtime license server you want to merge with the other realtime server has specified configuration in the Administration page.

When updating to License Statistics v4.6.1, the database migration normally updates all details for license servers. However, if you see duplicated entries on the Dashboard for a license server after upgrading to v4.6.1, there was a problem migrating the license server to the v4.6.1 database. In this case, you will see the following warning message in the error log:

2012-01-30 08:00:00 Database update (version 52): Unable to migrate details of hostname license server (type license_server_type)! You may need to merge this license server manually by editing the existing license server in the License Servers page.

To resolve this problem, edit the original license server in License Statistics and merge it with the duplicated license server as described in "Merging server data" in Combining realtime and denials data under a single server.

The information in this section refers to License Statistics v4.8 and v4.9. 

Inability to update UsersCount table (duplicate entry error)

A bug introduced in an older version of License Statistics can result in the embedded database index being prematurely exhausted if License Statistics is restarted too often. In such cases, there will be a problem updating the UsersCount table and you will see one or both of the following MySQL errors in the License Statistics log:

ERROR 1062 (23000) at line 1 in file: 'D:\X-Formation\License Statistics\mysql_x86\sql_query_35070.sql': Duplicate entry '65535' for key 'PRIMARY'!
[2013-03-31 01:40:03] WARNING: Unable to save concurrent hosts count to database!

FAIL: Unable to clear required tables!
MySQL error: ERROR 1062 (23000) at line 5 in file: 'D:\X-Formation\License Statistics\mysql_x86\sql_query_16.sql': Duplicate entry '65535' for key 'PRIMARY'

To resolve this problem, compact the indexes of the affected table by running the SQL commands detailed below. (Make sure you have MySQL administrator privileges. Otherwise, you will not be able to perform the steps listed below.)

  1. Shut down License Statistics (Make sure xflicstat process/daemon is not running.)

  2. From a command line, navigate to the License Statistics installation directory, and then to mysql_x86 for 32-bit databases or mysql_x64 for 64-bit databases.

  3. Start the MySQL server by running mysql_start.bat for Windows or mysql_start.sh for Linux. (Make sure mysqld process/daemon is running.)

  4. Connect to the License Statistics database server using the following command:
    For Windows: mysql -uroot -hlocalhost --protocol=TCP
    For Linux: ./mysql -uroot -hlocalhost --socket=data/mysql.sock --protocol=TCP 


  5. Pick the database name (you can check it in xflicstat.cfg file, default name is xformation_licstat):
    > USE xformation_licstat;


  6. Backup your data for the UsersCount table using the following SQL command:
    > SELECT Date, Total, DailyUsers, Hosts, DenialUsers INTO OUTFILE 'userscount.dump' FROM UsersCount;
     
  7. After successful backup, truncate the data and reset the index:
    > TRUNCATE UsersCount;

    > ALTER TABLE UsersCount AUTO_INCREMENT = 1;


  8. Restore the data:
    > LOAD DATA INFILE 'userscount.dump' INTO TABLE UsersCount (Date, Total, DailyUsers, Hosts, DenialUsers);

  9. Stop MySQL by running mysql_stop.bat/mysql_stop.sh

  10. Start License Statistics.

After performing these steps, the duplicate entry issues should be resolved.

  • No labels