2017-09-14 66 views
1

我的本地Linux机器上安装了elasticsearch 2.3。 我有Amazon S3存储:我知道区域,bucketname,accesskey和secretkey。将elasticsearch快照存储在amazon s3存储库中。它是如何工作的

我想在S3存储中创建elasticsearch索引的快照。有关于它的文档here,但它不能解释我什么(我是全新的)。

因此,举例来说,我试图执行此命令:

curl -XPUT 'localhost:9200/_snapshot/my_s3_repository?pretty' -H 'Content-Type: application/json' -d '{"type": "s3", 
"settings": {"bucket": "ilyabackuptest1", "region": "us-east-1" }}' 

而且我得到回应:

{ 
    "error" : { 
    "root_cause" : [ { 
     "type" : "repository_exception", 
     "reason" : "[my_s3_repository] failed to create repository" 
    } ], 
    "type" : "repository_exception", 
    "reason" : "[my_s3_repository] failed to create repository", 
    "caused_by" : { 
     "type" : "illegal_argument_exception", 
     "reason" : "Unknown [repository] type [s3]" 
    } 
    }, 
    "status" : 500 
} 

那么它是怎样工作的?

更新: 安装repository-s3后,我使用相同的命令,并得到它。它应该如何工作?

{ 
    "error" : { 
    "root_cause" : [ { 
     "type" : "process_cluster_event_timeout_exception", 
     "reason" : "failed to process cluster event (put_repository [my_s3_repository]) within 30s" 
    } ], 
    "type" : "process_cluster_event_timeout_exception", 
    "reason" : "failed to process cluster event (put_repository [my_s3_repository]) within 30s" 
    }, 
    "status" : 503 
} 

回答

1

你只需要安装S3 repository plugin第一:

bin/plugin install repository-s3 

然后,你可以再次运行命令来创建S3回购。

+0

bin中没有elasticsearch-plugin文件,所以这个命令不能执行。我怎样才能安装这个插件? –

+0

我已更新我的回答 – Val

+0

这对我也不适用。 bin/plugin:没有这样的文件或目录 –