初始化OpenNMS 與 Database問題

dingjiahappy 2009-07-09 01:29:41
麻煩各位高手幫忙看看,十分感激。
我做到初始化OpenNMS的数据库這步時出現如下情況
環境:Centos 5.2
(1/5): jicmp-1.0.7-1.i386
(2/5): opennms-1.7.5-0.13
(3/5): jdk-1_5_0_18-linux
(4/5): opennms-webapp-jet
(5/5): opennms-core-1.7.5

[root@localhost bin]# $OPENNMS_HOME/bin/install -l /usr/local/lib -dis
==============================================================================
OpenNMS Installer Version $Id: Installer.java 13609 2009-06-07 00:59:50Z rangerr
ick $
==============================================================================

Configures PostgreSQL tables, users, and other miscellaneous settings.

- searching for jicmp:
- trying to load /usr/local/lib/libjicmp.so: NO
- trying to load /usr/lib/libjicmp.so: OK
- searching for jrrd:
- trying to load /usr/local/lib/libjrrd.so: NO
- trying to load /usr/lib/libjrrd.so: NO
- trying to load /usr/java/jdk1.5.0_18/jre/lib/i386/client/libjrrd.so: NO
- trying to load /usr/java/jdk1.5.0_18/jre/lib/i386/libjrrd.so: NO
- trying to load /usr/java/jdk1.5.0_18/jre/../lib/i386/libjrrd.so: NO
- trying to load /libjrrd.so: NO
- trying to load /opt/opennms/lib/libjrrd.so: NO
- trying to load /usr/lib/jni/libjrrd.so: NO
- trying to load /usr/lib/libjrrd.so: NO
- trying to load /usr/local/lib/libjrrd.so: NO
- trying to load /opt/NMSjicmp/lib/32/libjrrd.so: NO
- trying to load /opt/NMSjicmp/lib/64/libjrrd.so: NO
- Failed to load the optional jrrd library.
- This error is not fatal, since jrrd is only required for optional features.
- For more information, see http://www.opennms.org/index.php/jrrd
- using SQL directory... /opt/opennms/etc
- using create.sql... /opt/opennms/etc/create.sql
* using 'postgres' as the PostgreSQL user for OpenNMS
* using '' as the PostgreSQL password for OpenNMS
* using 'opennms' as the PostgreSQL database name for OpenNMS
- checking if database "opennms" is unicode... ALREADY UNICODE
- Checking for old import files in /opt/opennms/etc... DONE
- Migrating/creating database:
Jul 9, 2009 1:00:41 PM liquibase.database.template.JdbcTemplate comment
INFO: Lock Database
Jul 9, 2009 1:00:41 PM liquibase.lock.LockHandler acquireLock
INFO: Successfully acquired change log lock
Jul 9, 2009 1:00:44 PM liquibase.database.AbstractDatabase getRanChangeSetList
INFO: Reading from databasechangelog
Jul 9, 2009 1:01:04 PM liquibase.database.template.JdbcTemplate comment
INFO: Changeset stored-procedures/getManagePercentAvailIntfWindow.xml::getManage
PercentAvailIntfWindow::rangerrick::(MD5Sum: ae6ef5514fb6bc147099ad82f796645)
Jul 9, 2009 1:01:04 PM liquibase.database.template.JdbcTemplate comment
INFO: Release Database Lock
Jul 9, 2009 1:01:04 PM liquibase.lock.LockHandler releaseLock
INFO: Successfully released change log lock
Exception in thread "main" org.opennms.core.schema.MigrationException: unable to
update the database
at org.opennms.core.schema.Migrator.migrate(Migrator.java:290)
at org.opennms.install.Installer.install(Installer.java:282)
at org.opennms.install.Installer.main(Installer.java:858)
Caused by: liquibase.exception.MigrationFailedException: Migration failed for ch
ange set stored-procedures/getManagePercentAvailIntfWindow.xml::getManagePercent
AvailIntfWindow::rangerrick:
Reason: liquibase.exception.JDBCException: Error executing SQL CREATE OR RE
PLACE FUNCTION getManagePercentAvailIntfWindow(integer,varchar(16), timestamp wi
thout time zone, timestamp without time zone)
RETURNS float8 AS '
DECLARE
nid ALIAS FOR $1;
ipid ALIAS FOR $2;
xtime ALIAS FOR $3;
ytime ALIAS FOR $4;
downtime float8 := 0.0;
count integer := 0;
rollingWindow float := 0;
totalServiceTime float := 0;
BEGIN
IF xtime < ytime THEN
rollingWindow := EXTRACT (EPOCH FROM (ytime - xtime));
downtime := getManagedOutageForIntfInWindow(nid, ipid, ytime, xt
ime)/1000;
ELSE
rollingWindow := EXTRACT (EPOCH FROM (xtime - ytime));
downtime := getManagedOutageForIntfInWindow(nid, ipid, xtime, yt
ime)/1000;
END IF;
count := getManagedServiceCountForIntf(nid, ipid);
totalServiceTime := count * rollingWindow;

