nexus私服linux搭建問題
一、這幾天伺服器掛了,nexus私服沒有備份出來,只能手動再安裝一個新的在新的伺服器上。
前提是該伺服器已經配置好了JDK,當前伺服器版本是jdk1.6.0_29-64 。
nexus安裝包下載:http://www.sonatype.org/nexus/archived
先是下載目前最新的版本
有提供zip和tar.gz格式,隨便下哪種都可以。解壓後安裝到/opt/nexus目錄。
二、解壓之後會有兩個資料夾,nexus-2.6.0-05和sonatype-work,我們進入第一個資料夾的bin目錄來啟動nexus 。
1、進入啟動目錄,啟動
cd nexus-2.6.0-05/bin/
./nexus start
2、這時候提示:
****************************************
WARNING – NOT RECOMMENDED TO RUN AS ROOT
****************************************
If you insist running as root, then set the environment variable RUN_AS_USER=root before running this script.
大概意思就是要在環境配置export RUN_AS_USER=root,臨時配置
在命令列下輸入:
export RUN_AS_USER=root
然後執行,就不會再提示了
./nexus start
3、也可以在系統裡面永久配置
vi /etc/profile 加入export RUN_AS_USER=root
三、啟動之後檢視日誌(日誌路徑:nexus/logs)
報:
wrapper | Reloading Wrapper configuration...
wrapper | Launching a JVM...
wrapper | JVM exited while loading the application.
jvm 5 | Exception in thread "main" java.lang.UnsupportedClassVersionError: org/sonatype/nexus/bootstrap/jsw/JswLauncher : Unsupported major.minor version 51.0
jvm 5 | at java.lang.ClassLoader.defineClass1(Native Method)
jvm 5 | at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
jvm 5 | at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
jvm 5 | at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
jvm 5 | at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
jvm 5 | at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
jvm 5 | at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
jvm 5 | at java.security.AccessController.doPrivileged(Native Method)
jvm 5 | at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
jvm 5 | at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
jvm 5 | at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
jvm 5 | at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
jvm 5 | Could not find the main class: org.sonatype.nexus.bootstrap.jsw.JswLauncher. Program will exit.
wrapper | There were 5 failed launches in a row, each lasting less than 300 seconds. Giving up.
wrapper | There may be a configuration problem: please check the logs.
wrapper | <-- Wrapper Stopped
網上解釋是要JAVA7才行。唉只能下個低版本了。
四、重新下了個nexus-oss-webapp-1.9.2.4-bundle.zip 版本。
解壓/opt/nexus1924/bin/jsw/linux-x86-64 目錄下啟動就可以訪問了。
http://192.168.13.31:8081/nexus
預設管理員使用者名稱/密碼: admin/admin123
五、參考
http://blog.youxey.com/archives/293.html
http://blog.csdn.net/shandian534/article/details/8987349 Nexus 安裝與配
http://snowolf.iteye.com/blog/1605811 Maven零散筆記——配置Nexus
http://www.blogjava.net/javalinjx/archive/2013/08/21/403110.html linux系統之上搭建maven 之nexus服務篇
http://wenku.baidu.com/view/a9a0618acc22bcd126ff0c4a.html Nexus入門指南(圖文)