gpt4 book ai didi

amazon-web-services - 无法将S3存储库注册到AWS Elasticsearch

转载 作者:行者123 更新时间:2023-12-03 01:41:24 24 4
gpt4 key购买 nike

我在将存储库注册到AWS Elasticsearch 时遇到问题。
这是我用来执行此操作的链接:

http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains-snapshots.html#es-managedomains-snapshot-registerdirectory

如链接中所述,我复制了以下代码并运行了它:

from boto.connection import AWSAuthConnection

类ESConnection(AWSAuthConnection):
def __init__(self, region, **kwargs):
super(ESConnection, self).__init__(**kwargs)
self._set_auth_region_name(region)
self._set_auth_service_name("es")

def _required_auth_capability(self):
return ['hmac-v4']

if __name__ == "__main__":

client = ESConnection(
region='us-east-1',
host='search-weblogs-etrt4mbbu254nsfupy6oiytuz4.us-east-1.es.example.com',
aws_access_key_id='my-access-key-id',
aws_secret_access_key='my-access-key', is_secure=False)

print 'Registering Snapshot Repository'
resp = client.make_request(method='POST',
path='/_snapshot/weblogs-index-backups',
data='{"type": "s3","settings": { "bucket": "es-index-backups","region": "us-east-1","role_arn": "arn:aws:iam::123456789012:role/TheServiceRole"}}')
body = resp.read()
print body

我还修改了安全性和帐户ID和...。
当我运行它时,出现以下错误:
Traceback (most recent call last):
File "C:/Users/hminaee/Documents/bni-tj-cm-Copy-Sep/test-image-repo.py",
line 24, in <module>
data='{"type": "s3","settings": { "bucket": "mybucket","region": "us-
east-1","role_arn": "arn:aws:s3:::mybucket"}}')
File "C:\Users\xxx\AppData\Local\Programs\Python\Python36\lib\site-
packages\boto\connection.py", line 1071, in make_request
retry_handler=retry_handler)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python36\lib\site-
packages\boto\connection.py", line 1030, in _mexe
raise ex
File "C:\Users\xxx\AppData\Local\Programs\Python\Python36\lib\site-
packages\boto\connection.py", line 943, in _mexe
request.body, request.headers)
File
"C:\Users\xxx\AppData\Local\Programs\Python\Python36\lib\http\client.py",
line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File
"C:\Users\xxx\AppData\Local\Programs\Python\Python36\lib\http\client.py",
line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File
"C:\Users\xxx\AppData\Local\Programs\Python\Python36\lib\http\client.py",
line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File
"C:\Users\xxx\AppData\Local\Programs\Python\Python36\lib\http\client.py",
line 1026, in _send_output
self.send(msg)
File
"C:\Users\xxx\AppData\Local\Programs\Python\Python36\lib\http\client.py",
line 964, in send
self.connect()
File
"C:\Users\xxx\AppData\Local\Programs\Python\Python36\lib\http\client.py",
line 936, in connect
(self.host,self.port), self.timeout, self.source_address)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python36\lib\socket.py",
line
704, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "C:\Users\xxx\AppData\Local\Programs\Python\Python36\lib\socket.py",
line
743, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11004] getaddrinfo failed

我怎么了有没有更好的教程或方法可以做到这一点?

最佳答案

search-weblogs-etrt4mbbu254nsfupy6oiytuz4.us-east-1.es.example.com不存在。它包含example.com。那个是从哪里来的?您应该使用实际的搜索域。

关于amazon-web-services - 无法将S3存储库注册到AWS Elasticsearch ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47233830/

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