amazon-web-services - 在AWS上托管Elasticsearch:{“error” :“You need to sign in or sign up before continuing.”}

标签 amazon-web-services elasticsearch npm deployment localhost

我正在尝试在AWS服务器上托管Elasticsearch应用程序。为此,我正在使用Elastic Enterprise Search。我将API连接器配置如下:

const connector = new AppSearchAPIConnector({
  searchKey: "search-gs7t3micqu41z1dsou1ccz95",
  engineName: "sentence-similarity",
  endpointBase: "http://ec2-18-159-135-25.eu-central-1.compute.amazonaws.com:3002"
});
该应用程序本身在端口3000的npm下运行。我在AWS Security Group中启用了两个端口。
在启动Elastic Search和Enterprise Search之后,在npm start之后,我还可以连接到http://ec2-18-159-135-25.eu-central-1.compute.amazonaws.com:3000,这样可以正常工作。但是,一旦通过应用程序进行API调用,就会出现以下错误:

POST http://ec2-18-159-135-25.eu-central-1.compute.amazonaws.com:3002/api/as/v1/engines/sentence-similarity/search.json net::ERR_CONNECTION_REFUSED


此外,当我在控制台中键入curl http://localhost:3002/api/as/v1/engines/sentence-similarity/search.json时,出现以下错误:

{"error":"You need to sign in or sign up before continuing."}


因此,我认为与Elasticsearch的连接存在问题。当我在本地计算机上托管应用程序时,我从未遇到此问题。
我的想法,如何解决问题:
  • 我必须在AWS上重新安装Elastic Search和Enterprise Search
    服务器。可能是身份验证出现问题,并且
    我无法连接到我的Elasticsearch引擎。
  • 我可以配置两个.yml文件,一个用于Elastic Search,一个用于Enterprise Search。当我不在本地计算机上托管应用程序时,可能必须调整这些设置。

  • 无论如何,我都是部署的初学者,我需要一些帮助以获取详细信息。提前非常感谢您!
    编辑:
    经过更多研究后,我相信我已经确定了问题所在。好像在AWS服务器上,已经建立了某种新的Elastic Enterprise实例。这意味着尚未配置引擎,这就是API调用失败的原因。如何连接到现有引擎,而不必创建新引擎?

    最佳答案

    好吧,我还没有使用过AWS Elastic搜索,但是我可以给出一些建议,请查看以下URL,
    https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-vpc.html#kibana-test
    https://www.youtube.com/watch?v=mWRo_JVgP_0
    还可以考虑检查安全组。

    关于amazon-web-services - 在AWS上托管Elasticsearch:{“error” :“You need to sign in or sign up before continuing.”},我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64106199/

    相关文章:

    linux - AWS Ubuntu 14.04/etc/rc.local 不工作?

    amazon-web-services - AWS 上的 Kubernetes 仪表板 tls 证书

    ruby-on-rails - 使用 Fog AWS S3 和 Rails 时出现负过期

    mongodb - 如何在mongoDB中使用bulkupdate这样的方式在Elasticsearch中更新数据?

    elasticsearch - 如何通过使用NEST包在字段级别创建索引

    git - Jenkins 的 npm install 无法安装托管在 bitbucket 上的模块

    networking - Cloudera Hadoop 在 EC2 上使用 Vagrant - 如何设置主机、IP 和网络?

    elasticsearch - ElasticSearch如何与一个嵌套查询

    javascript - 我如何 bower 安装 Raphael.js?

    javascript - 如何导入使用 NPM 安装的字体?