gpt4 book ai didi

django - 将django-elasticsearch-dsl与AWS ElasticSearch结合使用-引发HTTP_EXCEPTIONS.get(status_code,TransportError)

转载 作者:行者123 更新时间:2023-12-02 23:49:55 26 4
gpt4 key购买 nike

我正在尝试使用django-elasticsearch-dsl和Elasticsearch服务器将Django应用程序转换为使用ElsaticBeanStalk部署的AWS ElasticSearch

当我使用

03_elasticsearch:   
command: "source /opt/python/run/venv/bin/activate && ./src/manage.py search_index --rebuild -f"

我得到这个错误
Creating index 'hjsm-local'
Traceback (most recent call last):
File "./src/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/opt/python/run/venv/local/lib64/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/opt/python/run/venv/local/lib64/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/python/run/venv/local/lib64/python3.6/site-packages/django/core/management/base.py", line 316, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/python/run/venv/local/lib64/python3.6/site-packages/django/core/management/base.py", line 353, in execute
output = self.handle(*args, **options)
File "/opt/python/run/venv/local/lib/python3.6/site-packages/django_elasticsearch_dsl/management/commands/search_index.py", line 134, in handle
self._rebuild(models, options)
File "/opt/python/run/venv/local/lib/python3.6/site-packages/django_elasticsearch_dsl/management/commands/search_index.py", line 114, in _rebuild
self._create(models, options)
File "/opt/python/run/venv/local/lib/python3.6/site-packages/django_elasticsearch_dsl/management/commands/search_index.py", line 84, in _create
index.create()
File "/opt/python/run/venv/local/lib/python3.6/site-packages/elasticsearch_dsl/index.py", line 102, in create
self.connection.indices.create(index=self._name, body=self.to_dict(), **kwargs)
File "/opt/python/run/venv/local/lib/python3.6/site-packages/elasticsearch/client/utils.py", line 69, in _wrapped
return func(*args, params=params, **kwargs)
File "/opt/python/run/venv/local/lib/python3.6/site-packages/elasticsearch/client/indices.py", line 110, in create
params=params, body=body)
File "/opt/python/run/venv/local/lib/python3.6/site-packages/elasticsearch/transport.py", line 327, in perform_request
status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout)
File "/opt/python/run/venv/local/lib/python3.6/site-packages/elasticsearch/connection/http_urllib3.py", line 110, in perform_request
self._raise_error(response.status, raw_data)
File "/opt/python/run/venv/local/lib/python3.6/site-packages/elasticsearch/connection/base.py", line 114, in _raise_error
raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)
elasticsearch.exceptions.TransportError: <exception str() failed>
(ElasticBeanstalk::ExternalInvocationError)

我不明白这是在说什么-有人可以建议吗?

更新

我认为我收到HTTP 406错误,但是我不明白为什么。如果我使用localhost:9200而不是aws eleasticsearch服务器在本地运行,则可以正常运行。

最佳答案

问题是它需要ElasticSearch 2.4。我必须在运行此服务器的情况下设置服务器,并且在通过它进行连接时可以正常工作!

关于django - 将django-elasticsearch-dsl与AWS ElasticSearch结合使用-引发HTTP_EXCEPTIONS.get(status_code,TransportError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58390719/

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