IF totalServiceTime > 0 THEN
RETURN 100 * (1 - (downtime / totalServiceTime));
ELSE
IF totalServiceTime = 0 THEN
RETURN 100;
ELSE
RETURN -1;
END IF;
END IF;
END;
' LANGUAGE 'plpgsql';:
Caused By: Error executing SQL CREATE OR REPLACE FUNCTION getManagePer
centAvailIntfWindow(integer,varchar(16), timestamp without time zone, timestamp
without time zone)
RETURNS float8 AS '
DECLARE
nid ALIAS FOR $1;
ipid ALIAS FOR $2;
xtime ALIAS FOR $3;
ytime ALIAS FOR $4;
downtime float8 := 0.0;
count integer := 0;
rollingWindow float := 0;
totalServiceTime float := 0;
BEGIN
IF xtime < ytime THEN
rollingWindow := EXTRACT (EPOCH FROM (ytime - xtime));
downtime := getManagedOutageForIntfInWindow(nid, ipid, ytime, xt
ime)/1000;
ELSE
rollingWindow := EXTRACT (EPOCH FROM (xtime - ytime));
downtime := getManagedOutageForIntfInWindow(nid, ipid, xtime, yt
ime)/1000;
END IF;
count := getManagedServiceCountForIntf(nid, ipid);
totalServiceTime := count * rollingWindow;

IF totalServiceTime > 0 THEN
RETURN 100 * (1 - (downtime / totalServiceTime));
ELSE
IF totalServiceTime = 0 THEN
RETURN 100;
ELSE
RETURN -1;
END IF;
END IF;
END;
' LANGUAGE 'plpgsql';:
Caused By: ERROR: language "plpgsql" does not exist
at liquibase.ChangeSet.execute(ChangeSet.java:238)
at liquibase.parser.visitor.UpdateVisitor.visit(UpdateVisitor.java:26)
at liquibase.parser.ChangeLogIterator.run(ChangeLogIterator.java:41)
at liquibase.Liquibase.update(Liquibase.java:112)
at org.opennms.core.schema.Migrator.migrate(Migrator.java:287)
... 2 more
Caused by: liquibase.exception.JDBCException: Error executing SQL CREATE OR REPL
ACE FUNCTION getManagePercentAvailIntfWindow(integer,varchar(16), timestamp with
out time zone, timestamp without time zone)
RETURNS float8 AS '
DECLARE
nid ALIAS FOR $1;
ipid ALIAS FOR $2;
xtime ALIAS FOR $3;
ytime ALIAS FOR $4;
downtime float8 := 0.0;
count integer := 0;
rollingWindow float := 0;
totalServiceTime float := 0;
BEGIN
IF xtime < ytime THEN
rollingWindow := EXTRACT (EPOCH FROM (ytime - xtime));
downtime := getManagedOutageForIntfInWindow(nid, ipid, ytime, xt
ime)/1000;
ELSE
rollingWindow := EXTRACT (EPOCH FROM (xtime - ytime));
downtime := getManagedOutageForIntfInWindow(nid, ipid, xtime, yt
ime)/1000;
END IF;
count := getManagedServiceCountForIntf(nid, ipid);
totalServiceTime := count * rollingWindow;

IF totalServiceTime > 0 THEN
RETURN 100 * (1 - (downtime / totalServiceTime));
ELSE
IF totalServiceTime = 0 THEN
RETURN 100;
ELSE
RETURN -1;
END IF;
END IF;
END;
' LANGUAGE 'plpgsql';
at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:56
)
at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:87
)
at liquibase.change.AbstractChange.execute(AbstractChange.java:251)
at liquibase.change.AbstractChange.executeStatements(AbstractChange.java
:97)
at liquibase.ChangeSet.execute(ChangeSet.java:214)
... 6 more
Caused by: org.postgresql.util.PSQLException: ERROR: language "plpgsql" does not
exist
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryEx
ecutorImpl.java:1525)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutor
Impl.java:1309)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.ja
va:188)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Stat
ement.java:452)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(Abstract
Jdbc2Statement.java:340)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Stat
ement.java:332)
at liquibase.database.template.JdbcTemplate$1ExecuteStatementCallback.do
InStatement(JdbcTemplate.java:79)
at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:49
)
... 10 more
[root@localhost bin]#
...全文
185 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
yhf365 2009-07-15
  • 打赏
  • 举报
回复
Error executing SQL CREATE OR REPLACE FUNCTION...
这一个提示貌似是主要原因。
getManagePercentAvailIntfWindow(integer,varchar(16), timestamp without time zone, timestamp without time zone)
可能是这个函数调用出了问题。
不知道怎么回事。
lambert_s 2009-07-14
  • 打赏
  • 举报
回复
同样看不懂。。。
帮楼主顶!
huang_w 2009-07-14
  • 打赏
  • 举报
回复
哇 看不懂啊,雷顶!

19,612

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