问题一:/etc/cron.d下的定时任务执行一段时间后不执行
背景:在/etc/cron.d下加了一个定时任务,名为dispute_cron(使用root用户编辑),内容:
28 15 * * * hdfs /home/hdfs/xxx/work/disputefile/bin/rundispute.sh
使用hdfs用户每日定时执行该脚本rundispute.sh,执行一段时间后不执行了。
排查:1.看crond日志是否调起来,vim /var/log/cron 看日志在对应的时间点上相应的定时任务并没有被调起来。
2.切换到hdfs,执行crontab–e,报错:
鉴定令牌不再有效;需要新的鉴定令牌
You (hive) are not allowed to access to (crontab) because of pam configuration.
脚本是hdfs执行的,这表示hdfs密码过期了,执行chage–l hdfs,显示:
Last password change: Sep 25, 2016
Password expires: Dec 24, 2016 --过期时间
Password inactive: never
Account expires: never
Minimum number of days between password change: 0
Maximum number of days between password change: 90
Number of days of warning before password expires: 7
2016.12.24号之后该调度脚本就不能被h