今天做SVN實驗在 svn checkout的時候,遇到一個問題:
svn: E210005: Unable to connect to a repository at URL 'svn://192.168.33.150/myproject'
svn: E210005: No repository found in 'svn://192.168.33.150/myproject'
前幾天也遇到這個了問題,但是今天我換了一台機器做實驗的時候又遇到了,神奇的是我忘了自己之前是怎麼解決的了,這可就把自己坑了。
網上查了很多方法,大部分都是直接在Windows上操作怎麼弄,甚至有的答非所問,毫無參考意義。
這裡第一步檢查服務啟動有沒有問題:
# ps aux|grep svnserve
root 1021 0.0 0.0 162240 652 ? Ss 03:44 0:00 svnserve -d -r /data/svnroot/
root 1023 0.0 0.0 112704 964 pts/0 R+ 03:44 0:00 grep --color=auto svnserve
# netstat -lntp |grep svnserve
tcp 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN 1021/svnserve //發現沒什麼問題
再檢視機器的防火牆和selinux:
# iptables -nvL
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
# getenforce
Disabled
都沒問題,已經關閉了
那怎麼會不通呢,ping和telnet 端口的時候都是通的,有點沒道理。
這時,我注意到自己啟動svnserve服務時啟動的目錄是不是有問題?于是重新開機服務:
# svnserve -d -r /data/svnroot/myporject/
# svn checkout svn://192.168.33.150/myproject --username=user1
Authentication realm: <svn://192.168.33.150:3690> /data/svnroot/myproject
Password for 'user1':
果然是這個目錄有問題,是以大家在遇到這個問題的時候可以嘗試更換一下啟動時的目錄,說不定問題就解決了呢!