Guide for configuring a netLD Linux installation to use PostgreSQL.


The default netLD installation on Linux uses the Apache Derby database.  However, for large installations of more than 10,000 devices the use of PostgreSQL is recommended.


The PostgreSQL database is included automatically as part of the netLD installation, so the user does not have to install this server themselves.


Overview

  • Configuring PostgreSQL in a fresh installation.
  • Converting Apache Derby to PostgreSQL in an existing installation (retaining data).

Configuring PostgreSQL in a Fresh Installation

Follow these steps to switch a new installation of netLD to PostgreSQL.  No existing data will be retained.  All commands run as the root user.

1. Stop the netLD service:
service netld stop

 

2. Configure the PostgreSQL service to start on boot:
chkconfig netld-pgsql on

 

3. Start the PostgreSQL service:

service netld-pgsql start

 

4. Change directories to the netLD installation directory and reset the database:

cd /usr/share/netld
./dbutil -db=pgsql reset 

  

5. Start the netLD service:

service netld start

 

6. Finished.  Your netLD installation should now be using PostgreSQL as its primary database.



Converting Apache Derby to PostgreSQL in an Existing Installation


Follow these steps to convert an existing netLD Linux installation to PostgreSQL.  Existing data will be retained by this process.  All commands run as the root user.


1. Stop the netLD service:

service netld stop

 

2. Configure the PostgreSQL service to start on boot:

chkconfig netld-pgsql on

 

3. Start the PostgreSQL service:

service netld-pgsql start

 

4. Change directories to the netLD installation directory and convert the database:

cd /usr/share/netld
./dbutil -db=pgsql reset
./dbutil convert_derby_to_pgsql

  

5. Start the netLD service:

service netld start

 

6. Finished.  Your netLD installation should now be using PostgreSQL as its primary database.