svn: E000113: Unable to connect to a repository at URL 'svn://IP/repos'无法连接主机“IP”: 由于连接方在一段时间后没有正确答复

来源:互联网 发布:淘宝专业刷单团队 编辑:程序博客网 时间:2024/05/21 06:45

svn: E000113: Unable to connect to arepository at URL 'svn://IP/repos'

无法连接主机“IP”: 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

 

centos7 中安装 subversion  启动svnserve服务之后,在本机可以import和co命令,但是在其他机器上访问则出现如下错误提示:

linux 端:

[mike@centos code_lab]$ svn cosvn://192.168.123.64/repos

svn: E000113: Unable to connect to arepository at URL 'svn://192.168.123.64/repos'

svn: E000113: Can't connect to host'192.168.123.64': No route to host

 

windows 端:


刚开始以为是 svnserver默认的 3690端口没有监听,于是:

$netstat -anltup | grep :3690

tcp       0      0 0.0.0.0:3690            0.0.0.0:*               LISTEN      44920/svnserve

 

-a     all,所有

-n    number,把能以数字表示的用数字表示,像端口号之类。

-l      listen,被监听的

-t     tcp,tcp协议的

-u    udp,udp协议的

-p     输出进程名

 

发现端口已经被监听到了;

一般“无法连接主机”主要起因可归为如下几个问题:

1、网络原因,主机不可达;

2、服务没有启动;

3、防火墙拦截;

 

可以在其他机器上ping 通svnserve 主机ip ,所以网络可达,排除问题1

通过 ps –aux | grep svn 可以明显看到svnserve进程存在,所以 svnserve服务起来了,排除问题2

 

centos7 设置防火墙:

$firewall-cmd –permanent –zone=public –add-port=3690/tcp

$firewall-cmd –reload

 

果然问题解决,通过其他机器可以checkout repos上的代码了

 

centos7防火墙配置

CentOS7使用的是Linux Kernel3.10.0的内核版本,新版的Kernel内核已经有了防火墙netfilter,并且firewalld的使用效能更高,稳定性更好。

CentOS7配置防火墙的两种方法:

一、使用xml配置文件的方式配置;

方法一

cp /usr/lib/firewalld/services/http.xml/etc/firewalld/services/

firewall-cmd --reload

二、使用命令的方式配置;

方法二

##Add

firewall-cmd --permanent --zone=public--add-port=80/tcp

##Remove

firewall-cmd --permanent --zone=public--remove-port=80/tcp

##Reload

firewall-cmd --reload

其中,方法二的配置方式是间接修改/etc/firewalld/zones/public.xml文件,方案一也需要在public.xml里面新增,否则http的防火墙规则不会生效,而且两种配置方式都需要重新载入防火墙。

附:

查看防火墙状态

systemctl status firewalld.service

启动防火墙

systemctl start firewalld.service

关闭防火墙

systemctl stop firewalld.service

重新启动防火墙

 

0 0