在ubuntu机器中恢复弹性搜索快照时发生RepositoryException
当我们从弹性搜索的旧版本(1.0)升级到最新版本(4.0)时,我们需要将索引数据从旧版本备份到最新版本的备份。下面的例子也是如此在ubuntu机器中恢复弹性搜索快照时发生RepositoryException,ubuntu,permissions,
elasticsearch,repository,permission-denied,Ubuntu,Permissions,
elasticsearch,Repository,Permission Denied,当我们从弹性搜索的旧版本(1.0)升级到最新版本(4.0)时,我们需要将索引数据从旧版本备份到最新版本的备份。下面的例子也是如此 在elasticsearch windows计算机中拍摄数据快照 在elasticsearch ubuntu计算机中还原(注册)快照数据 面临着与此相同的例外情况。我用sudo检查了相同的命令。但这并没有成功。因此,请说明如何重置读/写设置/权限设置以允许创建文件夹 查询: curl -XPUT http://xx.xx.xx.xx:9200/_snapshot/es
sudo
检查了相同的命令。但这并没有成功。因此,请说明如何重置读/写设置/权限设置以允许创建文件夹
查询:
curl -XPUT http://xx.xx.xx.xx:9200/_snapshot/es_snap -d '{
"type": "fs",
"settings": {
"location": "/mount/backups/my_backup"
}
}'
答复:
{
"error":"RepositoryException[[es_snap] failed to create repository];
nested: CreationException[Guice creation errors:\n\n1) Error injecting constructor, org.elasticsearch.common.blobstore.BlobStoreException:
Failed to create directory at [
D:/data/es_snapshot_bkup/es_snapshot_repo
]\n
at org.elasticsearch.repositories.fs.FsRepository.<init>(Unknown Source)\n
while locating org.elasticsearch.repositories.fs.FsRepository\n
while locating org.elasticsearch.repositories.Repository\n\n1 error];
nested: BlobStoreException[Failed to create directory at [/mount/backups/my_backup]];",
"status":500
}
{
“错误”:“RepositoryException[[es_snap]未能创建存储库];
嵌套:CreationException[Guice创建错误:\n\n1)错误注入构造函数,org.elasticsearch.common.blobstore.blobstore异常:
无法在上创建目录[
D:/data/es\u snapshot\u bkup/es\u snapshot\u repo
]\n
位于org.elasticsearch.repositories.fs.FsRepository。(未知源)\n
查找org.elasticsearch.repositories.fs.FsRepository时\n
查找org.elasticsearch.repositories.Repository时\n\n1错误];
嵌套:BlobStoreException[未能在[/mount/backups/my_backup]]处创建目录];“,
“地位”:500
}
这对我很有用。请检查一下。
在执行恢复和备份操作之前,可以创建存储库
mkdir~/backup
chmod 777~/backup
curl-XPUThttp://xx.xx.xx.xx:9200/_snapshot/es_snap -d'{
“类型”:“fs”,
“设置”:{
“位置”:“/主/用户/备份”
}
}
curl-XPUT”http://xx.xx.xx.xx:9200/_snapshot/es_snap/snapshot_1“-d'{
“索引”:“索引1,索引2”,
“忽略不可用”:“真”,
}“
curl-XPOST”http://xx.xx.xx.xx:9200/_snapshot/es_snap/snapshot_1/_restore“