nexus 從Window遷移至Linux

來源:互聯網
上載者:User

標籤:nexus   遷移   windows   nexus-2.8.0   centos   

    根據業務需求,需要將nexus-2.8.0從Windows 2003遷移至CentOS 6.8(x86_64)上。在遷移過程中遇見了幾個坑,在此記錄已做備忘。

    因為,nexus是跨平台通用的,所以,我首先在原來的Windows伺服器上把nexus打包備份,打包時有兩個檔案需要打包一個是:nexus-2.8.0-05應用程式套件,另外一個是:sonatype-work檔案包。當然這兩個包有可能在一個目錄下面,但我們之前搭建這個平台的同事是開發,所以.........

    在打sonatype-work檔案包發現報錯,WinRAR提示有檔案正在被使用。這時需要先停止nexus,命令如下:

cmd #進入dosD:D:\>cd nexus-2.8.0-05\bin #進入nexus的bin目錄nexus.bat stop  #停止nexus ,nexus的啟動停止命令是nexus  start/stop

650) this.width=650;" src="https://s4.51cto.com/wyfs02/M01/8D/8F/wKiom1ihbOvAem3LAABuXqBDWt4883.jpg-wh_500x0-wm_3-wmp_4-s_2164782666.jpg" title="11.jpg" alt="wKiom1ihbOvAem3LAABuXqBDWt4883.jpg-wh_50" />

    然後再進行打sonatype-work檔案包。


    緊接著在Linux平台建立nexus使用者,並將兩個包上傳到Linux平台下去。

useradd nexus  #在建立使用者時不能使用 -s /sbin/nologin 參數mkdir /usr/local/nexus #建立nexus的目錄


    然後解析並修改相關目錄名稱

unzip nexus-2.8.0-05.zipmv nexus-2.8.0-05  nexus-appunzip sonatype-work.zip

650) this.width=650;" src="https://s4.51cto.com/wyfs02/M01/8D/8F/wKiom1ihbjrDcagcAAAiO_mQyXI710.jpg-wh_500x0-wm_3-wmp_4-s_2420824741.jpg" title="22.jpg" alt="wKiom1ihbjrDcagcAAAiO_mQyXI710.jpg-wh_50" />


    然後進行相關選項修改

chmod 777 /usr/local/nexus/nexus-app/bin/jsw/linux-x86-64/wrapper chmod 777 /usr/local/nexus/nexus-app/bin/nexuschown -R nexus.nexus /usr/local/nexus

650) this.width=650;" src="https://s1.51cto.com/wyfs02/M00/8D/8D/wKioL1ihbymRELZkAABA8iLLrEc206.jpg-wh_500x0-wm_3-wmp_4-s_4152014300.jpg" title="33.jpg" alt="wKioL1ihbymRELZkAABA8iLLrEc206.jpg-wh_50" />


    修改nexus相關配置

vim /usr/local/nexus/nexus-app/bin/nexus    NEXUS_HOME="/usr/local/nexus/nexus-app"  #nexus的主目錄    RUN_AS_USER=nexus   #nexus的運行使用者

650) this.width=650;" src="https://s1.51cto.com/wyfs02/M00/8D/8D/wKioL1ihb8KTc1fHAADXnHxo8Ro518.jpg-wh_500x0-wm_3-wmp_4-s_503395561.jpg" title="44.jpg" alt="wKioL1ihb8KTc1fHAADXnHxo8Ro518.jpg-wh_50" />


    最後進行nexus使用者密碼初始化

    首先,停止nexus服務

/usr/local/nexus/nexus-app/bin/nexus stop

    然後,刪除sonatype-work/nexus/conf目錄下的security-configuration.xml  security.xml兩個檔案

rm -rf /usr/local/nexus/sonatype-work/nexus/conf/security.xmlrm -rf /usr/local/nexus/sonatype-work/nexus/conf/security-configuration.xml

650) this.width=650;" src="https://s4.51cto.com/wyfs02/M02/8D/8D/wKioL1ihcc_iy0BYAABHe0iFR5U562.jpg-wh_500x0-wm_3-wmp_4-s_1308908252.jpg" title="55.jpg" alt="wKioL1ihcc_iy0BYAABHe0iFR5U562.jpg-wh_50" />

    最後,帳號/密碼變為: admin/admin123


說明:

    關於nexus的系統連接埠和檔案存放目錄,主要是在/usr/local/nexus/nexus-app/conf/nexus.properties這個檔案中進行相關設定

650) this.width=650;" src="https://s1.51cto.com/wyfs02/M00/8D/8F/wKiom1ihctmSP8YUAAFJkUPiPoY776.jpg-wh_500x0-wm_3-wmp_4-s_3988929250.jpg" title="66.jpg" alt="wKiom1ihctmSP8YUAAFJkUPiPoY776.jpg-wh_50" />


至此遷移完成,可以通過:http://ip:8080/nexus/ 訪問nexus,通過admin/admin123登入


錯誤1:

[[email protected] ~]# /app/nexus-2.8.0-05/bin/nexus startStarting Nexus OSS...Failed to start Nexus OSS.

    主要原因是:因為nexus和sonatype-work未授權

chown -R nexus.nexus /app/sonatype-work/chown -R nexus.nexus /app/nexus-2.8.0-05/


錯誤2:

[[email protected] ~]# /app/nexus-2.8.0-05/bin/nexus startMissing platform binary: /app/nexus-2.8.0-05/bin/jsw/linux-x86-64/wrapper

    主要原因是:1、/app/nexus-2.8.0-05/bin/jsw/linux-x86-64/wrapper 沒有許可權,該檔案需要執行許可權。2、/app/nexus-2.8.0-05/bin/nexus未設定“NEXUS_HOME=”參數。

chmod 777 /app/nexus-2.8.0-05/bin/jsw/linux-x86-64/wrappervim /app/nexus-2.8.0-05/bin/nexus    NEXUS_HOME="/app/nexus-2.8.0-05"

650) this.width=650;" src="https://s5.51cto.com/wyfs02/M01/8D/8F/wKiom1ihdPmg6cfFAADTwwt7iMw901.jpg-wh_500x0-wm_3-wmp_4-s_3447255382.jpg" title="77.jpg" alt="wKiom1ihdPmg6cfFAADTwwt7iMw901.jpg-wh_50" />



本文出自 “了心” 部落格,轉載請與作者聯絡!

nexus 從Window遷移至Linux

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.