2013-05-30 133 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 

請記住, 如果您正在使用自動縮放,這將導致混亂