【集群架构中的故障集合】

  • 故障索引

Rsync同步备份故障:
1.not a regular file不是普通的文件
2.cannot delete non-empty directory无法删除非空目录
3.Connection refused连接拒绝
4.auth failed on module data auth模块数据失败
5.Unknown module ‘data’未知的模块的数据
6.secrets file must be owned by root when running as root秘密文件
7.read error: Connection reset by peer (104)读取错误:由对等方重置连接
8.password file must not be other-accessible密码文件不能是其他可访问的
9.denied on module data from UNKNOWN未知模块’数据’
10.chdir failed失败
11.invalid uid rsync无效的用户 rsync
12.getcwd: cannot directoriesgetcwd 无法定位到当前目录
NFS网络文件系统:
1.access denied by server权限拒绝
2.Program not registered检查挂载信息失败没有注册
3.wrong fs type错误的文件系统类型

1. not a regular file 不是普通的文件

scp默认只能复制普通文件 与cp类似
scp加一个 -r 参数就好了

[12:37 root@backup ~]# scp /etc 172.16.1.31:nfs01/tmp/
root@172.16.1.31's password: 
/etc: not a regular file

2.cannot delete non-empty directory 无法删除非空目录

symlink: 软链接 导致报错,可能已经备份过了

[12:39 root@backup ~]# rsync -av /etc 172.16.1.31:/tmp/
root@172.16.1.31's password: 
sending incremental file list
cannot delete non-empty directory: etc/init.d
could not make way for new symlink: etc/init.d
cannot delete non-empty directory: etc/rc0.d
could not make way for new symlink: etc/rc0.d
.....
..

3.Connection refused 连接拒绝

检查是否能ping通对应服务器

[12:41 root@backup ~]# rsync -avz /etc 176.16.1.31:/tmp
ssh: connect to host 176.16.1.31 port 22: Connection refused
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.2]

4.auth failed on module data

data模块认证错误(密码)

原因:
1.密码写错
2.密码文件不存在
3.密码文件权限不对
4.没有创建data这个目录

[root 16:15 @ backup ~]# rsync -avz /etc/hosts rsync_backup@172.16.1.41::data
Password: 
@ERROR: auth failed on module data
rsync error: error starting client-server protocol (code 5) at main.c(1648) [sender=3.1.2]
原因:密码文件权限没有更改为600
[root 16:25 @ backup ~]# ll /etc/rsync.password 
-rw-r--r-- 1 root root 20 May 20 16:05 /etc/rsync.password

解决办法:更改文件权限位600
[root 16:25 @ backup ~]# chmod 600  /etc/rsync.password 
[root 16:25 @ backup ~]# ll /etc/rsync.password 
-rw------- 1 root root 20 May 20 16:05 /etc/rsync.password

5.Unknown module ‘data’ 未知的设备模块

没有权限

[17:45 root@nfs01 ~]# rsync -avz /etc/hostname rsync_backup@10.0.0.41::data --password-file=/etc/rsync.password
@ERROR: Unknown module 'data'
rsync error: error starting client-server protocol (code 5) at main.c(1648) [sender=3.1.2]

服务端查看rsyncd.conf ,准许哪些主机可以访问

hosts allow = 172.16.1.0/24
#hosts deny = 0.0.0.0/32

6.秘密文件

日志中
密码文件问题
查看日志的提示:

019/05/20 16:52:32 [15755] secrets file must be owned by root when running as root (see strict modes)
2019/05/20 16:52:32 [15755] auth failed on module data from backup (172.16.1.41) for rsync_backup: ignoring secrets file
 secrets file must be owned by root when running as root (see strict modes)

密码文件当root运行rsync的时候,必须属于root

[root@backup ~]# ll /etc/rsync.password 
-rw------- 1 rsync rsync 20 May 20 16:49 /etc/rsync.password

7.read错误:由对等方重置连接

配置文件错误

[root@backup ~]# rsync -avz /etc/hosts rsync_backup@172.16.1.41::data
sending incremental file list
rsync: read error: Connection reset by peer (104)
rsync error: error in socket IO (code 10) at io.c(785) [sender=3.1.2]

8.密码文件不能是其他可访问的

rsync -avz /etc/sysconfig/ rsync_backup@172.16.1.91::backup --password-file=/etc/rsync.password  
ERROR: password file must not be other-accessible
rsync error: syntax or usage error (code 1) at authenticate.c(196) [sender=3.1.2]

9.未知模块’数据’

@ERROR:未知模块’数据’

2019/05/20 17:45:46 [10514] rsync denied on module data from UNKNOWN (10.0.0.31)

10.@ERROR: chdir failed

没有创建data备份这个目录

[20:35 root@backup ~]# rsync -avz /etc/hosts rsync_backup@172.16.1.41::data
Password: 
@ERROR: chdir failed
rsync error: error starting client-server protocol (code 5) at main.c(1648) [sender=3.1.2

解决办法:

[20:35 root@backup ~]# mkdir -p /data
[20:38 root@backup ~]# chown rsync.rsync /data/
[20:39 root@backup ~]# ll -d /data/
drwxr-xr-x 2 rsync rsync 6 May 20 20:38 /data/
[20:39 root@backup ~]# rsync -avz /etc/hosts rsync_backup@172.16.1.41::data
Password: 
sending incremental file list
hosts

sent 140 bytes  received 43 bytes  52.29 bytes/sec
total size is 158  speedup is 0.86

11.invalid uid rsync 无效的uid rsync

推送到的接收端可能没有rsync这个虚拟用户

[09:40 root@nfs01 ~]# rsync -avz /etc/profile rsync_backup@172.16.1.41::data --password-file=/etc/rsync.password 
@ERROR: invalid uid rsync
rsync error: error starting client-server protocol (code 5) at main.c(1648) [sender=3.1.2]

去接收端服务器看一下:

[09:41 root@backup ~]# id rsync
id: rsync: no such user   \\没有这个用户

12.getcwd: cannot directories

getcwd 命令无法定位到当前工作目录。一般来说是因为 cd 到了某个目录之后 rm 了这个目录,这时去执行某些 service 脚本的时候就会报 getcwd 错误。只需要 cd 到任何一个实际存在的目录下在执行命令即可。

[root@nfs01 /backup/172.16.1.31]# sh /tmp/rsync.sh 
shellinit: error retrieving current directory: getcwd: cannot directories: No such file or directory
/usr/bin/tar: Removing leading `/' from member names

#二、nfs

1.权限拒绝

/etc/exports中指定的网段是172.16.1.31,这里是10.0.0.7外网段

[16:43 root@web01 ~]# mount -t nfs 10.0.0.7:/upload/ /video/
mount.nfs: access denied by server while mounting 10.0.0.7:/upload/

2.检查挂在信息失败

[16:51 root@nfs01 ~]# showmount -e 172.16.1.31
clnt_create: RPC: Program not registered

解决:nfs服务重启一下

[16:51 root@nfs01 ~]# systemctl restart nfs
[16:52 root@nfs01 ~]# showmount -e 172.16.1.31
Export list for 172.16.1.31:
/upload 172.16.1.0/24

3.wrong fs type

错误的文件系统类型 nfs文件系统无法识别
没有安装nfs-utils

[16:51 root@nfs01 ~]# mount -t nfs 172.16.1.31:/data /mnt/
mount: wrong fs type, bad option, bad superblock on 172.16.1.31:/data,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值