CVS的遷移

cvs的遷移
1,把原dell2950上的rhel3 的/cvs目錄做成 nfs共享
2,在新dell720上的rhel5.8上掛載nfs共享,並複製
mount -t nfs rhel3:/cvs /mnt  (新服務器上)
cp -aP  /mnt /cvs  (新服務器上的帳號在前面已經遷移好,主要這樣做是爲了保證權限一致)
3,rhel5.8上安裝cvs,cvs-inetd
cvs-1.11.22-11.el5
cvs-inetd-1.11.22-11.el5
4,編輯/etc/xinetd.d/cvs文件(這裏多project的配置方法,原那個地方直接註釋也可以多project)
cat /etc/xinetd.d/cvs
# default: on
# description: The CVS service can record the history of your source \
#              files. CVS stores all the versions of a file in a single \
#              file in a clever way that only stores the differences \
#              between versions.
service cvspserver
{
        disable                 = no
        port                    = 2401
        socket_type             = stream
        protocol                = tcp
        wait                    = no
        user                    = root
        passenv                 = PATH
        server                  = /usr/bin/cvs
#       env                     = HOME=/var/cvs
        server_args             = -f --allow-root=/cvs --allow-root=/cvs/project1  --allow-root=/cvs/project2  --allow-root=/cvs/project3 --allow-root=/cvs/project4 --allow-root=/cvs/project5
#       bind                    = 127.0.0.1
        only_from               = 172.16.10.0/24
5,重啓xinetd
6,客戶端測試
$tail -n 1 .bash_profile
export CVSROOT=:pserver:user1@cvsserver:/cvs/project1
18:07:54 user1@cvsserver (~) [103]$cvs login
Logging in to :pserver:user1@cvsserver:2401/cvs/project1
CVS password: 輸入密碼即可
$cvs checkout someone

最後注意點:
如果你遷移時IP地址也更改了,客戶端正在使用的就會報錯,應爲check out 下來的每個文件夾下都有
一個CVS,每個CVS下都有一個文件Root,裏面記錄了原來CVS服務器的IP地址,如果你想遷移,最好別改
IP,如果改了,就得在自己的目錄下把Root裏面的IP地址更改掉或者重新check out 一遍。
下面是快速更改IP的方法
find ./* -name Root |xargs sed -i "s/\:pserver\:user\@oldip\:\/cvs/\:pserver\:user\@newip\:\/cvs/g"
​更簡單的寫法是  find ./* -name Root | xargs sed -i 's/oldip/newip/g'

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章