【故障集合】综合架构rsync服务与nfs服务错误集合(持续补充中)

一、rsync服务

1.1 not a regular file 不是普通文件

scp跟cp类型,默认只能复制普通文件
复制目录,加上-r参数即可

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

1.2 command not found 命令找不到

远程服务器没有rsync这个命令,rsync这个命令是默认安装的,检查如果没有,yum install -y rsync 安装即可

[root@backup ~]# rsync -av /etc 172.16.1.31:/tmp
root@172.16.1.31's password: 
bash: rsync: command not found
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: remote command not found (code 127) at io.c(226) [sender=3.1.2]

1.3 Connection refused 连接拒绝

1>检查是否能ping通对应服务器。
2>检查对应服务器的rsync服务是否启动,如果没有,启动即可。

 [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]

1.4 Unknown module 'backup'

未知模块“backup”
1>模块写错了,与rsync配置文件中配置的模块不一致,修改一致即可
2>书写的

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

1.5 auth failed on module data 验证模块数据失败

1>密码写错
2>rsync服务/etc/rsyncd.conf配置文件中用户连接认证密码文件不存在,添加即可
3>密码文件的权限不对,修改600即可

[root@nfs01 ~]# rsync -avz /etc/hostname 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]
[root@nfs01 ~]# 

1.6 password file must not be other-accessible

[root@web01 ~]# rsync -avz /etc/hostname rsync_backup@172.16.1.41::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]
[root@web01 ~]# 

1.7 Connection reset by peer

[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]

1.8 chdir failed

备份服务上的/backup目录不存在,去服务端创建并修改所有者和所有属组即可

[root@web01 /]# rsync -az /backup  rsync_backup@172.16.1.41::backup --password-file /etc/rsync.password
@ERROR: chdir failed
rsync error: error starting client-server protocol (code 5) at main.c(1648) [sender=3.1.2]

1.9 authentication failed 身份验证失败(发送邮件)

在/etc/mail.rc中配置可以使用外部SMTP服务器的配置时,配置错误,重新修改正确即可

[root@backup ~]# mail -s "dddddd" xinxiangyu_wwj@163.com  </backup/172.16.1.7/web01.md5
[root@backup ~]# smtp-server: 535 Error: authentication failed
"/root/dead.letter" 12/473
. . . message not sent.

1.10 The --password-file option may only be used when accessing an rsync daemon

--password文件选项只能在访问rsync守护进程时使用
推送的格式书写错误::,修改即可

[root@web01 ~]# sh /server/scripts/client_rsync_backup.sh
tar: Removing leading `/' from member names
The --password-file option may only be used when accessing an rsync daemon.
rsync error: syntax or usage error (code 1) at main.c(1382) [sender=3.1.2]
[root@web01 ~]# 

1.11 auth failed on module backup 模块认证错误

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

@ERROR: auth failed on module backup
rsync error: error starting client-server protocol (code 5) at main.c(1648) [sender=3.1.2]

二、NFS服务

2.1 Program not registered 程序未注册

服务端的nfs服务未重启,重启即可

[root@web01 ~]# showmount -e 10.0.0.31
clnt_create: RPC: Program not registered
[root@web01 ~]# 

2.2 can't find /data/r in /etc/fstab

挂载的时候,mount -t 后面一定要指定文件系统类型

[root@web01 ~]# mount -t 172.16.1.31:/app/r /data/r
mount: can't find /data/r in /etc/fstab

2.3 Read-only file system 只读文件系统

只能查看,不能写入

[root@web01 ~]# touch /data/r/aa.txt
touch: cannot touch ‘/data/r/aa.txt’: Read-only file system

2.4 mount point /data/w does not exist

原因1:需要挂载的目录不存在,创建即可
原因2:共享的目录不能自己挂载自己

[root@backup ~]# mount -t nfs 172.16.1.31:/app/w /data/w
mount.nfs: mount point /data/w does not exist

[root@nfs01 ~]# mount -t nfs 172.16.1.31:/nfs /nfs
mount.nfs: mount point /nfs does not exist

2.5 Device or resource busy

资源设备正在使用中,不能删除,即已挂载
要删除目录,先umount卸载,再删除即可

[root@backup ~]# rm -rf /data/r
rm: cannot remove ‘/data/r’: Device or resource busy
[root@backup ~]# 

2.6 access denied by server while mounting 挂载时服务端拒绝访问

原因:服务端共享目录自己挂载了自己
解决:卸载服务端的挂载,但服务端卸载报Device or resource busy的错,导致服务端无法卸载,这时用umount的-lt(强制卸载)或先将配置的共享目录注释掉,然后systemctl reload nfs之后,再用umount卸载;服务端卸载之后,客户端就可以正常挂载

[root@web01 ~]# mount -t nfs 172.16.1.31:/nfs /nfs/
mount.nfs: access denied by server while mounting 172.16.1.31:/nfs

2.7 not mounted 未挂载

因为/data/r这个目录并没有挂载信息,估卸载时报错

[root@backup ~]# umount /data/r
umount: /data/r: not mounted

2.8 Stale file handle 文件句柄错误

df -h 查询并没有nfs的挂载信息,但是grep /nfs /proc/mounts显示已经挂载
解决:umount -lf强制卸载即可

[root@web01 ~]# cp /bin/ls  /nfs
cp: failed to access ‘/nfs’: Stale file handle
[root@web01 ~]# cp /bin/ls  /nfs/
cp: failed to access ‘/nfs/’: Stale file handle
[root@web01 ~]# cd /nfs/
-bash: cd: /nfs/: Stale file handle

2.9 an incorrect mount option was specified 不正确的挂载参数

指定了1个错误的挂载参数,修改正确即可

[root@backup ~]# mount -o rsize=131072,wsize-131072,suid,exec 172.16.1.31:/app/r /data/r
mount.nfs: an incorrect mount option was specified
[root@backup ~]# 

[root@backup ~]# mount -o rsize=131072,wsize=131072,suid,exec 172.16.1.31:/app/r /data/r
[root@backup ~]# 

2.10 wrong fs type 错误的文件系统类型

nfs文件系统无法识别
因为没有安装nfs-utils,安装即可

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

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

2.11 Connection refused 连接拒绝

[root@web01 ~]# showmount -e 172.16.1.31 
clnt_create: RPC: Port mapper failure - Unable to receive: errno 111 (Connection refused)

三、批量管理

3.1 no action detected in task

[root@m01 ~]# ansible-playbook -C /server/ansible-playbook/nfs-deploy.yml
ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.

The error appears to be in '/server/ansible-playbook/nfs-deploy.yml': line 57, column 9, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


      - name: mount /upload
        ^ here

[root@m01 ~]# 

3.1 There was an issue creating /upload as requested 根据要求创建是出错

playbook 创建目录时报错

TASK [make /upload] ******************************************************************************************************************
fatal: [172.16.1.7]: FAILED! => {"changed": false, "msg": "There was an issue creating /upload as requested: [Errno 17] File exists: '/upload'", "path": "/upload"}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念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

推荐阅读更多精彩内容