linux crond.d定時調度執行一段時間後不執行

問題一:/etc/cron.d下的定時任務執行一段時間後不執行html

背景:在/etc/cron.d下加了一個定時任務,名爲dispute_cron(使用root用戶編輯),內容:java

28 15 * * * hdfs /home/hdfs/xxx/work/disputefile/bin/rundispute.shsql

使用hdfs用戶每日定時執行該腳本rundispute.sh,執行一段時間後不執行了。apache

排查:1.看crond日誌是否調起來,vim /var/log/cron 看日誌在對應的時間點上相應的定時任務並無被調起來。vim

      2.切換到hdfs,執行crontab–e,報錯:oop

       鑑定令牌再也不有效;須要新的鑑定令牌優化

You (hive) are not allowed to access to (crontab) because of pam configuration.spa

  腳本是hdfs執行的,這表示hdfs密碼過時了,執行chage–l hdfs,顯示:.net

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號以後該調度腳本就不能被hdfs用戶調起了。

      或vim /var/log/secure看密碼過時提醒,若要過時會有提醒如:

      ***********************

      3.設置用戶密碼永不過時,腳本便可被調用。

      chage -M -1hdfs

參考文章:http://blog.itpub.net/29392174/viewspace-1063866/

          http://www.th7.cn/system/lin/201602/153915.shtml

 

日誌不全,仍是改換成hdfs用戶在crontab–e中加了下面內容:

28 15 * * *  cd /home/hdfs/xxx/work/disputefile/bin; ./rundispute.sh >> ../logs/run.log 2>&1

能夠進入cd /var/spool/cron/看每一個用戶配置的定時任務。

問題二:HIVE JDBC查詢報錯return code-101

java.sql.SQLException:Errorwhileprocessingstatement:FAILED:ExecutionError,returncode-101fromorg.apache.hadoop.hive.ql.exec.mr.MapRedTask.Java heap space.

……..

Caused by: java.lang.OutOfMemoryError: Java heap space

重啓hiveserver2堆內存釋放OK,不能解決根本問題:須要增長hivesever2堆內存或者優化查詢,優化查詢根據具體狀況具體分析,能夠調整hivesever2堆內存使其不溢出,以下(hortonworks平臺):