{ "error":{ "root_cause":[ { "type":"repository_verification_exception", "reason":"[my_s3_repository] path [/] is not accessible on master node" } ], "type":"repository_verification_exception", "reason":"[my_s3_repository] path [/] is not accessible on master node", "caused_by":{ "type":"i_o_exception", "reason":"Unable to upload object [//tests-sXkmh3q5ThCCIX2VJp609g/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 }
{ "error":{ "root_cause":[ { "type":"repository_verification_exception", "reason":"[my_s3_repositor1] path is not accessible on master node" } ], "type":"repository_verification_exception", "reason":"[my_s3_repositor1] path is not accessible on master node", "caused_by":{ "type":"i_o_exception", "reason":"Unable to upload object [tests-sUUzs-mTSZeYw1qk372DkQ/master.dat] using a single upload", "caused_by":{ "type":"sdk_client_exception", "reason":"The requested metadata is not found at http://169.254.169.254/latest/meta-data/iam/security-credentials/" } } }, "status":500 }
报错 2:索引已存在,无法恢复
1 2 3 4 5 6 7 8 9 10 11 12 13
{ "error":{ "root_cause":[ { "type":"snapshot_restore_exception", "reason":"[my_s3_repository:1/9gIDCgSySwKzQqEYvaGM_w] cannot restore index [my_index] because an open index with same name already exists in the cluster. Either close or delete the existing index or restore the index under a different name by providing a rename pattern and replacement name" } ], "type":"snapshot_restore_exception", "reason":"[my_s3_repository:1/9gIDCgSySwKzQqEYvaGM_w] cannot restore index [my_index] because an open index with same name already exists in the cluster. Either close or delete the existing index or restore the index under a different name by providing a rename pattern and replacement name" }, "status":500 }
解决方案:
删除现有索引后恢复:
1
DELETE /my_index
关闭索引后恢复:
1
POST /my_index/_close
恢复为新的索引名称:
1 2 3 4 5 6
POST _snapshot/my_s3_repository/1/_restore { "indices":"my_index", "rename_pattern":"my_index", "rename_replacement":"restored_my_index" }
报错 3:权限错误
1 2 3 4 5 6 7 8 9 10 11 12 13
{ "error":{ "root_cause":[ { "type":"security_exception", "reason":"no permissions for [] and User [name=admin, external_roles=[admin]]" } ], "type":"security_exception", "reason":"no permissions for [] and User [name=admin, external_roles=[admin]]" }, "status":403 }
解决方案:
确保用户有 manage_snapshots 角色权限。
排除 .security 索引或全局状态,否则无法恢复。
1 2 3 4 5 6
POST _snapshot/my_s3_repositor1/snapshot_002/_restore { "indices": "-.security", "ignore_unavailable": true, "include_global_state": false }