Hi,大家好,这两天假期在折腾solr,在mac上本机测试OK后,准备发布到服务器上去,无奈碰到问题了,折腾一个上午还是无果,分别重新安装过tomcat版本的和jetty版本,后来发现可以直接用gem sunspot
。
情况是这样的
-
bundle exec rake sunspot:solr:start
和bundle exec rake sunspot:solr:stop
都正常,也可以看到x.x.x.x:8983/solr
的界面,admin也有 -
bundle exec rake sunspot:solr:reindex
,索引一操作就报错,connection refused.
我的 sunspot.yml是这样的
production:
solr:
hostname: localhost
port: 8983
log_level: WARNING
path: /solr/default
# read_timeout: 2
# open_timeout: 0.5
development:
solr:
hostname: localhost
port: 8982
log_level: INFO
path: /solr/development
test:
solr:
hostname: localhost
port: 8981
log_level: WARNING
path: /solr/test
Gemifle
gem 'sunspot_rails'
gem 'progress_bar'
gem 'sunspot_solr'
updated:
发现 sunspot.yml不起作用,reindex的时候仍然在调用localhost:8080而不是localhost:8983