2012-02-22 43 views
0

我已經下載opennms-source-1.10.0-2.tar並根據http://opennms.org/wiki/Eclipse_and_OpenNMS成功構建源代碼。如何在構建源代碼後啓動opennms

現在我想運行/啓動opennnms並根據我的業務需求開發代碼。 任何想法如何啓動opennms ?.

+0

[配置OpenNMS](http://opennms.org/wiki/Docu-overview#Configuring_OpenNMS)沒有幫助嗎? – Raghuram 2012-02-22 11:45:42

+0

@Raghuram:thnx 4 ur reply.I看着你提供的鏈接。但是我在哪裏可以找到從eclipse或jetty服務器運行代碼的步驟。 – karthik07 2012-02-22 12:27:31

+0

我沒有任何想法如何開始。所以我更喜歡一步一步的程序,因爲我對這個opennms完全陌生。 – karthik07 2012-02-22 12:31:12

回答

0

在Windows OpenNMS的開發設置(可乘坐bulid,並在Windows啓動服務器)

1.Download Opennms latest source code 

2.Download latest Java JDK and install it. Set JAVA_HOME path 

3.Download Postgres and install it. Set the path in environment variable 

4.Download Perl and install it. Set path in environment variable 

5.Unzip the opennms source code and put it your local server 
    (Ex : D:\Workspace\OpenNMS\Source\opennms) 

6.Set the mavan bin path in environment variable 
    (Ex : D:\Workspace\OpenNMS\Source\opennms\maven\bin) 

7.Enter into D:\Workspace\OpenNMS\Source\opennms> path 

8.Clean your project 
    (Ex : D:\Workspace\OpenNMS\Source\opennms>perl clean.pl) 

9.Compile your opennms project 
    (Ex : D:\Workspace\OpenNMS\Source\opennms>perl compile.pl) 

10.Assemple your or build your project 
    (Ex : D:\Workspace\OpenNMS\Source\opennms>perl assemple.pl -Dopennms.home=D:\Workspace\OpenNMS\Build) 

11.Copy your build file opennms-1.13.0-SNAPSHOT.tar.gz from D:\Workspace\OpenNMS\Source\opennms\target folder 

12.Put it your build opennms home location and unzip it 
    (Ex : D:\Workspace\OpenNMS\Build) 

13.Now your folder structure in build path should be the folllowing hira 
    Build 
    - bin 
    - etc 
    - ... 

14.Create install.bat file with the following content 

SET OPENNMS_HOME=D:/Workspace/OpenNMS/Build 
SET DBNAME=opennms 
SET DBURL=jdbc:postgresql://localhost:5432/ 
SET ETCDIR=%OPENNMS_HOME%/etc 
SET SERVLETDIR=%OPENNMS_HOME%/webapps/opennms 

"C:\Program Files\Java\jdk1.6.0_20\bin\java" -Xmx512m "-Dopennms.home=%OPENNMS_HOME%" "-Dinstall.dir=%OPENNMS_HOME%" "-Dinstall.database.name=%DBNAME%" "-Dinstall.database.url=%DBURL%" "-Dinstall.etc.dir=%ETCDIR%" "-Dinstall.servlet.dir=%SERVLETDIR%" -classpath "%OPENNMS_HOME%/lib/opennms_bootstrap.jar;%OPENNMS_HOME%/lib/opennms_install.jar" org.opennms.install.Installer %* 


15.Download jicmp.dll and jicmp6.dll file and put it in your java bin folder 
    (Ex : C:\Program Files\Java\jdk1.6.0_20\bin) 

16.Change your postgres password in D:\Workspace\OpenNMS\Build\etc\opennms-datasources.xml file 

    <jdbc-data-source name="opennms-admin" 

         database-name="template1" 

         class-name="org.postgresql.Driver" 

         url="jdbc:postgresql://localhost:5432/template1" 

         user-name="postgres" 

         password="postgres" /> 

17.Create the opennms database for opennms source with help of install.bat file 
    (Ex : D:\Workspace\OpenNMS\Build\bin>install.bat -d) 

18.Create opennms.bat file with the following content to start opennms bulid 

"C:\Program Files\Java\jdk1.6.0_20\bin\java" -Xmx512m -XX:MaxPermSize=256m -Dopennms.home="D:/Workspace/OpenNMS/Build" -Djava.endorsed.dirs="$OPENNMS_HOME/lib/endorsed" -jar "D:/Workspace/OpenNMS/Build/lib/opennms_bootstrap.jar" %* 

19.To run the opennms server, Open cmd prompt in admin mode and run opennms.bat file 
    (Ex : D:\Workspace\OpenNMS\Build\bin>opennms.bat start) 
0

制定

  1. 下載OpenNMS的代碼,並通過給予建造它「命令MVN安裝 - DskipTests「在opennms主目錄中。 注意 - 確保您可以完全訪問互聯網,否則編譯可能會失敗。
  2. 如果您擁有8GB RAM機器,生成將在不到15分鐘內完成。
  3. 現在轉到openms_home_directory/bin併發出「sudo opennms start」,這將啓動您的opennms。
  4. 根據您的業務需求添加java文件或模塊。
  5. 再次構建項目,在各自的maven項目文件夾中,您將擁有pom.xml和生成的目標文件夾。轉到目標文件夾並複製該jar,並將其放入已安裝的opennms目錄/ usr/share/opennms/lib中,然後重新啓動服務器。