[SCM]源碼管理 – Perforce之Windows上多個perfoce和proxy並存

來源:互聯網
上載者:User

 

預設地windows的安裝檔案perforce.exe可以將perforce或proxy安裝為windows services,預設的services的名字分別為perforce和perforce proxy。但是對於在同一個windows系統上安裝多個perforce或proxy的services的時候,我們需要使用svcinst.exe(可以在perforce server的安裝目錄下獲得)來手動地完成services的安裝。

 

一 安裝第二個perforce server

假設我們已經有一個perforce server安裝在c:\perforce, 且以名字為perforce的service運行。現在我們假設第二個perforce server的root為c:\p4root2且service名為為perforce2。

1) 建立P4ROOT目錄

mkdir c:\p4root2

2)拷貝p4d到P4ROOT目錄下,且修改名字為p4s,表示此server將以service方式運行。拷貝license檔案到P4ROOT下,方便起見也將svcinst.exe拷貝到P4ROOT下。

copy c:\perforce\p4d.exe c:\p4root2
copy c:\perforce\p4d.exe c:\p4root2\p4s.exe
install {duplicate license} into c:\p4root2\license
copy c:\perforce\svcinst.exe c:\p4root2\svcinst.exe
# copy c:\perforce\svcinst.dll c:\p4root2\svcinst.dll

如果是2008.1以前的版本,還需要拷貝svcinst.dll。

3)使用service安裝程式來安裝perforce2 service。在安裝前需要先切換到P4ROOT目錄。

cd c:\p4root2
svcinst create -n Perforce2 -e c:\p4root2\p4s.exe -a

4)設定perforce2 service的參數。使用client p4.exe來執行如下設定。

p4 set -S Perforce2 P4ROOT=c:\p4root2
p4 set -S Perforce2 P4PORT=1667
p4 set -S Perforce2 P4LOG=log
p4 set -S Perforce2 P4JOURNAL=journal

查看參數的設定,使用p4 set -S Perforce2。

5)使用service安裝程式來啟動service,如下:

svcinst start -n Perforce2

注意: 如果P4ROOT指向的是網路路徑,則需要使用管理員帳號來建立service。可以對svcinst使用-r和-u來指定管理員帳號。

svcinst create -n Perforce2 -e c:\p4root2\p4s.exe -a -r -u UserName Password

 

二 建立service名字為AAA的proxy

過程與建立perforce service相同,指令碼如下:

mkdir c:\p4proxyAAA
copy C:\Program Files\Perforce\Proxy\p4p.exe c:\p4proxyAAA\p4p.exe
copy c:\p4proxyAAA\p4p.exe c:\p4proxyAAA\p4ps.exe
svcinst create -n "Perforce Proxy AAA" -e c:\P4ProxyAAA\p4ps.exe -a
p4 set -S "Perforce Proxy AAA" P4PORT=1999
p4 set -S "Perforce Proxy AAA" P4LOG=log
p4 set -S "Perforce Proxy AAA" P4PCACHE=c:\P4ProxyAAA
p4 set -S "Perforce Proxy AAA" P4TARGET=perforce:1666
p4 set -S "Perforce Proxy AAA"

svcinst start -n "Perforce Proxy AAA"

 

參考: http://kb.perforce.com/article/35

 
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.