Есть Freebsd12.2 Stable, поднят jail с graylog (elasticsearch) - все работает.
Пока база elasticsearch была не большая устраивало что она в клетке.
Решил вынести каталог /var/db/elasticsearch за клетку и смонтировать в клетку.
Для jail использую ezjail.
Примонnировал так:
Код: Выделить всё
/path_to/jail1/elasticsearch /usr/jails/jail1/var/db/elasticsearch nullfs rw 0 0
Код: Выделить всё
[2021-08-20T13:18:55,680][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [node-1] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to obtain node locks, tried [[/var/db/elasticsearch]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.8.16.jar:6.8.16]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.8.16.jar:6.8.16]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[elasticsearch-6.8.16.jar:6.8.16]
Caused by: java.lang.IllegalStateException: failed to obtain node locks, tried [[/var/db/elasticsearch]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:300) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.node.Node.<init>(Node.java:296) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.node.Node.<init>(Node.java:266) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:212) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.8.16.jar:6.8.16]
... 6 more
Caused by: java.io.IOException: failed to obtain lock on /var/db/elasticsearch/nodes/0
at org.elasticsearch.env.NodeEnvironment$NodeLock.<init>(NodeEnvironment.java:218) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:270) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.node.Node.<init>(Node.java:296) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.node.Node.<init>(Node.java:266) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:212) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.8.16.jar:6.8.16]
... 6 more
Caused by: java.io.IOException: Mount point not found in fstab
at sun.nio.fs.BsdFileStore.findMountEntry(BsdFileStore.java:78) ~[?:?]
at sun.nio.fs.UnixFileStore.<init>(UnixFileStore.java:65) ~[?:?]
at sun.nio.fs.BsdFileStore.<init>(BsdFileStore.java:40) ~[?:?]
at sun.nio.fs.BsdFileSystemProvider.getFileStore(BsdFileSystemProvider.java:55) ~[?:?]
at sun.nio.fs.BsdFileSystemProvider.getFileStore(BsdFileSystemProvider.java:39) ~[?:?]
at sun.nio.fs.UnixFileSystemProvider.getFileStore(UnixFileSystemProvider.java:368) ~[?:?]
at java.nio.file.Files.getFileStore(Files.java:1461) ~[?:1.8.0_302]
at org.elasticsearch.env.Environment.getFileStore(Environment.java:323) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.env.NodeEnvironment$NodePath.<init>(NodeEnvironment.java:110) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.env.NodeEnvironment$NodeLock.<init>(NodeEnvironment.java:212) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:270) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.node.Node.<init>(Node.java:296) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.node.Node.<init>(Node.java:266) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:212) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.8.16.jar:6.8.16]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.8.16.jar:6.8.16]
Переношу базу назад в клетку - все работает.
Как правильно подмонтировать базу elasticsearch в клетку ?