Deploy OpenNMS after compilation

Source: Internet
Author: User
Tags unix domain socket postgres createdb opennms

Deploy OpenNMS after compilation
1.1 install Media

After the source code is compiled and packaged, you can install the platform. However, you need to install some plug-ins such as databases and data sources. The related list is as follows;

Dependency name

Remarks

Opennms-repo-stable-rhel6.noarch.rpm

Yum Source

Jdk-7u55-linux-x64.tar.gz

Jdk

Postgresql-9.2.4.tar.bz2

Postgresql

Net-snmp-x86_64package. Zip

Snmp group package

1.1.1 install data sources

If the data source is provided by OpenNMS, it must be installed. Otherwise, the installation may fail.

Method 1: run the following command to install opennms)

Rpm-Uvhhttp: // yum.opennms.org/repofiles/opennms-repo-stable-rhel6.noarch.rpm

After the installation is complete, the following message is displayed.

 

Method 2: offline Installation

Download opennms-repo-stable-rhel6.noarch.rpm

Install and run

Rpm-ivh opennms-repo-stable-rhel6.noarch.rpm

 

1.1.2 install the PostgreSQL database

Method 1: offline source code Installation

1. decompress the source code package to the current directory.

Tar-xjfpostgresql-9.2.4.tar.bz2

2. Enter the decompressed directory.

Cdpostgresql-9.2.4

3. start compiling and installing the postgresql database

./Configure

If gcc is not installed in the system, an error is displayed. You need to install gcc.

Run./configure again

The system prompts that the readline package is missing. Check whether the readline-devel package is missing. Install the readline-devel package of the same version or lower than the readline-devel package that comes with the system.

Run./configure again

The system prompts that the zlib package is missing. Check whether the zlib-devel package is missing. Install the zlib package of the same version or lower than the zlib-devel package that comes with the system.

Run./configure again

This operation is successful.

Run the gmake command

Run the gmake install command

4. Modify the environment variable/etc/profile

Export PATH =/usr/local/pgsql/bin: $ PATH: $ JAVA_HOME/bin

Save and execute source/etc/profile

5. Create a database data file directory/data/pgsql/data

6. operate databases

Initialize Database

 

Create user

Adduser postgres

Modify directory owner

 

Change logon user

Su-postgres

Execute database Initialization Script

/Usr/local/pgsql/bin/initdb -- encoding = utf8-D/data/pgsql/data/

Exit change Logon

Exit

Copy postgresql execution script

Cp/opt/postgresql-9.2.4/contrib/start-scripts/linux/etc/init. d/postgresql

Add execution permission

Chmod + x/etc/init. d/postgresql

Edit the PostgreSQL execution script and specify the database file directory

Vi/etc/init. d/postgresql

PGDATA = "/data/pgsql/data"

Edit the configuration file to configure the network address for database access.

Vi/data/pgsql/data/postgresql. conf

Listen_addresses = '*'

Start PostgreSQL service

Service postgresql start

Log on to the database as the postgres user and modify the postgres user's database password.

Psql-U postgres

S = # alter user postgres PASSWORD '123 ';

Postgres = # \ q

Edit the configuration file and set the password for md5 verification.

Vi/data/pgsql/data/pg_hba.conf

# "Local" is for Unix domain socket connections only

Local all md5

# IPv4 local connections:

# Host all 127.0.0.1/32 trust

Host all md5

7. Restart the Database Service

Service postgresql restart

8. Set the automatic start service

Chkconfig postgresql on

9. Use postgres to create a database

Su ipvs

Createdb opennms

Exit

 

Method 2: Install yum Source

Yum install postgresql-server command, the system automatically downloads the postgreSQL installation.

1. Start PostgreSQL first

Run the following command as root:

/Sbin/service postgresql start

2. If you see an error, you must initialize PostgreSQL and run the following command:

/Sbin/service postgresql initdb

/Sbin/service postgresql start

3. 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.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 = '*'

3. After modification, You need to restart the database and run it as root:

/Sbin/service postgresql restart

1.1.2.2 create a database

Sudo-u postgres createdb-U postgres-e unicode opennms

1.1.3 install iplike

Method 1: offline Installation

Download postgresql92-libs-9.2.4-1PGDG.didt.ep.x86_64.rpm

1. Install and run

Rpm-ivhpostgresql92-libs-9.2.4-1PGDG.didt.ep.x86_64.rpm

2. Restart the database

Servicepostgresql restart

3. Install rpm-ivh iplike-2.0.2-1rhel6.x86_64.rpm

Method 2: Install yum Source

Yum install iplike

 

Run the install_iplike.sh command

 

1.1.4 test the Navicat Client Connection

1. Install the Navicat Client

After setting the installation path, select the default installation

After successful installation, open the Navicat Client

2. Configure database connection

 

3. Configure page information

 

4. Click "connection test". The test is successful. The connection is shown in figure

 

1.1.5 bind jdk

Create a directory OpenNMS under/opt/and put the combined OpenNMS package under it

Note: This OpenNMS directory is the installation directory (The implementation site or on the new virtual machine, Please distinguish it from the above directory, the OpenNMS directory is mentioned below)

1. decompress the combined opennms package

Tar-zxvfopennms-14.0.3.tar.gz

2. Run the following command in the decompressed opennms root directory to bind opennms to the jdk we have installed.

Bin/runjava-S/usr/java/jdk1.7.0 _ 55/bin/java

Run JAVA_HOME =/usr command

 

1.1.6 install opennms1.1.6.1 and create an opennms shortcut

Creating shortcuts helps us to use the serviceopennms start command to quickly start

Ln-s/opt/opennms/bin/opennms/etc/init. d/opennms

1.1.6.2 install the opennms Application

1. Environment Variable Configuration

Export OPENNMS_HOME =/opt/opennms

 

2. Associate the database, create an OpenNMS database, and create necessary functions.

$ OPENNMS_HOME/bin/install-dis

Note: $ OPENNMS_HOME can be defined in environment variables, or OPENNMS_HOME can be converted to OpenNMS directory for execution;

 

The following content indicates that the installation is successful.

 

2. We need to tell OpenNMS where to find libjicmp. so,

Note: libjicmp. so is an indispensable plug-in OpenNMS.

# I1_example

$ OPENNMS_HOME/bin/install-dis-l/usr/lib/jni:/usr/lib

# X86_64 example

$ OPENNMS_HOME/bin/install-dis-l/usr/lib64/jni:/usr/lib64

We need to run 64-bit

 

The following content is successfully installed:

 

1.1.7 install jicmp6

Method 1: Install the offline source code package

1.

Run rpm-ivh jicmp6-1.2.1-1.x86_64.rpm

Method 2: Install yum Source

Yum-y install jicmp6

2. Start opennms after installation.

Service opennms start

1.1.8 enable access and collection ports

Add the following content to/etc/sysconfig/iptables:

-A input-m state -- state NEW-m tcp-ptcp -- dport 8980-j ACCEPT

-A input-p udp-m udp -- dport 161-jACCEPT

1.1.9 page access

1. Page access path

Http: // yourhost: 8980/opennms/

 

2. View data

Data will be displayed in a few minutes.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.