CentOS 6.3_ RSync实现文件备份同步配置排除故障

简介:
  排除故障 
***************************
1.@ERROR: auth failed on module xxxxx
    rsync: connection unexpectedly closed (90 bytes read so far)
    rsync error: error in rsync protocol data stream (code 12) at io.c(150)
    这是因为密码设错了, 无法登入成功, 请检查一下 rsyncd.scrt 中的密码, 二端是否一致? 
2.password file must not be other-accessible 
    continuing without password file 
    Password:
    这表示 rsyncd.scrt 的档案权限属性不对, 应设为 600。
3.@ERROR: chroot failed
    rsync: connection unexpectedly closed (75 bytes read so far)
    rsync error: error in rsync protocol data stream (code 12) at io.c(150)   
    这通常是您的 rsyncd.conf 中的 path 路径所设的那个目录并不存在所致.请先用 mkdir开设好要备份目录
4.@ERROR: access denied to www from unknown (192.168.1.123)
    rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
    rsync error: error in rsync protocol data stream (code 12) at io.c(359)
    最后原因终于找到了。因为有两个网段都需要同步该文件夹内容,但没有在hosts allow 后面添加另一个IP段
    hosts allow = 192.168.1.0/24
    改为
    hosts allow = 192.168.1.0/24 192.168.2.0/24
    重新启动rsync服务,问题解决 
5.rsync: failed to connect to 172.21.50.8: No route to host (113)
    rsync error: error in socket IO (code 10) at clientserver.c(104) [receiver=2.6.9]
    对方没开机、防火墙阻挡、通过的网络上有防火墙阻挡,都有可能。关闭防火墙,其实就是把tcp udp 的873端口打开
    启动服务:rsync --daemon --config=/etc/rsyncd.conf
6.@ERROR: auth failed on module backup
    rsync error: error starting client-server protocol (code 5) at main.c(1506) [Receiver=3.0.7]
    client端没有设置/etc/rsync.pas这个文件,而在使用rsync命令的时候,加了这个参数--password-file=/etc/rsync.scrt 
7.rsync: recv_generator: mkdir "/teacherclubBackup/rsync……" failed: No space left on device (28)
    *** Skipping any contents from this failed directory ***
    磁盘空间满了 
8.rsync: opendir "/kexue" (in dtsChannel) failed: Permission denied (13)
    同步目录的权限设置不对,改为755 
9.rsync: read error: Connection reset by peer (104)
    rsync error: error in rsync protocol data stream (code 12) at io.c(759) [receiver=3.0.5]
    未启动xinetd守护进程
    [root@CC02 /]# service xinetd start
10.rsync: unable to open configuration file "/etc/rsyncd.conf": No such file or directory
    xnetid查找的配置文件位置默认是/etc下,在/etc下找不到rsyncd.conf文件
11.rsync: failed to connect to 203.100.192.66: Connection timed out (110)
    rsync error: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.5]
    连接服务器超时,检查服务器的端口netstat –tunlp,远程telnet测试
12.[root@client cron.daily.rsync]# sh root.sh  
    ERROR: password file must not be other-accessible
    rsync error: syntax or usage error (code 1) at authenticate.c(175) [Receiver=3.0.9]
    创建密码文件,root用户用的是 rsyncroot.password,权限是600
13.如何通过ssh进行rsync,而且无须输入密码?
  可以通过以下几个步骤
  1. 通过ssh-keygen在server A上建立SSH keys,不要指定密码,你会在~/.ssh下看到identity和identity.pub文件 
  2. 在server B上的home目录建立子目录.ssh
  3. 将A的identity.pub拷贝到server B上
  4. 将identity.pub加到~[user b]/.ssh/authorized_keys
  5. 于是server A上的A用户,可通过下面命令以用户B ssh到server B上了。e.g. ssh -l userB serverB。这样就使server A上的用户A就可以ssh以用户B的身份无需密码登陆到server B上了。
14.如何通过在不危害安全的情况下通过防火墙使用rsync?
  解答如下:
   这通常有两种情况,一种是服务器在防火墙内,一种是服务器在防火墙外。无论哪种情况,通常还是使用ssh,这时最好新建一个备份用户,并且配置sshd 仅允许这个用户通过RSA认证方式进入。如果服务器在防火墙内,则最好限定客户端的IP地址,拒绝其它所有连接。如果客户机在防火墙内,则可以简单允许防 火墙打开TCP端口22的ssh外发连接就ok了。
15.我能将更改过或者删除的文件也备份上来吗?
  当然可以。你可以使用如:rsync -other -options -backupdir = ./backup-2000-2-13  ...这样的命令来实现。这样如果源文件:/path/to/some/file.c改变了,那么旧的文件就会被移到./backup- 2000-2-13/path/to/some/file.c,这里这个目录需要自己手工建立起来
16.我需要在防火墙上开放哪些端口以适应rsync?
  视情况而定。rsync可以直接通过873端口的tcp连接传文件,也可以通过22端口的ssh来进行文件传递,但你也可以通过下列命令改变它的端口:
  rsync --port 8730 otherhost::
  或者
  rsync -e 'ssh -p 2002' otherhost:
17.我如何通过rsync只复制目录结构,忽略掉文件呢? 
  rsync -av --include '*/' --exclude '*' source-dir dest-dir
18.为什么我总会出现"Read-only file system"的错误呢?
  看看是否忘了设"read only = no"了
