I have to load ElasticSearch plugins with the offline instructions but it looks like I am getting a permissions error even when I open up permissions to the files completely and running as root! I've removed and reinstalled as well but this error is consistent.
[root#ip-10-94-146-130 bin]# ./plugin install file:///home/jmblnvr/shield/license-2.1.0.zip
-> Installing from file:/home/jmblnvr/shield/license-2.1.0.zip...
Trying file:/home/jmblnvr/shield/license-2.1.0.zip ...
Downloading .DONE
Verifying file:/home/jmblnvr/shield/license-2.1.0.zip checksums if available ...
NOTE: Unable to verify checksum for downloaded plugin (unable to find .sha1 or .md5 file to verify)
Installed license into /usr/share/elasticsearch/plugins/license
[root#ip-10-94-146-130 bin]# service elasticsearch restart
Stopping elasticsearch: [FAILED]
Starting elasticsearch: Exception in thread "main" java.lang.IllegalStateException: Unable to initialize plugins
Likely root cause: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/plugins/license/plugin-descriptor.properties
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.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
at org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:86)
at org.elasticsearch.plugins.PluginsService.getPluginBundles(PluginsService.java:302)
at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:108)
at org.elasticsearch.node.Node.<init>(Node.java:148)
at org.elasticsearch.node.Node.<init>(Node.java:129)
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:145)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.
[FAILED]
From /var/log:
[root#ip-10-94-146-130 elasticsearch]# cat elasticsearch.log
[2015-12-15 11:44:24,525][INFO ][node ] [Valtorr] stopping ...
[2015-12-15 11:44:24,639][INFO ][node ] [Valtorr] stopped
[2015-12-15 11:44:24,641][INFO ][node ] [Valtorr] closing ...
[2015-12-15 11:44:24,647][INFO ][node ] [Valtorr] closed
[2015-12-15 11:44:26,097][WARN ][bootstrap ] unable to install syscall filter: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed
[2015-12-15 11:44:26,314][INFO ][node ] [Agon] version[2.1.0], pid[21703], build[72cd1f1/2015-11-18T22:40:03Z]
[2015-12-15 11:44:26,314][INFO ][node ] [Agon] initializing ...
[2015-12-15 11:44:26,318][ERROR][bootstrap ] Exception
java.lang.IllegalStateException: Unable to initialize plugins
at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:111)
at org.elasticsearch.node.Node.<init>(Node.java:148)
at org.elasticsearch.node.Node.<init>(Node.java:129)
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:145)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/plugins/license/plugin-descriptor.properties
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.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
at org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:86)
at org.elasticsearch.plugins.PluginsService.getPluginBundles(PluginsService.java:302)
at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:108)
... 6 more
I was having the same sort of exception but after installing and while loading x-pack plugin on Elasticsearch 5.2.1:
Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/plugins/x-pack/plugin-descriptor.properties
In my case, I started by adding elasticsearch user to the root group:
usermod -aG root elasticsearch
Afterwards, it was only necessary to modify the ownership of the plugins folder:
chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/plugins/
Thanks to Val, simple solution is after installing plugins you need to quickly change ownership/groups if you are using the RPM install of Elastic:
chown -R root:elasticsearch /usr/share/elasticsearch
Related
My elasticsearch index were working from past year and suddenly I got this error:
java.lang.IllegalStateException: Unable to access 'path.data' (/var/data/lib/elasticsearch)
at org.elasticsearch.bootstrap.Security.addPath(Security.java:316)
at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:256)
at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:212)
at org.elasticsearch.bootstrap.Security.configure(Security.java:118)
at org.elasticsearch.bootstrap.Bootstrap.setupSecurity(Bootstrap.java:212)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:183)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:286)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:45)
Caused by: java.nio.file.AccessDeniedException: /var/data/lib
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.checkAccess(UnixFileSystemProvider.java:308)
at java.nio.file.Files.createDirectories(Files.java:746)
at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:337)
at org.elasticsearch.bootstrap.Security.addPath(Security.java:314)
... 7 more
I haven't changed any file permissions. They were working fine till now.
cd /var/data/lib/elasticsearch
drwxr-xr-x 3 elasticsearch elasticsearch 4096 Nov 19 2020 elasticsearch
Did this happen to anyone? I stopped my Elasticsearch, and now I am not able to start it. Any help is appreciated.
This is the response of logstash -f logstash.conf. I don't know what to do.
Using JAVA_HOME defined java: C:\Program Files\Java\jdk-17.0.2
WARNING, using JAVA_HOME while Logstash distribution comes with a
bundled JDK 2022-02-09T18:48:30.825+03:30 [main] WARN FilenoUtil :
Native subprocess control requires open access to the JDK IO subsystem
Pass '--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens
java.base/java.io=ALL-UNNAMED' to enable. Sending Logstash logs to
C:/logstash-7.12.0/logs which is now configured via log4j2.properties
[2022-02-09T18:48:44,793][INFO ][logstash.runner ] Log4j
configuration path used is:
C:\logstash-7.12.0\config\log4j2.properties
[2022-02-09T18:48:44,800][INFO ][logstash.runner ] Starting
Logstash {"logstash.version"=>"7.12.0", "jruby.version"=>"jruby
9.2.13.0 (2.5.7) 2020-08-03 9a89c94bcc Java HotSpot(TM) 64-Bit Server VM 17.0.2+8-LTS-86 on 17.0.2+8-LTS-86 +indy +jit [mswin32-x86_64]"}
[2022-02-09T18:48:44,879][WARN ][logstash.config.source.multilocal]
Ignoring the 'pipelines.yml' file because modules or command line
options are specified [2022-02-09T18:48:45,593][INFO ][logstash.agent
] Successfully started Logstash API endpoint {:port=>9600}
[2022-02-09T18:48:46,107][INFO ][org.reflections.Reflections]
Reflections took ۲۲ ms to scan ۱ urls, producing ۲۳ keys and ۴۷ values
[2022-02-09T18:48:46,484][ERROR][logstash.plugins.registry] Tried to
load a plugin's code, but failed. {:exception=>#<LoadError: Could not
load FFI Provider: (NotImplementedError) FFI not available:
java.lang.UnsatisfiedLinkError: could not locate stub library in jar
file. Tried [jni/x86_64-Windows/jffi-۱.۲.dll,
/jni/x86_64-Windows/jffi-۱.۲.dll]
at com.kenai.jffi.internal.StubLoader.getStubLibraryStream(StubLoader.java:450)
at com.kenai.jffi.internal.StubLoader.loadFromJar(StubLoader.java:375)
at com.kenai.jffi.internal.StubLoader.load(StubLoader.java:278)
at com.kenai.jffi.internal.StubLoader.(StubLoader.java:487)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:467)
at com.kenai.jffi.Init.load(Init.java:68)
at com.kenai.jffi.Foreign$InstanceHolder.getInstanceHolder(Foreign.java:49)
at com.kenai.jffi.Foreign$InstanceHolder.(Foreign.java:45)
at com.kenai.jffi.Foreign.getInstance(Foreign.java:103)
at com.kenai.jffi.Type$Builtin.lookupTypeInfo(Type.java:242)
at com.kenai.jffi.Type$Builtin.getTypeInfo(Type.java:237)
at com.kenai.jffi.Type.resolveSize(Type.java:155)
at com.kenai.jffi.Type.size(Type.java:138)
at jnr.ffi.provider.jffi.NativeRuntime$TypeDelegate.size(NativeRuntime.java:178)
at jnr.ffi.provider.AbstractRuntime.(AbstractRuntime.java:48)
at jnr.ffi.provider.jffi.NativeRuntime.(NativeRuntime.java:57)
at jnr.ffi.provider.jffi.NativeRuntime.(NativeRuntime.java:41)
at jnr.ffi.provider.jffi.NativeRuntime$SingletonHolder.(NativeRuntime.java:53)
at jnr.ffi.provider.jffi.NativeRuntime.getInstance(NativeRuntime.java:49)
at jnr.ffi.provider.jffi.Provider.(Provider.java:29)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128)
at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347)
at java.base/java.lang.Class.newInstance(Class.java:645)
at jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.getInstance(FFIProvider.java:68)
at jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.(FFIProvider.java:57)
at jnr.ffi.provider.FFIProvider.getSystemProvider(FFIProvider.java:35)
at jnr.ffi.Library.loadLibrary(Library.java:114)
at jnr.posix.POSIXFactory$DefaultLibCProvider$SingletonHolder.(POSIXFactory.java:289)
at jnr.posix.POSIXFactory$DefaultLibCProvider.getLibC(POSIXFactory.java:318)
at jnr.posix.BaseNativePOSIX.(BaseNativePOSIX.java:38)
at jnr.posix.WindowsPOSIX.(WindowsPOSIX.java:134)
at jnr.posix.POSIXFactory.loadWindowsPOSIX(POSIXFactory.java:173)
at jnr.posix.POSIXFactory.loadNativePOSIX(POSIXFactory.java:142)
at jnr.posix.POSIXFactory.loadPOSIX(POSIXFactory.java:93)
at jnr.posix.LazyPOSIX.loadPOSIX(LazyPOSIX.java:38)
at jnr.posix.LazyPOSIX.posix(LazyPOSIX.java:32)
at jnr.posix.LazyPOSIX.isNative(LazyPOSIX.java:402)
at org.jruby.util.io.FilenoUtil.(FilenoUtil.java:42)
at org.jruby.Ruby.(Ruby.java:294)
at org.jruby.Ruby.newInstance(Ruby.java:706)
at org.logstash.Logstash.(Logstash.java:162)
at org.logstash.Logstash.main(Logstash.java:69)
See http://jira.codehaus.org/browse/JRUBY-4583>,
:path=>"logstash/inputs/file", :type=>"input", :name=>"file"}
[2022-02-09T18:48:46,494][ERROR][logstash.agent ] Failed to
execute action
{:action=>LogStash::PipelineAction::Create/pipeline_id:main,
:exception=>"Java::JavaLang::IllegalStateException", :message=>"Unable
to configure plugins: (PluginLoadingError) Couldn't find any input
plugin named 'file'. Are you sure this is correct? Trying to load the
file input plugin resulted in this error: Could not load FFI Provider:
(NotImplementedError) FFI not available:
java.lang.UnsatisfiedLinkError: could not locate stub library in jar
file. Tried [jni/x86_64-Windows/jffi-۱.۲.dll,
/jni/x86_64-Windows/jffi-۱.۲.dll]\r\n\tat
com.kenai.jffi.internal.StubLoader.getStubLibraryStream(StubLoader.java:450)\r\n\tat
com.kenai.jffi.internal.StubLoader.loadFromJar(StubLoader.java:375)\r\n\tat
com.kenai.jffi.internal.StubLoader.load(StubLoader.java:278)\r\n\tat
com.kenai.jffi.internal.StubLoader.(StubLoader.java:487)\r\n\tat
java.base/java.lang.Class.forName0(Native Method)\r\n\tat
java.base/java.lang.Class.forName(Class.java:467)\r\n\tat
com.kenai.jffi.Init.load(Init.java:68)\r\n\tat
com.kenai.jffi.Foreign$InstanceHolder.getInstanceHolder(Foreign.java:49)\r\n\tat
com.kenai.jffi.Foreign$InstanceHolder.(Foreign.java:45)\r\n\tat
com.kenai.jffi.Foreign.getInstance(Foreign.java:103)\r\n\tat
com.kenai.jffi.Type$Builtin.lookupTypeInfo(Type.java:242)\r\n\tat
com.kenai.jffi.Type$Builtin.getTypeInfo(Type.java:237)\r\n\tat
com.kenai.jffi.Type.resolveSize(Type.java:155)\r\n\tat
com.kenai.jffi.Type.size(Type.java:138)\r\n\tat
jnr.ffi.provider.jffi.NativeRuntime$TypeDelegate.size(NativeRuntime.java:178)\r\n\tat
jnr.ffi.provider.AbstractRuntime.(AbstractRuntime.java:48)\r\n\tat
jnr.ffi.provider.jffi.NativeRuntime.(NativeRuntime.java:57)\r\n\tat
jnr.ffi.provider.jffi.NativeRuntime.(NativeRuntime.java:41)\r\n\tat
jnr.ffi.provider.jffi.NativeRuntime$SingletonHolder.(NativeRuntime.java:53)\r\n\tat
jnr.ffi.provider.jffi.NativeRuntime.getInstance(NativeRuntime.java:49)\r\n\tat
jnr.ffi.provider.jffi.Provider.(Provider.java:29)\r\n\tat
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)\r\n\tat
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)\r\n\tat
java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\r\n\tat
java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)\r\n\tat
java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128)\r\n\tat
java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347)\r\n\tat
java.base/java.lang.Class.newInstance(Class.java:645)\r\n\tat
jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.getInstance(FFIProvider.java:68)\r\n\tat
jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.(FFIProvider.java:57)\r\n\tat
jnr.ffi.provider.FFIProvider.getSystemProvider(FFIProvider.java:35)\r\n\tat
jnr.ffi.Library.loadLibrary(Library.java:114)\r\n\tat
jnr.posix.POSIXFactory$DefaultLibCProvider$SingletonHolder.(POSIXFactory.java:289)\r\n\tat
jnr.posix.POSIXFactory$DefaultLibCProvider.getLibC(POSIXFactory.java:318)\r\n\tat
jnr.posix.BaseNativePOSIX.(BaseNativePOSIX.java:38)\r\n\tat
jnr.posix.WindowsPOSIX.(WindowsPOSIX.java:134)\r\n\tat
jnr.posix.POSIXFactory.loadWindowsPOSIX(POSIXFactory.java:173)\r\n\tat
jnr.posix.POSIXFactory.loadNativePOSIX(POSIXFactory.java:142)\r\n\tat
jnr.posix.POSIXFactory.loadPOSIX(POSIXFactory.java:93)\r\n\tat
jnr.posix.LazyPOSIX.loadPOSIX(LazyPOSIX.java:38)\r\n\tat
jnr.posix.LazyPOSIX.posix(LazyPOSIX.java:32)\r\n\tat
jnr.posix.LazyPOSIX.isNative(LazyPOSIX.java:402)\r\n\tat
org.jruby.util.io.FilenoUtil.(FilenoUtil.java:42)\r\n\tat
org.jruby.Ruby.(Ruby.java:294)\r\n\tat
org.jruby.Ruby.newInstance(Ruby.java:706)\r\n\tat
org.logstash.Logstash.(Logstash.java:162)\r\n\tat
org.logstash.Logstash.main(Logstash.java:69)\r\n\n See
http://jira.codehaus.org/browse/JRUBY-4583",
:backtrace=>["org.logstash.config.ir.CompiledPipeline.(CompiledPipeline.java:119)",
"org.logstash.execution.JavaBasePipelineExt.initialize(JavaBasePipelineExt.java:83)",
"org.logstash.execution.JavaBasePipelineExt$INVOKER$i$1$0$initialize.call(JavaBasePipelineExt$INVOKER$i$1$0$initialize.gen)",
"org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:837)",
"org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuper(IRRuntimeHelpers.java:1169)",
"org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuperSplatArgs(IRRuntimeHelpers.java:1156)",
"org.jruby.ir.targets.InstanceSuperInvokeSite.invoke(InstanceSuperInvokeSite.java:39)",
"C_3a_.logstash_minus_7_dot_12_dot_0.logstash_minus_core.lib.logstash.java_pipeline.RUBY$method$initialize$0(C:/logstash-7.12.0/logstash-core/lib/logstash/java_pipeline.rb:47)",
"org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:80)",
"org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:70)",
"org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:332)",
"org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:86)",
"org.jruby.RubyClass.newInstance(RubyClass.java:939)",
"org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)",
"org.jruby.ir.targets.InvokeSite.invoke(InvokeSite.java:207)",
"C_3a_.logstash_minus_7_dot_12_dot_0.logstash_minus_core.lib.logstash.pipeline_action.create.RUBY$method$execute$0(C:/logstash-7.12.0/logstash-core/lib/logstash/pipeline_action/create.rb:52)",
"C_3a_.logstash_minus_7_dot_12_dot_0.logstash_minus_core.lib.logstash.pipeline_action.create.RUBY$method$execute$0$VARARGS(C:/logstash-7.12.0/logstash-core/lib/logstash/pipeline_action/create.rb)",
"org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:80)",
"org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:70)",
"org.jruby.ir.targets.InvokeSite.invoke(InvokeSite.java:207)",
"C_3a_.logstash_minus_7_dot_12_dot_0.logstash_minus_core.lib.logstash.agent.RUBY$block$converge_state$2(C:/logstash-7.12.0/logstash-core/lib/logstash/agent.rb:389)", "org.jruby.runtime.CompiledIRBlockBody.callDirect(CompiledIRBlockBody.java:138)",
"org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:58)",
"org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:52)",
"org.jruby.runtime.Block.call(Block.java:139)",
"org.jruby.RubyProc.call(RubyProc.java:318)",
"org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:105)",
"java.base/java.lang.Thread.run(Thread.java:833)"]} warning: thread
"Converge PipelineAction::Create" terminated with exception
(report_on_exception is true): LogStash::Error: Don't know how to
handle Java::JavaLang::IllegalStateException for
PipelineAction::Create<main>
create at org/logstash/execution/ConvergeResultExt.java:129
add at org/logstash/execution/ConvergeResultExt.java:57 converge_state at
C:/logstash-7.12.0/logstash-core/lib/logstash/agent.rb:402
[2022-02-09T18:48:46,509][ERROR][logstash.agent ] An
exception happened when converging configuration
{:exception=>LogStash::Error, :message=>"Don't know how to handle
Java::JavaLang::IllegalStateException for
PipelineAction::Create<main>"}
[2022-02-09T18:48:46,519][FATAL][logstash.runner ] An
unexpected error occurred! {:error=>#<LogStash::Error: Don't know how
to handle Java::JavaLang::IllegalStateException for
PipelineAction::Create<main>>,
:backtrace=>["org/logstash/execution/ConvergeResultExt.java:129:in
create'", "org/logstash/execution/ConvergeResultExt.java:57:in add'", "C:/logstash-7.12.0/logstash-core/lib/logstash/agent.rb:402:in
`block in converge_state'"]}
[2022-02-09T18:48:46,527][FATAL][org.logstash.Logstash ] Logstash
stopped processing because of an error: (SystemExit) exit
org.jruby.exceptions.SystemExit: (SystemExit) exit
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:747) ~[jruby-complete-9.2.13.0.jar:?]
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:710) ~[jruby-complete-9.2.13.0.jar:?]
at C_3a_.logstash_minus_7_dot_12_dot_0.lib.bootstrap.environment.(C:\logstash-7.12.0\lib\bootstrap\environment.rb:89)
~[?:?]
I found out that I had to use java version 8+ instead of 17.
I'm trying to install Elasticsearch on my local machine. I have download the Elasticsearch and try to setup it as following documentation
But when I'm trying to Run bin/elasticsearch it shows permission error for logs. Then I tried to run it as sudo bin/elasticsearch then it shows following error
[2017-11-20T12:08:40,340][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:134) ~[elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:121) ~[elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:69) ~[elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) ~[elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85) ~[elasticsearch-6.0.0.jar:6.0.0]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:104) ~[elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:171) ~[elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:322) ~[elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:130) ~[elasticsearch-6.0.0.jar:6.0.0]
... 6 more
Need instructions to fix this thanks
You should give the logs dir the permissions(drwxrwxr-x) of your current user, and start es by bin/elasticsearch(Don't start as root!).
I found following documentation ElasticSearch Hello World Example . As I using Linux OS I followed the 1.4 Ubuntu Linux: Install with commands
I have an elasticsearch cluster running on Linux machines without serious problems. I now want to extend it to MS Windows but hit an issue with the names of the indexes, which are not accepted. The log is quite explicit:
[2015-02-18 10:18:39,071][WARN ][common.jna ] unable to link C library. native methods (mlockall) will be disabled.
[2015-02-18 10:18:39,139][INFO ][node ] [lenov272dsy] version[1.4.3], pid[1276], build[36a29a7/2015-02-11T14:23:15Z]
[2015-02-18 10:18:39,139][INFO ][node ] [lenov272dsy] initializing ...
[2015-02-18 10:18:39,142][INFO ][plugins ] [lenov272dsy] loaded [], sites []
[2015-02-18 10:18:41,920][INFO ][node ] [lenov272dsy] initialized
[2015-02-18 10:18:41,920][INFO ][node ] [lenov272dsy] starting ...
[2015-02-18 10:18:42,104][INFO ][transport ] [lenov272dsy] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/10.233.85.45:9300]}
[2015-02-18 10:18:42,111][INFO ][discovery ] [lenov272dsy] security/6CeEuO01SeaL0kZuezwoSg
[2015-02-18 10:18:45,207][INFO ][cluster.service ] [lenov272dsy] detected_master [eu3][ZsJ2f1gcQpSOlWriWy19-g][eu3][inet[/10.81.163.112:9300]], added {[eu5][nEUNDAc0S4ytvtntjvgIXA][eu5.security.example.com][inet[/10.81.147.186:9300]],[eu4][--PlaWk9Tl2pF8XSHJulDA][eu4.security.example.com][inet[/10.81.163.129:9300]],[eu3][ZsJ2f1gcQpSOlWriWy19-g][eu3][inet[/10.81.163.112:9300]],}, reason: zen-disco-receive(from master [[eu3][ZsJ2f1gcQpSOlWriWy19-g][eu3][inet[/10.81.163.112:9300]]])
[2015-02-18 10:18:45,322][INFO ][http ] [lenov272dsy] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/10.233.85.45:9200]}
[2015-02-18 10:18:45,323][INFO ][node ] [lenov272dsy] started
[2015-02-18 10:18:53,009][WARN ][indices.cluster ] [lenov272dsy] [nessus_scan_recurrent-internet.2015-01-15t00:00:59+00:00.65731fa3-2635-a330-2a7b-00e3ea775493c5ddb3b88c869b73.getnessuscans.nessus][4] failed to create shard
org.elasticsearch.index.shard.IndexShardCreationException: [nessus_scan_recurrent-internet.2015-01-15t00:00:59+00:00.65731fa3-2635-a330-2a7b-00e3ea775493c5ddb3b88c869b73.getnessuscans.nessus][4] failed to create shard
at org.elasticsearch.index.service.InternalIndexService.createShard(InternalIndexService.java:360)
at org.elasticsearch.indices.cluster.IndicesClusterStateService.applyInitializingShard(IndicesClusterStateService.java:678)
at org.elasticsearch.indices.cluster.IndicesClusterStateService.applyNewOrUpdatedShards(IndicesClusterStateService.java:579)
at org.elasticsearch.indices.cluster.IndicesClusterStateService.clusterChanged(IndicesClusterStateService.java:185)
at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:431)
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:184)
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:154)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
at java.io.WinNTFileSystem.canonicalize0(Native Method)
at java.io.WinNTFileSystem.canonicalize(WinNTFileSystem.java:428)
at java.io.File.getCanonicalPath(File.java:618)
at org.apache.lucene.store.FSDirectory.getCanonicalPath(FSDirectory.java:129)
at org.apache.lucene.store.FSDirectory.<init>(FSDirectory.java:143)
at org.apache.lucene.store.MMapDirectory.<init>(MMapDirectory.java:132)
at org.apache.lucene.store.MMapDirectory.<init>(MMapDirectory.java:99)
at org.elasticsearch.index.store.fs.MmapFsDirectoryService.newFSDirectory(MmapFsDirectoryService.java:45)
at org.elasticsearch.index.store.fs.FsDirectoryService.build(FsDirectoryService.java:129)
at org.elasticsearch.index.store.distributor.AbstractDistributor.<init>(AbstractDistributor.java:35)
at org.elasticsearch.index.store.distributor.LeastUsedDistributor.<init>(LeastUsedDistributor.java:36)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at org.elasticsearch.common.inject.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:54)
at org.elasticsearch.common.inject.ConstructorInjector.construct(ConstructorInjector.java:86)
at org.elasticsearch.common.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:98)
at org.elasticsearch.common.inject.FactoryProxy.get(FactoryProxy.java:52)
at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
at org.elasticsearch.common.inject.InjectorImpl.callInContext(InjectorImpl.java:837)
at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
at org.elasticsearch.common.inject.Scopes$1$1.get(Scopes.java:57)
at org.elasticsearch.common.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
at org.elasticsearch.common.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
at org.elasticsearch.common.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
at org.elasticsearch.common.inject.ConstructorInjector.construct(ConstructorInjector.java:85)
at org.elasticsearch.common.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:98)
at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
at org.elasticsearch.common.inject.InjectorImpl.callInContext(InjectorImpl.java:837)
at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
at org.elasticsearch.common.inject.Scopes$1$1.get(Scopes.java:57)
at org.elasticsearch.common.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
at org.elasticsearch.common.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
at org.elasticsearch.common.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
at org.elasticsearch.common.inject.ConstructorInjector.construct(ConstructorInjector.java:85)
at org.elasticsearch.common.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:98)
at org.elasticsearch.common.inject.FactoryProxy.get(FactoryProxy.java:52)
at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
at org.elasticsearch.common.inject.InjectorImpl.callInContext(InjectorImpl.java:837)
at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
at org.elasticsearch.common.inject.Scopes$1$1.get(Scopes.java:57)
at org.elasticsearch.common.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
at org.elasticsearch.common.inject.InjectorBuilder$1.call(InjectorBuilder.java:200)
at org.elasticsearch.common.inject.InjectorBuilder$1.call(InjectorBuilder.java:193)
at org.elasticsearch.common.inject.InjectorImpl.callInContext(InjectorImpl.java:830)
at org.elasticsearch.common.inject.InjectorBuilder.loadEagerSingletons(InjectorBuilder.java:193)
at org.elasticsearch.common.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:175)
at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:110)
at org.elasticsearch.common.inject.InjectorImpl.createChildInjector(InjectorImpl.java:131)
at org.elasticsearch.common.inject.ModulesBuilder.createChildInjector(ModulesBuilder.java:69)
at org.elasticsearch.index.service.InternalIndexService.createShard(InternalIndexService.java:358)
... 9 more
This is repeated for other similar indexes, the key part being
Caused by: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
I had a look at how indexes are stored on the Linux boxes and there are indeed directories named after them.
Short of renaming the indexes, is there a way to make them compatible with a Windows install of elasticsearch? (I looked at the configuration but did not find anything -- my personal, uninformed and certainly naive opinion is that there should not be such OS dependency and something like a hash of the index name should be used instead)
May sound silly, but double check that ElasticSearch has sufficient permissions to create things in its installation folder.
After side discussions with other users of elasticsearch and further tests, the problem is indeed that the index name must use characters which are correct in a filename for a given OS (indexes are stored in files and folders named after the index name).
It is therefore better to use a safe set of characters, universally accepted among the OSes in filenames (letters, digits, underscore).
I installed a pre build Elasticsearch 1.0.0 version by reading this tutorial. If I start elasticsearch I got the following error message, Should I try an older version of ES or how to fix this issue?
[elastic-dataportal.rhcloud.com elasticsearch-1.0.0]\> ./bin/elasticsearch
[2014-02-25 10:02:18,757][INFO ][node ] [Desmond Pitt] version[1.0.0], pid[203443], build[a46900e/2014-02-12T16:18:34Z]
[2014-02-25 10:02:18,764][INFO ][node ] [Desmond Pitt] initializing ...
[2014-02-25 10:02:18,780][INFO ][plugins ] [Desmond Pitt] loaded [], sites []
OpenJDK Server VM warning: You have loaded library /var/lib/openshift/430c93b1500446b03a00005c/app-root/data/elasticsearch-1.0.0/lib/sigar/libsigar-x86-linux.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
[2014-02-25 10:02:32,198][INFO ][node ] [Desmond Pitt] initialized
[2014-02-25 10:02:32,205][INFO ][node ] [Desmond Pitt] starting ...
[2014-02-25 10:02:32,813][INFO ][transport ] [Desmond Pitt] bound_address {inet[/127.8.212.129:3306]}, publish_address {inet[/127.8.212.129:3306]}
[2014-02-25 10:02:35,949][INFO ][cluster.service ] [Desmond Pitt] new_master [Desmond Pitt][_bWO_h9ETTWrMNr7x_yALg][ex-std-node134.prod.rhcloud.com][inet[/127.8.212.129:3306]], reason: zen-disco-join (elected_as_master)
[2014-02-25 10:02:36,167][INFO ][discovery ] [Desmond Pitt] elasticsearch/_bWO_h9ETTWrMNr7x_yALg
{1.0.0}: Startup Failed ...
- BindHttpException[Failed to bind to [8080]]
ChannelException[Failed to bind to: /127.8.212.129:8080]
BindException[Address already in use]
You first have to stop the running demo application, which is already bound to 8080. This can be done with this command:
ctl_app stop
After running this command you will be able to start elasticsearch on the port 8080. However this is not recommended for production environments.
I would recommend installing ElasticSearch with this cartridge: https://github.com/ncdc/openshift-elasticsearch-cartridge
It will save you the headaches of manual custom configurations.
you try to assign ES to port 8080, which already is taken. the culprit in the config from there is http.port: ${OPENSHIFT_DIY_PORT}. just leave both port configs out of the config or assign the envvar some other port. the default ports for ES are 9200 for http and 9300.