The elasticseach version is 6.2.2. Today I encountered an error when trying to create a snapshot after restoring data. Can anyone please provide any advices?
The test steps are as below,
Start an elasticsearch instance, and attach a volume to /usr/share/elasticsearch/data;
Generate some log data;
Create a repository using the following command successfully;
2018-07-31T09:39:25,272][WARN ][o.e.s.SnapshotsService ] [t-hprrzcjx5s27dyucxyux-es-b9f74b99f-h6xwp-default] failed to create snapshot [snap_2/eBS31A1mSFG1Ffu8FQmgRw]
org.elasticsearch.snapshots.SnapshotCreationException: [ben_backup:snap_2/eBS31A1mSFG1Ffu8FQmgRw] failed to create snapshot
at org.elasticsearch.repositories.blobstore.BlobStoreRepository.initializeSnapshot(BlobStoreRepository.java:335) ~[elasticsearch-6.2.2.jar:6.2.2]
at org.elasticsearch.snapshots.SnapshotsService.beginSnapshot(SnapshotsService.java:364) ~[elasticsearch-6.2.2.jar:6.2.2]
at org.elasticsearch.snapshots.SnapshotsService.access$700(SnapshotsService.java:105) ~[elasticsearch-6.2.2.jar:6.2.2]
at org.elasticsearch.snapshots.SnapshotsService$1.lambda$clusterStateProcessed$1(SnapshotsService.java:282) ~[elasticsearch-6.2.2.jar:6.2.2]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:573) [elasticsearch-6.2.2.jar:6.2.2]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_161]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_161]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161]
Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data/backup/indices/Rd6MzRfdTiOOg6N0UIEdwg/meta-eBS31A1mSFG1Ffu8FQmgRw.dat
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:?]
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214) ~[?:?]
at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:434) ~[?:1.8.0_161]
at java.nio.file.Files.newOutputStream(Files.java:216) ~[?:1.8.0_161]
at org.elasticsearch.common.blobstore.fs.FsBlobContainer.writeBlob(FsBlobContainer.java:130) ~[elasticsearch-6.2.2.jar:6.2.2]
at org.elasticsearch.repositories.blobstore.ChecksumBlobStoreFormat.writeBlob(ChecksumBlobStoreFormat.java:191) ~[elasticsearch-6.2.2.jar:6.2.2]
at org.elasticsearch.repositories.blobstore.ChecksumBlobStoreFormat.write(ChecksumBlobStoreFormat.java:161) ~[elasticsearch-6.2.2.jar:6.2.2]
at org.elasticsearch.repositories.blobstore.BlobStoreRepository.initializeSnapshot(BlobStoreRepository.java:332) ~[elasticsearch-6.2.2.jar:6.2.2]
... 7 more
[2018-07-31T09:39:25,280][WARN ][r.suppressed ] path: /_snapshot/ben_backup/snap_2, params: {repository=ben_backup, snapshot=snap_2}
org.elasticsearch.snapshots.SnapshotCreationException: [ben_backup:snap_2/eBS31A1mSFG1Ffu8FQmgRw] failed to create snapshot
at org.elasticsearch.repositories.blobstore.BlobStoreRepository.initializeSnapshot(BlobStoreRepository.java:335) ~[elasticsearch-6.2.2.jar:6.2.2]
at org.elasticsearch.snapshots.SnapshotsService.beginSnapshot(SnapshotsService.java:364) ~[elasticsearch-6.2.2.jar:6.2.2]
at org.elasticsearch.snapshots.SnapshotsService.access$700(SnapshotsService.java:105) ~[elasticsearch-6.2.2.jar:6.2.2]
at org.elasticsearch.snapshots.SnapshotsService$1.lambda$clusterStateProcessed$1(SnapshotsService.java:282) ~[elasticsearch-6.2.2.jar:6.2.2]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:573) ~[elasticsearch-6.2.2.jar:6.2.2]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_161]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_161]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161]
Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data/backup/indices/Rd6MzRfdTiOOg6N0UIEdwg/meta-eBS31A1mSFG1Ffu8FQmgRw.dat
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:?]
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214) ~[?:?]
at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:434) ~[?:1.8.0_161]
at java.nio.file.Files.newOutputStream(Files.java:216) ~[?:1.8.0_161]
at org.elasticsearch.common.blobstore.fs.FsBlobContainer.writeBlob(FsBlobContainer.java:130) ~[elasticsearch-6.2.2.jar:6.2.2]
at org.elasticsearch.repositories.blobstore.ChecksumBlobStoreFormat.writeBlob(ChecksumBlobStoreFormat.java:191) ~[elasticsearch-6.2.2.jar:6.2.2]
at org.elasticsearch.repositories.blobstore.ChecksumBlobStoreFormat.write(ChecksumBlobStoreFormat.java:161) ~[elasticsearch-6.2.2.jar:6.2.2]
at org.elasticsearch.repositories.blobstore.BlobStoreRepository.initializeSnapshot(BlobStoreRepository.java:332) ~[elasticsearch-6.2.2.jar:6.2.2]
... 7 more
I changed the permission of the fs from 755 to 777, and it worked. I don't understand why I could create the snapshot successfully in the first time, but failed in the second elasticsearch instance.
each node have access wirte and read data with elasticsearch user ?
can write and read ?
test by create file and write file change file or delete file.
Previously the mod of the shared volume was 755, and it could be read/written by the first elasticsearch instance with elasticsearch user.
But it could only be ready by the second elasticsearch instance with user elasticsearch, and couldn't be written. After changing the mod to 777, then it worked. So it's a little confusing why it could be written by the first one, but couldn't by the second.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.