19.为什么我会出现'@ERROR: invalid gid'的错误呢?
  rsync使用时默认是用uid=nobody;gid=nobody来运行的,如果你的系统不存在nobody组的话,就会出现这样的错误,可以试试gid = ogroup或者其它
20.绑定端口873失败是怎么回事?
  如果你不是以root权限运行这一守护进程的话,因为1024端口以下是特权端口,会出现这样的错误。你可以用--port参数来改变。
21.为什么我认证失败?
  从你的命令行看来:你用的是
  > bash$ rsync -a 144.16.251.213::test test
  > Password:
  > @ERROR: auth failed on module test 
  > 
  > I dont understand this. Can somebody explain as to how to acomplish this.
  > All suggestions are welcome.
  应该是没有以你的用户名登陆导致的问题,试试rsync -a max@144.16.251.213::test test
22.出现以下这个讯息, 是怎么一回事?
  @ERROR: auth failed on module xxxxx
  rsync: connection unexpectedly closed (90 bytes read so far)
  rsync error: error in rsync protocol data stream (code 12) at io.c(150)
  这是因为密码设错了, 无法登入成功, 请再检查一下 rsyncd.secrets 中的密码设定, 二端是否一致?
23.出现以下这个讯息, 是怎么一回事?
  password file must not be other-accessible 
  continuing without password file 
  Password:
  这表示 rsyncd.secrets 的档案权限属性不对, 应设为 600。请下 chmod 600 rsyncd.secrets
24.出现以下这个讯息, 是怎么一回事?
  @ERROR: chroot failed
  rsync: connection unexpectedly closed (75 bytes read so far)
  rsync error: error in rsync protocol data stream (code 12) at io.c(150)
  这通常是您的 rsyncd.conf 中的 path 路径所设的那个目录并不存在所致.请先用 mkdir开设好备份目录.



本文转自 yhw85 51CTO博客,原文链接:http://blog.51cto.com/yanghuawu/994854,如需转载请自行联系原作者
相关文章
|
1月前
|
Linux 应用服务中间件 nginx
【PUSDN】centos查看日志文件内容,包含某个关键字的前后5行日志内容,centos查看日志的几种方法
【PUSDN】centos查看日志文件内容,包含某个关键字的前后5行日志内容,centos查看日志的几种方法
48 0
|
2月前
|
Java Shell Linux
解决 centos下执行sh文件报错“/bin/bash^M: 坏的解释器:没有那个文件或目录” 问题
解决 centos下执行sh文件报错“/bin/bash^M: 坏的解释器:没有那个文件或目录” 问题
|
1天前
|
运维 网络协议 Linux
【运维系列】Centos7安装并配置PXE服务
PXE是Intel开发的预启动执行环境,允许工作站通过网络从远程服务器启动操作系统。它依赖DHCP分配IP,DNS服务分配主机名,TFTP提供引导程序,HTTP/FTP/NFS提供安装源。要部署PXE服务器,需关闭selinux和防火墙,安装dhcpd、httpd、tftp、xinetd及相关服务,配置引导文件和Centos7安装源。最后,通过syslinux安装引导文件,并创建pxelinux.cfg/default配置文件来定义启动参数。
5 0
|
1天前
|
运维 网络协议 Linux
【运维系列】Centos7安装并配置postfix服务
安装CentOS7的Postfix和Dovecot,配置Postfix的`main.cf`文件,包括修改完全域名、允许所有IP、启用邮箱等。然后,配置Dovecot的多个配置文件以启用auth服务和调整相关设置。重启Postfix和Dovecot,设置开机自启,并关闭防火墙进行测试。最后,创建邮箱账户并在Windows邮箱客户端中添加账户设置。
8 0
|
1天前
|
Linux 网络安全
Centos6.5安装并配置NFS服务
该内容描述了在Linux系统中设置NFS服务的步骤。首先挂载yum源,然后安装NFS服务,并编辑配置文件。接着,重启rpcbind和NFS服务,可能需要重复此过程以解决初始可能出现的问题。此外,关闭防火墙策略,并再次重启服务。最终,根目录被共享,特定IP网段被允许访问。
6 0
|
15天前
|
网络协议
centos8 网卡 Nmcli(是network的简写 Nmcli)配置网络
centos8 网卡 Nmcli(是network的简写 Nmcli)配置网络
15 0
|
15天前
|
网络协议 Linux 网络安全
centos7下最简单的 unison实现文件双向同步图文详解
centos7下最简单的 unison实现文件双向同步图文详解
12 0
|
1月前
|
运维 Linux 应用服务中间件
Centos7如何配置firewalld防火墙规则
Centos7如何配置firewalld防火墙规则
47 0
|
1月前
|
存储 监控 Linux
Flume【部署 02】Flume监控工具Ganglia的安装与配置(CentOS 7.5 在线安装系统监控工具Ganglia + 权限问题处理 + Flume接入监控配置 + 图例说明)
【2月更文挑战第17天】Flume【部署 02】Flume监控工具Ganglia的安装与配置(CentOS 7.5 在线安装系统监控工具Ganglia + 权限问题处理 + Flume接入监控配置 + 图例说明)
28 1
Flume【部署 02】Flume监控工具Ganglia的安装与配置(CentOS 7.5 在线安装系统监控工具Ganglia + 权限问题处理 + Flume接入监控配置 + 图例说明)
|
2月前
|
Ubuntu Linux 网络安全