Skip to content

Managing Kraken

Sw4mp_fox edited this page Jan 20, 2017 · 16 revisions

During installation, shell script named Kraken.sh is copied to /usr/bin. I refer to this as the Kraken utility going forward. The Kraken utility is used to perform several administrative tasks:

  • Start, stop, and restart Kraken services
  • Add new users
  • Backup and restore Kraken data
  • Update Kraken
  • Change the number of Celery workers

Start, Stop, Restart

There are 3 services that Kraken uses: Apache, Celeryd, and RabbitMQ. You can start, stop, or restart all of these with a single command using the Kraken utility.


Adding Users

Add an admin user to Kraken with the Kraken utility. This is useful if you find yourself without a user to log into Kraken with for one reason or another. User management can also be performed at Django administration page if you already have a user account:

 http://localhost:8000/admin/


Backup and Restore

Backing up and restoring Kraken data is simple with the Kraken utility. Backup functionality drops a KrakenBackup.zip to the current working directory. It contains all of the screens taken and the Kraken SQLite3 file.

To restore, provide the absolute path to the backup zip file created above. The zip file will be extracted to /tmp then the screenshots and database file will be moved to their respective locations in /opt/Kraken.


Update

Update performs the following:

  1. Backup Kraken
  2. Git clone the latest Kraken repo to /tmp
  3. Recursively delete /opt/Kraken
  4. Move /tmp/Kraken/Kraken to /opt/
  5. Restore Kraken data
  6. Delete all files created in /tmp/ and the Kraken backup file
  7. Restart Kraken

Change the number of Celery workers

Concurrency, or the number of concurrent Celery workers, is currently set to 5 on line 24 of /etc/default/celeryd. Change this to the desired number of Celery workers. Best practice is to limit the number to two workers per processor core. In my Debian VM, I allot two cores, which means 4 workers, plus a worker to track progress on intensive tasks. Once finished, restart Kraken.

Clone this wiki locally