当前位置: 首页 > 工具软件 > OpenNMS > 使用案例 >

yum安装opennms

尉迟哲瀚
2023-12-01

1.官网列表中寻找需要的资源:http://yum.opennms.org/repofiles/

2.运行命令:rpm -Uvh http://yum.opennms.org/repofiles/opennms-repo-bleeding-rhel6.noarch.rpm

命令后面的http网址,就是选中要下载的资源文件URL

3.查看是否安装成功: yum list opennms

[root@VM-local ~]# yum list opennms
已加载插件:fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * epel: mirrors.tuna.tsinghua.edu.cn
 * extras: mirrors.tuna.tsinghua.edu.cn
 * updates: mirrors.163.com
可安装的软件包
opennms.noarch                           26.0.0-0.20191021.opennms.develop.145                           opennms-repo-bleeding-common

4.安装:yum install opennms

报错:

错误:Package: opennms-26.0.0-0.20191021.opennms.develop.145.noarch (opennms-repo-bleeding-common)
          Requires: postgresql-server >= 9.1
          已安装: postgresql-server-8.4.20-8.el6_9.x86_64 (@base)
              postgresql-server = 8.4.20-8.el6_9
错误:Package: opennms-26.0.0-0.20191021.opennms.develop.145.noarch (opennms-repo-bleeding-common)
          Requires: java-11-openjdk-devel
 You could try using --skip-broken to work around the problem
** Found 2 pre-existing rpmdb problem(s), 'yum check' output follows:
2:postfix-2.6.6-8.el6.x86_64 has missing requires of libmysqlclient.so.16()(64bit)
2:postfix-2.6.6-8.el6.x86_64 has missing requires of libmysqlclient.so.16(libmysqlclient_16)(64bit)

说我的配套软件版本太低,重新安装配套文件:

......查了下资料以后,发现找不到java-11-openjdk-devel

https://pkgs.org/download/java-11 在下载网站中找不到centos6的java-11下载链接

还需要换系统才行,放弃。

关键性依赖缺失,我不认识它啊,卸载:rpm -e --nodeps postfix-2.6.6-8.el6.x86_64

干掉一个,同样的位置又出现其他的问题:

** Found 2 pre-existing rpmdb problem(s), 'yum check' output follows:
cronie-1.4.4-15.el6_7.1.x86_64 has missing requires of /usr/sbin/sendmail
redhat-lsb-core-4.0-7.el6.centos.x86_64 has missing requires of /usr/sbin/sendmail

这什么玩意,放弃。

自此,在centos6下opennms安装失败。

5.在centos7下安装

在centos7系统下,重复上面四步,安装成功了。

碰到包下载速度慢的问题,我是找到yum保存rpm文件的位置,再去网页上下载源文件,直接上传的,opennms的core包太大,虚拟机下载实在太慢还老是断开连接

6.postgresql配置

初始化:postgresql-setup initdb

启动:service postgresql start 

修改配置,vi /var/lib/pgsql/data/pg_hba.conf,内容如下:

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust

7.告诉OpenNMS JDK在那里

运行命令:$OPENNMS_HOME/bin/runjava -S /usr/lib/jvm/java-11-openjdk-11.0.4.11-1.el7_7.x86_64/bin/java

这里的java,是安装opennms时同时安装的Java11

8.初始化OpenNMS的数据库

运行命令:$OPENNMS_HOME/bin/install -disU -l /usr/lib/jni:/usr/lib

报错:

Caused by: org.opennms.core.schema.MigrationException: Unsupported database version "9.200000" -- you need at least 10.000000 and less than 13.000000.  Use the "-Q" option to disable this check if you feel brave and are willing to find and fix bugs found yourself.
        at org.opennms.core.schema.Migrator.validateDatabaseVersion(Migrator.java:200)
        at org.opennms.install.Installer.install(Installer.java:246)
        at org.opennms.install.Installer.main(Installer.java:995)

这鬼软件自动安装postgreSQL居然自己不适配自己,垃圾

安装他的提示,执行命令:$OPENNMS_HOME/bin/install -disU -Q -l /usr/lib/jni:/usr/lib

报错:

Caused by: org.postgresql.util.PSQLException: ERROR: type "jsonb" does not exist

jsonb是postgreSQL的数据结构,和int、varchar是一样的,在9.4之后的版本中才支持

重装postgreSQL,见 https://blog.csdn.net/qq_31156277/article/details/84291004

感谢这位兄弟

使用下面的命令重新配置一遍postgreSQL

/usr/pgsql-10/bin/postgresql-10-setup initdb

vi /var/lib/pgsql/10/data/pg_hba.conf

service postgresql-10 restart

再执行 $OPENNMS_HOME/bin/install -disU -l /usr/lib/jni:/usr/lib

终于看到,completed successfully!

9.启动OpenNMS

运行命令:systemctl start  opennms.service

可以通过ps -ef|grep opennms看到进程

10.访问OpenNMS

http://ip:8980/opennms

用户名和密码都是admin

没有访问到界面......查了下关联的容器是jetty,它的默认访问端口是8980,但是并没有找到jetty的进程

 

 类似资料: