|
1. Detach the database
OpenNMS 1.1 configuration file
1. We need to modify the data source datasource in OpenNMS, when OpenNMS in the following directory:
/opt/opennms/etc/opennms-datasources.xml
2. Modify the localhost IP address to the host database
< Jdbc-data-source name = "opennms"
database-name = "opennms"
class-name = "org.postgresql.Driver" url = "jdbc: postgresql: // database host IP: 5432 / opennms"
user-name = "opennms"
password = "opennms" />
1.2 Installing PostgreSQL database
1. Install PostgreSql database
yum install postgresql postgresql-server command, the system automatically download postgreSQL installed.
2. First start PostgreSQL
As root, run the command:
/ Sbin / service postgresql start
3. If you see an error, you must initialize PostgreSQL, run the following command:
/ Sbin / service postgresql initdb
/ Sbin / service postgresql start
4. to ensure that PostgreSQL will start after the reboot, use "chkconfig" Command to start at boot time, run the following command:
/ Sbin / chkconfig postgresql on
1.2.1 configuration allows the user access to the database
1. Locate /var/lib/pgsql/data/pg_hba.conf content:
ident-> trust
2. Locate the following modifications /var/lib/pgsql/data/postgresql.conf
listen_addresses = '*'
#port = 5432 to remove the "#"
3. After modifying, you need to restart the database, run as root:
/ Sbin / service postgresql restart
1.3 Test
PostgreSql test database on a separate host OpenNMS host
1. Log OpenNMS host putty
2. Run psql -h database host IP -U opennms -d opennms
3. Check the database
Run \ l
To view the user
Run \ du
drop out
Run \ q
Test described above can successfully connect separate databases on the host OpenNMS
1.4 sql statement executed on the client:
1. In the / opt / opennms / etc directory
Upon completion of the implementation of the restart OpenNMS |
|
|
|