楓中暢游

          關(guān)注技術(shù),熱愛生活
          隨筆 - 15, 文章 - 0, 評論 - 3, 引用 - 0
          數(shù)據(jù)加載中……

          2013年8月21日

          linux系統(tǒng)之上搭建maven 之nexus服務(wù)篇

                 今天剛好有點時間,就想在公司的服務(wù)器搭建一個私服,以便以后可以唯我所用,當然前提是服務(wù)器最好可以上網(wǎng),否則還需要配置代理服務(wù)器,前兩天剛好把服務(wù)器的網(wǎng)絡(luò)給配置了下,這邊就不詳述了!大家一定著急了吧,稍安務(wù)燥,這就進入正題,O(∩_∩)O~

                  linux安裝過程和window主機還是差別挺大的。

          1.下載nexus集成版

          到這個地方http://www.sonatype.org/nexus/go 下載壓縮包,我這邊下載的是nexus-2.0.3-bundle.tar.gz這個版本。

          2. 解壓到相應(yīng)的目錄

          tar  -xzvf  nexus-2.0.3-bundle.tar.gz , 我這邊放在/home/linjx/opendev/nexus-2.0.3目錄下。

           

          3. 設(shè)置為系統(tǒng)服務(wù)

          這里需要使用root權(quán)限,具體請看http://books.sonatype.com/nexus-book/reference/install-sect-service.html

          簡單如下:

          # cd  /etc/init.d

          # cp  /home/linjx/opendev/nexus-2.0.3/bin/jsw/linux-x86-64/nexus ./nexus

          # chmod 755 nexus

          # chkconfig --add nexus

          # chkconfig --levels 345 nexus on

           

          4. 編輯/etc/init.d/nexus的文本

          4.1. 添加以下變量

          RUN_AS_USER=linjx    ## 這個主要為了后面使用,不需要使用root用戶啟動服務(wù)

          NEXUS_HOME=/home/linjx/opendev/nexus-2.0.3/

          PLATFORM=linux-x86-64

          PLATFORM_DIR="${NEXUS_HOME}/bin/jsw/${PLATFORM}"

          4.2. 修改以下變量

          WRAPPER_CMD="${PLATFORM_DIR}/wrapper"

          WRAPPER_CONF="${PLATFORM_DIR}/../conf/wrapper.conf"

           

           

          PIDDIR="${NEXUS_HOME}"

           

          5. 啟動服務(wù)

          切換會自己的用戶,不需要使用root用戶;

          # service nexus start

           

          這個大家出現(xiàn)什么情況,是不是失敗了!界面上出現(xiàn) :Could not write pid file /etc/rc.d/init.d/./nexus.pid: Permission denied通過查看日志文件:

          fzdev#[/home/linjx/opendev/nexus-2.0.3/logs] cat w*  

          wrapper  | ERROR: Could not write pid file /etc/rc.d/init.d/./nexus.pid: Permission denied

           

          怎么辦呢,根據(jù)信息提示,nexus.pid無法寫入,應(yīng)該還是權(quán)限問題,這個應(yīng)該跟啟動當前服務(wù)有關(guān)。

           

          查文檔http://books.sonatype.com/nexus-book/reference/install-sect-service.html后發(fā)現(xiàn),一有段信息沒有配置,

          Change PIDDIR to a directory where this user has read/write permissions. In most Linux distributions, /var/run is only writable by root. The properties you need to add to customize the PID file location is "wrapper.pid". For more information about this property and how it would be configured in wrapper.conf, see: http://wrapper.tanukisoftware.com/doc/english/properties.html

           

          大概意思就是服務(wù)啟動時無法寫入pid,就是說init.d這個目錄當前用戶是沒有權(quán)限寫的,怎么辦呢。可以自定義pid寫入目錄,那么在哪里配置呢,是不是又想起了wrapper.conf了,其他文檔中也說明了。

          好吧,那就再加個配置吧,這樣:PIDDIR="/home/linjx/piddir"

           

          然后再啟動服務(wù),果然成功了!具體可以看看附件中的詳細的日志!



           

          6. 啟動之后,可以登錄首頁查看nexus的界面

          http://192.168.1.26:8081/nexus/index.html

           

          默認管理員用戶名/密碼: admin/admin123

           



           

          posted @ 2013-08-21 09:32 javalinjx 閱讀(14956) | 評論 (2)編輯 收藏

          主站蜘蛛池模板: 昌图县| 桐梓县| 楚雄市| 汪清县| 彰武县| 青河县| 江西省| 乌鲁木齐县| 喜德县| 武强县| 清徐县| 河津市| 和硕县| 桦川县| 汝州市| 凤山市| 抚宁县| 酉阳| 灵寿县| 云龙县| 上饶市| 唐山市| 临夏县| 乐都县| 松溪县| 容城县| 江口县| 深圳市| 华蓥市| 潜山县| 舟曲县| 绩溪县| 新龙县| 剑川县| 通化县| 商城县| 新化县| 亚东县| 天水市| 长白| 通州区|