哟嘿,还是错??? 访问etc/esconf/esins1/elasticsearch.yml被阻止了???想起来了,这个文件是在root用户下创建配置的。修改一下用户组吧: chown -R water:water /etc/esconf/esins1。再来一次。。。
1 [water@CloudGame bin]$ ./elasticsearch -d -Des.path.conf=/etc/esconf/esins1 -p /etc/esconf/esins1.pid 2 [water@CloudGame bin]$ Exception in thread "main" SettingsException[Failed to open stream for url [/etc/esconf/esins1/elasticsearch.yml]]; nested: AccessDeniedException[/etc/esconf/esins1/elasticsearch.yml]; 3 Likely root cause: java.nio.file.AccessDeniedException: /etc/esconf/esins1/elasticsearch.yml 4 at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) 5 at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) 6 at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) 7 at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214) 8 at java.nio.file.Files.newByteChannel(Files.java:317) 9 at java.nio.file.Files.newByteChannel(Files.java:363) 10 at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:380) 11 at java.nio.file.Files.newInputStream(Files.java:108) 12 at org.elasticsearch.common.settings.Settings$Builder.loadFromPath(Settings.java:1067) 13 at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:88) 14 at org.elasticsearch.bootstrap.Bootstrap.initialSettings(Bootstrap.java:202) 15 at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:241) 16 at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35) 17 Refer to the log for complete error details.
怎么还是一样的错啊,去看看日志吧,靠,/home/AppData/es/esins1/logs下面什么也没有啊???????倒,这个目录也是在root权限下创建的,water没有写的权限。。。。。。再给这数据和日志目录改属组。。。。。
1 [root@CloudGame es]# ll 2 total 8 3 drwxr-xr-x. 4 root root 4096 Oct 18 11:20 esins1 4 drwxr-xr-x. 4 root root 4096 Oct 18 11:21 esins2 5 [root@CloudGame es]# chown -R water:water * 6 [root@CloudGame es]# ll 7 total 8 8 drwxr-xr-x. 4 water water 4096 Oct 18 11:20 esins1 9 drwxr-xr-x. 4 water water 4096 Oct 18 11:21 esins2 10 [root@CloudGame es]# cd esins1/ 11 [root@CloudGame esins1]# ll 12 total 8 13 drwxr-xr-x. 2 water water 4096 Oct 18 11:20 data 14 drwxr-xr-x. 2 water water 4096 Oct 18 11:49 logs
再来启动一次,应该可以了吧。。。。