1. Detaching a Database 1.1 configuration 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 database host IP address
<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"/ |
Before modification:
After modification:
1.2 Installing the PostgreSQL database
1. Installing the PostgreSQL database
Yum install PostgreSQL postgresql-server command, the system automatically download PostgreSQL installation.
2. Start PostgreSQL First
Run the 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 a restart, use the "chkconfig" command to start at startup and run the following command:
/sbin/chkconfig PostgreSQL on
1.2.1 Configuration allows user access to the database
1. Find the/var/lib/pgsql/data/pg_hba.conf content:
Ident->trust
Revision changed to
Can.
2. Locate/var/lib/pgsql/data/postgresql.conf to modify the following:
listen_addresses = ' * '
#port = 5432 Remove the "#" number
3. After the modification, you need to restart the database to run as root:
/sbin/service PostgreSQL Restart
1.3 Testing
Testing the PostgreSQL database on a detached host in a OPENNMS host
1. Log in to the OPENNMS host with Putty
2. Execute psql-h Database host IP -u opennms-d opennms
3. View the database
Execute COMMAND \l
View User
Execute Command \du
Exit
Execute Command \q
The above test instructions can be successfully connected on the OPENNMS host to isolate the database
1.4 Execute the SQL statement on the client:
1. Under the/OPT/OPENNMS/ETC directory
Restart OpenNMS after execution is complete
Lost Jian file
Reprint Please specify link: http://blog.csdn.net/awenluck/article/details/48598603
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
OPENNMS detaching a database