首先先了解一下官网中提到的如何backup your elasticsearch
https://www.elastic.co/guide/en/elasticsearch/guide/current/backing-up-your-cluster.html
知识点
1.关于repository的几种类型。
(来自官网)To use this functionality, you must first create a repository to save data. There are several repository types that you may choose from:
repositoryMetaDataList = clusterAdminClient.prepareGetRepositories(defaultRepositoryName).get().repositories();
System.out.println(repositoryMetaDataList.size());
}
Exception in thread "main" RepositoryVerificationException[[hippo_Repository] [VMYox38PS9qXN3hYhf588Q, 'RemoteTransportException[[node-hippo3][10.12.198.242:9300][internal:admin/repository/verify]]; nested: RepositoryVerificationException[[hippo_Repository] a file written by master to the store [/opt/hippo/snapshot/E:\snapshot] cannot be accessed on the node [{node-hippo3}{VMYox38PS9qXN3hYhf588Q}{10.12.198.242}{10.12.198.242:9300}{master=true}]. This might indicate that the store [/opt/hippo/snapshot/E:\snapshot] is not shared between this node and the master node or that permissions on the store don't allow reading files written by the master node];'], [EZQYXYKcTtuDCgjr17_M6g, 'RemoteTransportException[[node-hippo1][10.12.198.240:9300][internal:admin/repository/verify]]; nested: RepositoryVerificationException[[hippo_Repository] a file written by master to the store [/opt/hippo/snapshot/E:\snapshot] cannot be accessed on the node [{node-hippo1}{EZQYXYKcTtuDCgjr17_M6g}{10.12.198.240}{10.12.198.240:9300}{master=false}]. This might indicate that the store [/opt/hippo/snapshot/E:\snapshot] is not shared between this node and the master node or that permissions on the store don't allow reading files written by the master node];']]]
at org.elasticsearch.repositories.RepositoriesService$VerifyingRegisterRepositoryListener$1.onResponse(RepositoriesService.java:440)
......
一开始我以为,这个repositoryPath应该是绝对路径,从报错看到设置的应该是相对路径(开头不能是/,直接输入文件夹名字就好了),那么绝对的文件夹位置在哪里设置的,google了一下,发现在elasticsearch.yml中有个变量path.repo,恍然大悟。。。