Peering Setup - Local Installations:

ProVision uses a locally-hosted mirror of the PeeringDB database in order to perform non-edit Peering functions. There are a few steps to take in order to set up your locally hosted instance to coordinate with PeeringDB information.

1) First, download the PeeringDB SQL dump file from the following location:

http://www.peeringdb.com/dbexport/peeringdb.sql

2) Then, create a new database to contain that data on your local MySQL installation. Make sure that the MySQL user configured in the data/globals.php file is allowed to read and make changes to the local copy of the PeeringDB database.

3) Once this has been done, the ProVision global configuration file located at

[ProVision Root]/data/globals.php 

must be updated with the following variable to inform ProVision of the location of this new install:

$peeringdb_db_name = 'peeringdb';            // name of the database in MySQL


Since this creates a local mirror of an external database it must be periodically re-downloaded to be kept up-to-date. 6connect recommends that local system administrators add the following bash script to their crontab, set to run once a day.

#!/bin/bash

         

        DB="peeringdb"

        DBUSER="root"

        DBPASS="*******"

        WGET="/usr/bin/wget"

        MYSQL="/usr/bin/mysql"

         

        cd
            /tmp/

        $WGET
            http://www.peeringdb.com/dbexport/peeringdb.sql

        /bin/cat
            /tmp/peeringdb.sql | $MYSQL -u$DBUSER -p$DBPASS $DB

        /bin/rm
            /tmp/peeringdb.sql
  • No labels