【综合架构故障集合】

  • 故障索引

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 directories getcwd 无法定位到当前目录
13.failed to create pid file /var/run/rsyncd.pid: File exists Rsync 服务器启动错误
14.auth failed on module backup 身份验证模块备份失败
NFS网络文件系统:
1.access denied by server 权限拒绝
2.Program not registered 检查挂载信息失败没有注册
3.wrong fs type 错误的文件系统类型
4.Read-only file system 文件只读

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

13.failed to create pid file /var/run/rsyncd.pid: File exists

Rsync 服务器启动错误

[13:25 root@backup ~]# rsync --daemon
[13:28 root@backup ~]# failed to create pid file /var/run/rsyncd.pid: File exists

解决方案:
rm -rf /var/run/rsyncd.pid;再重新启动Rsync服务(rsync --daemon)

[13:28 root@backup ~]# rm -rf /var/run/rsyncd.pid 
[13:29 root@backup ~]# rsync --daemon
[13:30 root@backup ~]# netstat -lutup|grep rsync
tcp        0      0 0.0.0.0:rsync           0.0.0.0:*               LISTEN      8585/rsync          
tcp6       0      0 [::]:rsync              [::]:*                  LISTEN      8585/rsync       

14.auth failed on module backup 身份验证模块备份失败

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

查看服务端和客户端的密码文件的权限是否为600
查看密码是否正确

还有一个深坑就是密码中有没有空格,把空格删除掉就可以了

image

二、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

4.Read-only file system文件只读

在NFS服务挂载的/mnt/目录创建文件

[09:33 root@nfs01 /]# df -h
172.16.1.31:/data   19G  1.7G   18G   9% /opt
[09:33 root@nfs01 /]# touch /opt/1.txt
touch: cannot touch ‘/opt/1.txt’: Read-only file system

解决:/etc/exports的权限是只读访问

[09:33 root@nfs01 /]# vim /etc/exports
#share /data
/data           172.16.1.0/24(ro,sync,all_squash)
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 217,084评论 6 503
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,623评论 3 392
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 163,450评论 0 353
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,322评论 1 293
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,370评论 6 390
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,274评论 1 300
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,126评论 3 418
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,980评论 0 275
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,414评论 1 313
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,599评论 3 334
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,773评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,470评论 5 344
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,080评论 3 327
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,713评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,852评论 1 269
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,865评论 2 370
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,689评论 2 354

推荐阅读更多精彩内容