gpt4 book ai didi

Elastic Beanstalk 上的 SOLR

转载 作者:行者123 更新时间:2023-12-02 02:01:54 25 4
gpt4 key购买 nike

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

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

有什么想法可以做到吗?

好吧,我可以通过某种方式将 solr warfile 上传到环境中,但这样就变得复杂了。我应该将配置文件和索引目录放在哪里,以便每个实例都可以访问它?

最佳答案

编辑:请记住,这个答案来自 2013 年。这里提到的产品可能已经进化。我更新了文档链接以反射(reflect) solr 集群 wiki 中的更改。我鼓励您在阅读此信息后继续您的研究。

原创:如果您计划只使用单个服务器部署,那么在 beantalk 实例上运行 solr 才真正有意义。在您想要扩展您的应用程序的那一刻,您将需要配置您的 beantalk 环境以创建一个 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

请记住,如果您使用自动缩放,这会导致困惑

关于Elastic Beanstalk 上的 SOLR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16835375/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com