linux soft raid每周自动同步的问题

检查发现几台服务器都存在raid定期同步的问题,每次同步的时间都一样:

[root@qht114 log]# cat messages
Sep 20 04:03:04 qht114 syslogd 1.4.1: restart.
Sep 20 04:22:01 qht114 kernel: md: syncing RAID array md0
Sep 20 04:22:01 qht114 kernel: md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
Sep 20 04:22:01 qht114 kernel: md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reconstruction.
Sep 20 04:22:01 qht114 kernel: md: using 128k window, over a total of 104320 blocks.
Sep 20 04:22:01 qht114 kernel: md: delaying resync of md2 until md0 has finished resync (they share one or more physical units)
Sep 20 04:22:01 qht114 kernel: md: delaying resync of md3 until md0 has finished resync (they share one or more physical units)
Sep 20 04:22:01 qht114 kernel: md: delaying resync of md2 until md0 has finished resync (they share one or more physical units)
Sep 20 04:22:47 qht114 kernel: md: md0: sync done.
Sep 20 04:22:48 qht114 kernel: md: syncing RAID array md2
Sep 20 04:22:48 qht114 kernel: md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
Sep 20 04:22:48 qht114 kernel: md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reconstruction.
Sep 20 04:22:48 qht114 kernel: RAID1 conf printout:
Sep 20 04:22:48 qht114 kernel:  --- wd:2 rd:2
Sep 20 04:22:48 qht114 kernel:  disk 0, wo:0, o:1, dev:hda1
Sep 20 04:22:48 qht114 kernel: md: using 128k window, over a total of 4192896 blocks.
Sep 20 04:22:48 qht114 kernel:  disk 1, wo:0, o:1, dev:hdc1
Sep 20 04:22:48 qht114 kernel: md: delaying resync of md3 until md2 has finished resync (they share one or more physical units)
Sep 20 05:01:49 qht114 kernel: md: md2: sync done.
Sep 20 05:01:50 qht114 kernel: md: syncing RAID array md3
Sep 20 05:01:50 qht114 kernel: md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
Sep 20 05:01:50 qht114 kernel: md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reconstruction.
Sep 20 05:01:50 qht114 kernel: md: using 128k window, over a total of 610349376 blocks.
Sep 20 05:01:50 qht114 kernel: RAID1 conf printout:
Sep 20 05:01:50 qht114 kernel:  --- wd:2 rd:2
Sep 20 05:01:50 qht114 kernel:  disk 0, wo:0, o:1, dev:hda3
Sep 20 05:01:50 qht114 kernel:  disk 1, wo:0, o:1, dev:hdc3


[root@qht114 log]# vi messages.1
Sep 13 04:03:07 qht114 syslogd 1.4.1: restart.
Sep 13 04:22:01 qht114 kernel: md: syncing RAID array md0
Sep 13 04:22:01 qht114 kernel: md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
Sep 13 04:22:01 qht114 kernel: md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reconstruction.
Sep 13 04:22:01 qht114 kernel: md: using 128k window, over a total of 104320 blocks.
Sep 13 04:22:01 qht114 kernel: md: delaying resync of md2 until md0 has finished resync (they share one or more physical units)
Sep 13 04:22:01 qht114 kernel: md: delaying resync of md3 until md0 has finished resync (they share one or more physical units)
Sep 13 04:22:01 qht114 kernel: md: delaying resync of md2 until md0 has finished resync (they share one or more physical units)
Sep 13 04:22:47 qht114 kernel: md: md0: sync done.
Sep 13 04:22:48 qht114 kernel: RAID1 conf printout:
Sep 13 04:22:48 qht114 kernel: md: delaying resync of md3 until md2 has finished resync (they share one or more physical units)
Sep 13 04:22:48 qht114 kernel: md: syncing RAID array md2
Sep 13 04:22:48 qht114 kernel: md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
Sep 13 04:22:48 qht114 kernel: md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reconstruction.
Sep 13 04:22:48 qht114 kernel:  --- wd:2 rd:2
Sep 13 04:22:48 qht114 kernel: md: using 128k window, over a total of 4192896 blocks.
Sep 13 04:22:48 qht114 kernel:  disk 0, wo:0, o:1, dev:hda1
Sep 13 04:22:48 qht114 kernel:  disk 1, wo:0, o:1, dev:hdc1
Sep 13 05:01:47 qht114 kernel: md: md2: sync done.
Sep 13 05:01:48 qht114 kernel: md: syncing RAID array md3
Sep 13 05:01:48 qht114 kernel: RAID1 conf printout:
Sep 13 05:01:48 qht114 kernel: md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
Sep 13 05:01:48 qht114 kernel: md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reconstruction.
Sep 13 05:01:48 qht114 kernel:  --- wd:2 rd:2
Sep 13 05:01:48 qht114 kernel: md: using 128k window, over a total of 610349376 blocks.
Sep 13 05:01:48 qht114 kernel:  disk 0, wo:0, o:1, dev:hda3
Sep 13 05:01:48 qht114 kernel:  disk 1, wo:0, o:1, dev:hdc3
Sep 17 21:07:00 qht114 kernel: md: md3: sync done.
Sep 17 21:07:00 qht114 kernel: RAID1 conf printout:
Sep 17 21:07:00 qht114 kernel:  --- wd:2 rd:2
Sep 17 21:07:00 qht114 kernel:  disk 0, wo:0, o:1, dev:hda5
Sep 17 21:07:00 qht114 kernel:  disk 1, wo:0, o:1, dev:hdc5
Sep 18 20:20:01 qht114 auditd[2537]: Audit daemon rotating log files

syslog也是每周restart一次,这个是在logrotate控制的,这个和raid定期执行没有任何关系。

logrotate相关的介绍如下:

https://www.linuxidc.com/Linux/2019-02/157099.htm

 

raid定期同步是哪里定义的?

[root@qht113 etc]# crontab -l

crontab -l里面没有相关的命令,查看其它系统定义的定期任务:

[root@qht113 ~]# ls /etc/cron*
/etc/cron.deny  /etc/crontab

/etc/cron.d:
dmeventd-logwatch  mrtg  sysstat

/etc/cron.daily:
0anacron   cups       makewhatis.cron  prelink  tmpwatch
0logwatch  logrotate  mlocate.cron     rpm

/etc/cron.hourly:
mcelog.cron

/etc/cron.monthly:
0anacron

/etc/cron.weekly:
0anacron  99-raid-check  makewhatis.cron

/etc/cron.weekly/99-raid-check就是我要找的定期脚本。

看一下具体执行的时间:

[root@qht113 init.d]# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

每周的周日4点22分开始执行,和/var/log/message记录的时间点吻合。

所以不需要每周同步一次,将/etc/cron.weekly/99-raid-check移到/etc/cron.montyly每月同步一次。

最后重启下cron服务:

[root@qht113 log]# mv /etc/cron.weekly/99-raid-check /etc/cron.monthly/
[root@qht113 log]# /etc/init.d/crond restart
Stopping crond:                                            [  OK  ]
Starting crond:                                            [  OK  ]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值