装opennms真的是坑多多。。。
需要同时参考下面两个地址:
Installation Guide
Installation:Debian

使用标准的简化快速安装方式会出问题,主要是国内下载太慢。。。

首先,apt-get源需要增加一个。在/etc/apt/source.list.d/下增加一个文件,内容是:

···
deb http://debian.opennms.org opennms-19 main
deb-src http://debian.opennms.org opennms-19 main
···

然后更新源

sudo apt-get update
这儿不得不说第一个坑,默认的内容(如下)更新会遇到问题,所以一定要注意!!!
···
deb http://debian.opennms.org stable main
deb-src http://debian.opennms.org stable main
···

安装

sudo apt-get install opennms

照做不会错的部分

按照 4.2.2. Prepare PostgreSQL 这部分安装,没问题,复制如下:
···
The Debian package installs also PostgreSQL database and is already initialized and added in the runlevel configuration. It is only necessary to start the PostgreSQL database without a restart.

Startup PostgreSQL database
service postgresql start
The next step is creating an opennms database user with password and configure the authentication method.

Accounting and database management for OpenNMS
su - postgres
createuser -P opennms
createdb -O opennms opennms
exit
It is not necessary to change the authentication method in pg_hba.conf, it is by default set to md5 for localhost connections.
Set password for Postgres super user
su - postgres
psql -c "ALTER USER postgres WITH PASSWORD 'YOUR-POSTGRES-PASSWORD';"
exit
The super user is required to be able to initialize and change the database schema for installation and updates.
vi ${OPENNMS_HOME}/etc/opennms-datasources.xml
Configuration for database authentication in OpenNMS
database-name="opennms"
class-name="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/opennms"
user-name="** YOUR-OPENNMS-USERNAME **"
password="** YOUR-OPENNMS-PASSWORD **" />

database-name="template1"
class-name="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/template1"
user-name="postgres"
password="** YOUR-POSTGRES-PASSWORD **" />
Set the user name to access the OpenNMS database table
Set the password to access the OpenNMS database table
Set the postgres user for administrative access to PostgreSQL
Set the password for administrative access to PostgreSQL
···

初始化

后面记得OPENNMS_HOME位置是在/usr/share/opennms/

初始化JAVA_HOME

Configuration of Java environment for OpenNMS
${OPENNMS_HOME}/bin/runjava -s
看起来没问题,不顾我建议还是改一下/usr/default/opennms文件,内容为:
···
JAVA_HOME=/usr/bin
···

安装和初始化IPlike

确认一下装了没

sudo apt-get install iplike

使用脚本初始化

sudo /usr/sbin/install_iplike.sh

提示“CREATE FUNCTION”就是装好了。

初始化opennms

记住!检查一下你装的是jdk还是jre!jre是会有问题的!
最好再装一次jdk8

sudo apt-get install openjdk-8-jdk

然后
${OPENNMS_HOME}/bin/install -dis

终于可以运行服务就好了!

sudo service start opennms

标签: none 阅读量: 961

添加新评论