使用sunspot时,执行命令rake sunspot:solr:reindex重建索引,报出异常如下:
Error - RSolr::Error::Http - 500 Internal Server Error - retrying...
Error - RSolr::Error::Http - 500 Internal Server Error - ignoring...
Error - RSolr::Error::Http - 500 Internal Server Error - retrying...
Error - RSolr::Error::Http - 500 Internal Server Error - ignoring...
原因是因为运行中的Solr实例太多
解决方法:
查找运行中的solr
ps -ef | grep solr
然后kill掉这些进程
删除文件
rm -rf solr/data/development/index
重启Solr
rake sunspot:solr:stop
rake sunspot:solr:start
之后再执行rake sunspot:solr:reindex重建索引,no problem.