2013-05-30 132 views
3

我想在Elastic Beanstalk上运行SOLR服务器。但是我在网络上找不到那么多。Elastic Beanstalk上的SOLR

它必须是可能的,因为有些人已经在使用它。 (https://forums.aws.amazon.com/thread.jspa?threadID=91276即)

任何想法我怎么能做到这一点?

好吧,不知何故,我可以上传solr warfile到环境中,但后来变得复杂。 我在哪里放置配置文件和索引目录,以便每个实例都可以达到它?

+0

这有什么好运气? –

回答

2

编辑:请记住,这个答案是从2013年。这里提到的产品可能已经演变。我已更新文档链接以反映solr集群wiki中的更改。我鼓励你在阅读这些信息后继续你的研究。

原文: 如果您打算只使用单个服务器部署,那么在beanstalk实例上运行solr才有意义。一旦你想扩展你的应用程序,你将需要配置你的豆杆环境来创建一个solr cluster或移动到CloudSearch之类的东西。如果您不熟悉ec2生命周期和solr部署,那么CloudSearch几乎可以节省您的时间(读钱)。

如果你想在单个实例上运行Solr的,那么你可以使用rake通过添加一个文件到您的名为.ebextensions/solr.config具有以下内容的本地回购启动它:

container_commands: 
    01create_post_dir: 
    command: "mkdir -p /opt/elasticbeanstalk/hooks/appdeploy/post" 
    ignoreErrors: true 
    02killjava: 
    command: "killall java" 
    test: "ps uax | grep java | grep root" 
    ignoreErrors: true 

files: 
    "/opt/elasticbeanstalk/hooks/appdeploy/post/99_start_solr.sh": 
    mode: "755" 
    owner: "root" 
    group: "root" 
    content: | 
     #!/usr/bin/env bash 
     . /opt/elasticbeanstalk/support/envvars 
     cd $EB_CONFIG_APP_CURRENT 
     su -c "RAILS_ENV=production bundle exec rake sunspot:solr:start" $EB_CONFIG_APP_USER 
     su -c "RAILS_ENV=production bundle exec rake db:seed" $EB_CONFIG_APP_USER 
     su -c "RAILS_ENV=production bundle exec rake sunspot:reindex" $EB_CONFIG_APP_USER 

请记住, 如果您正在使用自动缩放,这将导致混乱