Installing and Configuring MySQL as Gbackup Backend Database on Linux

Gbackup now supports MySQL as a backend database to store all the clients' backup metadata information. Unlike Gbackup using SQLite embedded database as its backend database.

Overview

Gbackup now supports MySQL as a backend database to store all the clients' backup metadata information. Unlike Gbackup using SQLite embedded database as its backend database, the MySQL database Server is external to the Gbackup backup server application. Using a client-server database as the backend database rather than an embedded database would provider better scalability and performance. It also enables third party applications to directly query Gbackup's metadata for integration with those applications. To get Gbackup to work with MySQL as a backend database, you need to install MySQL Server either in the same machine where Gbackup backup server is installed or in another dedicated machine where you wish to store the Gbackup's metadata information

Note : The following steps are also applicable for Gbackup Replication Server using the MySQL database as a backend database.

Install and Configure MySQL Server

  1. Download the zip file from the following links for the particular flavor of Linux that you are running in your backup (or replication) server.

    Operating System Size Download
    DEBIAN/UBUNTU [64-Bit] 64.7 MB Download
    DEBIAN/UBUNTU [32-Bit] 52.42 MB Download
    CENTOS [64-Bit] 64.24 MB Download
    CENTOS [32-Bit] 63.49 MB Download
    SUSE [64-Bit] 63.16 MB Download
    SUSE [32-Bit] 55 MB Download
    RedHat [64-Bit] 64.04 MB Download
    RedHat [32-Bit] 55 MB Download

    If you don't find the download for the version of Linux you're looking for, then you need to do the manual installation as described here.

  2. Unzip the downloaded file. Run the file mysql_rpm_install.sh
  3. When prompted, choose the option 1 for installing rpms
  4. In the set of choices, choose the option 1 for installing all rpm packages
  5. The script will then install the following packages
    • mysql-connector-odbc-3.51.27
    • mysql-server-5.1.39-0.glibc23
    • mysql-client-5.1.39-0.glibc23
    • unixODBC-2.2.14-1
    If any of the following dependency packages are missing, they will also be installed
    • ncurses-5.5-24.20060715
    • ncurses-devel-5.5-24.20060715
    • perl-DBI-1.52-2.el5

Make sure MySQL instance is running fine by running the command:

mysql -u root -p

Create Gbackup Database

The next step is to create the database in MySQL that the Gbackup server will use.

  1. Login to the machine where MySQL Server is running.
  2. Execute the command mysql -u root -p and enter the password.
  3. Create the Gbackup database by executing the command:

    create database [database name] collate latin1_general_cs;

    where [database name] is the name of the database. Make sure the database name does not exceed 30 characters

Configure MySQL Connector

Now that you have all the packages installed, MySQL instance running and the MySQL database created, follow the steps mentioned below to configure the MySQL connector:

  1. Execute the following command from the command line

    odbcinst -j

  2. Note the path of the odbcinst.ini file for DRIVERS. By default, it is /usr/local/etc/odbcinst.ini
  3. Login as root and open the file odbcinst.ini
  4. Append the following content to the file.

    [ODBC]
    Trace = No
    Trace File = /tmp/sql.log
    Pooling = Yes

    [MySQL]
    Description =
    Driver = /usr/local/lib/libmyodbc3-3.51.27.so
    Driver64 =
    Setup = /usr/local/lib/libmyodbc3S-3.51.27.so
    Setup64 =
    UsageCount =1
    CPTimeout =300
    CPReuse =1
    Threading =0

Note: If the ODBC Driver [ODBC] is already present in the file, please enable connection pooling by adding Pooling=Yes

Create System DSN

Execute the following steps to create a DSN for the Gbackup Server to access the MySQL instance:

  1. Execute the following command from the command line

    odbcinst -j

  2. Note the path of the odbc.ini file for SYSTEM DATA SOURCES. By default, it is /usr/local/etc/odbc.ini
  3. Login as root and open the file odbc.ini
  4. Append the following content to the file.

    [sgserver]
    Driver = MySQL
    DATABASE = GbackupDB
    PWD = password123
    SERVER = lintest
    UID = root

  5. In the above example file, the name of the DSN is sgserver. The database name (specified as GbackupDB in the above example) should be that specified in step Create Gbackup Database above. The server name (lintest) is the hostname of the server running the MySQL instance with the user root and password as password123.

Verify MySQL installation

To make sure the MySQL is configured correcting and is running, execute the command

isql -v [dsn name] [user name] [password]

at the command line in the backup server and make sure it is able to connect to the MySQL instance.

  • Wednesday, 20 July 2011

About Us

Contact Us

Newsletter