I run elasticsearch docker container as described in quickstart Quick start | Elasticsearch Guide [7.17] | Elastic,
then I installed repository-s3
plugin and restarted container.
I have a local minio server act as S3 storage. But I am not able to registry a S3 repository in Elasticsearch. The error msg said "reason" : "Failed to connect to service endpoint: "
, but it does not indicate what service endpoint
it connected to.
[root@st2-tunnel-dev1]# docker exec -it es01-test /bin/bash
root@03caafc38d92:/usr/share/elasticsearch# bin/elasticsearch-keystore add s3.client.default.access_key
Enter value for s3.client.default.access_key:
root@03caafc38d92:/usr/share/elasticsearch# bin/elasticsearch-keystore add s3.client.default.secret_key
Enter value for s3.client.default.secret_key:
root@03caafc38d92:/usr/share/elasticsearch# curl -X PUT "http://localhost:9200/_snapshot/my_s3_repo?pretty" -H 'Content-Type: application/json' -d'
> {
> "type": "s3",
> "settings": {
> "endpoint": "http://<my-minio-ip>:9000",
> "protocol": "http",
> "region": "eu-central-1",
> "bucket": "elastic-o1-726938",
> "base_path": "/usr/share/elasticsearch/data/nodes/0",
> "client": "default",
> "path_style_access": "true"
> }
> }'
{
"error" : {
"root_cause" : [
{
"type" : "repository_verification_exception",
"reason" : "[my_s3_repo] path [/usr/share/elasticsearch/data/nodes/0] is not accessible on master node"
}
],
"type" : "repository_verification_exception",
"reason" : "[my_s3_repo] path [/usr/share/elasticsearch/data/nodes/0] is not accessible on master node",
"caused_by" : {
"type" : "i_o_exception",
"reason" : "Unable to upload object [/usr/share/elasticsearch/data/nodes/0/tests-e8hrHXQyQiOIgHh0sypi5w/master.dat] using a single upload",
"caused_by" : {
"type" : "sdk_client_exception",
"reason" : "Failed to connect to service endpoint: ",
"caused_by" : {
"type" : "socket_timeout_exception",
"reason" : "Connect timed out"
}
}
}
},
"status" : 500
}
I also tried to adjust endpoint format, then I got error like this
root@03caafc38d92:/usr/share/elasticsearch# curl -X PUT "http://localhost:9200/_snapshot/my_s3_repo?pretty" -H 'Content-Type: application/json' -d'
{
"type": "s3",
"settings": {
"endpoint": "<my-minio-ip>:9000",
"protocol": "http",
"region": "eu-central-1",
"bucket": "elastic-o1-726938",
"base_path": "/usr/share/elasticsearch/data/nodes/0",
"client": "default",
"path_style_access": "true"
}
}'
{
"error" : {
"root_cause" : [
{
"type" : "repository_exception",
"reason" : "[my_s3_repo] Could not determine repository generation from root blobs"
}
],
"type" : "repository_exception",
"reason" : "[my_s3_repo] Could not determine repository generation from root blobs",
"caused_by" : {
"type" : "i_o_exception",
"reason" : "Exception when listing blobs by prefix [index-]",
"caused_by" : {
"type" : "sdk_client_exception",
"reason" : "Failed to connect to service endpoint: ",
"caused_by" : {
"type" : "socket_timeout_exception",
"reason" : "Connect timed out"
}
}
}
},
"status" : 500
}
but I can access to my minio server via curl
in this container.
root@03caafc38d92:/usr/share/elasticsearch# curl -k -H 'Host: <my-minio-ip>:9000' -H 'Date: Wed, 29 May 2024 04:58:50 +0000' -H 'Content-Type: application/zstd' -H 'Authorization: AWS minioadmin:18Hr3bux0qN+JM6wxWiKdctEc0k=' http://<my-minio-ip>:9000/
<?xml version="1.0" encoding="UTF-8"?>
<ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Owner><ID>02d6176db174dc93cb1b899f7c6078f08654445fe8cf1b6ce98d8855f66bdbf4</ID><DisplayName>minio</DisplayName></Owner><Buckets><Bucket><Name>elastic-o1-726938</Name><CreationDate>2024-04-18T05:48:23.891Z</CreationDate></Bucket><Bucket><Name>my-bucket-longterm</Name><CreationDate>2024-04-26T03:03:08.535Z</CreationDate></Bucket><Bucket><Name>mybucket</Name><CreationDate>2024-04-11T10:22:01.282Z</CreationDate></Bucket><Bucket><Name>oadp-o1-726938</Name><CreationDate>2024-04-12T08:39:08.429Z</CreationDate></Bucket><Bucket><Name>rawspanbucket</Name><CreationDate>2024-05-08T05:09:58.909Z</CreationDate></Bucket><Bucket><Name>test-bucket</Name><CreationDate>2024-04-23T04:33:19.262Z</CreationDate></Bucket><Bucket><Name>test-store</Name><CreationDate>2024-04-03T01:27:13.698Z</CreationDate></Bucket><Bucket><Name>veleco-hgliu</Name><CreationDate>2024-04-12T01:54:10.483Z</CreationDate></Bucket><Bucket><Name>veleco-o1-726938</Name><CreationDate>2024-04-12T01:50:04.447Z</CreationDate></Bucket></Buckets></ListAllMyBucketsResult>root@03caafc38d92:/usr/share/elasticsearch#
root@03caafc38d92:/usr/share/elasticsearch#
if I remove base_path
from payload, I got similar error path is not accessible on master node
and it also not indicate what path
is.
root@03caafc38d92:/usr/share/elasticsearch# curl -X PUT "http://localhost:9200/_snapshot/my_s3_repo2?pretty" -H 'Content-Type: application/json' -d'
> {
> "type": "s3",
> "settings": {
> "endpoint": "9.112.252.135:9000",
> "protocol": "http",
> "region": "eu-central-1",
> "bucket": "elastic-o1-726938",
> "client": "default",
> "path_style_access": "true"
> }
> }'
{
"error" : {
"root_cause" : [
{
"type" : "repository_verification_exception",
"reason" : "[my_s3_repo2] path is not accessible on master node"
}
],
"type" : "repository_verification_exception",
"reason" : "[my_s3_repo2] path is not accessible on master node",
"caused_by" : {
"type" : "i_o_exception",
"reason" : "Unable to upload object [tests-GacOt_JST22bgxGuIZuCBQ/master.dat] using a single upload",
"caused_by" : {
"type" : "sdk_client_exception",
"reason" : "Failed to connect to service endpoint: ",
"caused_by" : {
"type" : "socket_timeout_exception",
"reason" : "Connect timed out"
}
}
}
},
"status" : 500
}