Resetting the Stats Collector Database

Stats Collector is responsible for keeping track of transfer status and statistics, which can thus affect things such as notifications and reporting. When there are issues with the Stats Collector database for Shares, such as tables not being updated, corrupted entries or other database-specific errors, reset the database to get the system running again.

  1. Back up the Shares database:
    # /opt/aspera/shares/u/setup/bin/backup backup_dir
  2. Recreate the Stats Collector database, re-add all nodes to Stats Collector, and reset sequence number to 0:
    # /opt/aspera/shares/sbin/sv stop stats-collector
    # /opt/aspera/shares/u/stats-collector/bin/run java -jar lib/stats-collector-admin.jar db-recreate --quiet
    # /opt/aspera/shares/sbin/sv start stats-collector
    # sleep 20 # wait for stats collector to add public key to database 
    # /opt/aspera/shares/u/shares/bin/run rake aspera:stats_collector:add_all_nodes
    # /opt/aspera/shares/u/shares/bin/run mysql -e 'update shares.transfer_reporters set sequence_number = 0'