这两天solr总是出现死锁问题,日志大量报错,后来得知删除日志中出现的文件即可解决此问题,故楼主写了一个,解决问题
#!/bin/bash
b=`date +%H:%M`c=`date +%H:%M -d "-10 min"`e=`date +%Y-%m-%d`d=`echo ${c[@]:0:4}`a=`ssh 192.168.0.140 "cat /www/backserver/logs/job-all.log|grep $e|grep $d|grep "write.lock$"|awk -F "SimpleFSLock@" '{print "'$2'"}'|awk '{++a["'$0'"]}END{for ( i in a ) print i,a[i]}'|awk '{print $1}'"`for i in $adossh 192.168.0.12 "mv $i /tmp/solrerror"ssh 192.168.0.41 "mv $i /tmp/solrerror"echo ok#/usr/local/resin/bin/resin.sh restart -server solrsh /www/shell/syslog.sh `hostname`-solr-error-移走$i `hostname` 1 2 1doneecho $a