How To

Find the answers to your Go questions, including FAQs, how-tos, tips and tricks

This is a public Discussion Area  publicRSS

How To

    Anush Ramani
    Backup the Cruise/Go embedded database
    How To posted August 24, 2010 by Anush Ramani, last edited May 16, 2011 by Arun Kumar , tagged linux, Server
    903 Views
    Title:
    Backup the Cruise/Go embedded database
    Problem:

    The Go server maintains an embedded database that stores historical data for all your pipeline, stage and job runs. Rather than backing up the entire Go directory structure, its much more convinient to just backup the embeded DB. This article shows you how to backup your data in Linux.

    Solution Description:

    Precondition:

    In order to take a backup, the most important criteria is that the server has to be shutdown gracefully i.e.

    1. The server process should be completely done. For example: 'ps aux | grep java' should not show the Go server process
    2. The server should not be killed using '-9' option

    The best way to get the server down is using '[sudo] /etc/init.d/go-server stop'

    Procedure:

    You need to backup the 'db' folder under the server installation folder i.e. '/var/lib/go-server' for a normal installation. You basically need to copy the whole db folder as a backup.

    We typically do - 'tar -jvf db`date`.tar.bz2 db' in the /var/lib/go-server folder and move the 'db{date}.tar.bz2' folder that is created to a drive with a lot of space. This way you are backing everything that the Go server needs.

    TIP: Along with the db, it would be good if you also backup the configuration. This is the file: /etc/go/cruise-config.xml.

    Once the backup is done completely, you can start the server using the command '[sudo] /etc/init.d/go-server start'.

    It would be ideal if you can add this to a script and add a cron job to back up the db at midnight every day.