OpenNMS database Separation
1. Database Separation
1.1 configure the OpenNMS File
1. We need to modify the datasource data source in OpenNMS, in the following directory in OpenNMS:
/Opt/opennms/etc/opennms-datasources.xml
2. Change localhost to the IP address of the Database Host.
<Jdbc-data-source name = "opennms"
Database-name = "opennms"
Class-name = "org. postgresql. Driver" url = "jdbc: postgresql: // Database Host IP Address: 5432/opennms"
User-name = "opennms"
Password = "opennms"/>
Before modification:
After modification:
1.2 install the PostgreSQL database
1. Install the PostgreSql database
Yum install postgresql-server command, the system automatically downloads the postgreSQL installation.
2. Start PostgreSQL first
Run the following command as root:
/Sbin/service postgresql start
3. If you see an error, you must initialize PostgreSQL and run the following command:
/Sbin/service postgresql initdb
/Sbin/service postgresql start
4. To ensure that PostgreSQL will start after restart, run the "chkconfig" command to start at startup and run the following command:
/Sbin/chkconfig postgresql on
1.2.1 configuration allows users to access the database
1. Find/var/lib/pgsql/data/pg_assist.conf with the following content:
Ident-> trust
Change
You can.
2. Find/var/lib/pgsql/data/postgresql. conf and modify the following content:
Listen_addresses = '*'
# Port = 5432 remove "#"
3. After modification, You need to restart the database and run it as root:
/Sbin/service postgresql restart
1.3 Test
Test the isolation of PostgreSql databases on the OpenNMS host.
1. Use putty to log on to the OpenNMS host
2. Run psql-h Database Host IP address-U opennms-d opennms
3. view the database
Execute Command \ l
View users
Run \ du
Exit
Execute Command \ q
The test description above indicates that the database can be successfully detached from the OpenNMS host.
1.4 run the SQL statement on the client:
1. In the/opt/opennms/etc directory
Restart OpenNMS after execution.
OpenNMS details: click here
OpenNMS: click here
This article permanently updates the link address: