Elasticsearch : we need to run on elasticsearch it will giving error

org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:125) ~[elasticsearch-5.2.0.jar:5.2.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-5.2.0.jar:5.2.0]
at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54) ~[elasticsearch-5.2.0.jar:5.2.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) ~[elasticsearch-5.2.0.jar:5.2.0]
at org.elasticsearch.cli.Command.main(Command.java:88) ~[elasticsearch-5.2.0.jar:5.2.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:89) ~[elasticsearch-5.2.0.jar:5.2.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:82) ~[elasticsearch-5.2.0.jar:5.2.0]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:105) ~[elasticsearch-5.2.0.jar:5.2.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:203) ~[elasticsearch-5.2.0.jar:5.2.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-5.2.0.jar:5.2.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-5.2.0.jar:5.2.0]
... 6 more

can not run elasticsearch as root

Run as another user than root

here is the running as the normal user

2017-04-06 13:16:22,201 main ERROR Could not register mbeans java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:585)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.checkMBeanTrustPermission(DefaultMBeanServerInterceptor.java:1848)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:322)
at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
at org.apache.logging.log4j.core.jmx.Server.register(Server.java:389)
at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:167)
at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:140)
at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:541)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:258)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:206)
at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:220)
at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:197)
at org.elasticsearch.common.logging.LogConfigurator.configureStatusLogger(LogConfigurator.java:125)
at org.elasticsearch.common.logging.LogConfigurator.configureWithoutConfig(LogConfigurator.java:67)
at org.elasticsearch.cli.Command.main(Command.java:85)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:89)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:82)

Exception in thread "main" SettingsException[Failed to load settings from /data/myWizard_Services/elkhome/elasticsearch/elasticsearch-5.2.0/config/elasticsearch.yml]; nested: AccessDeniedException[/data/myWizard_Services/elkhome/elasticsearch/elasticsearch-5.2.0/config/elasticsearch.yml];
Likely root cause: java.nio.file.AccessDeniedException: /data/myWizard_Services/elkhome/elasticsearch/elasticsearch-5.2.0/config/elasticsearch.yml
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.common.settings.Settings$Builder.loadFromPath(Settings.java:914)
at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:102)
at org.elasticsearch.bootstrap.Bootstrap.initialEnvironment(Bootstrap.java:257)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:297)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121)
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112)
at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122)
at org.elasticsearch.cli.Command.main(Command.java:88)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:89)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:82)
Refer to the log for complete error details.

You need to fix the access rights to the dirs.

Hi dadoonet

I am giving permissions to that directory as well. We are facing bellow issue.
Could you please help me.

2017-04-11 06:07:17,272 main ERROR Could not register mbeans java.security.AccessControlException: Access denied ("javax.management.MBeanTrustPermission" "register")
at java.security.AccessControlContext.checkPermissionWithCache(AccessControlContext.java:634)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:711)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:598)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.checkMBeanTrustPermission(DefaultMBeanServerInterceptor.java:1860)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:334)
at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:534)
at org.apache.logging.log4j.core.jmx.Server.register(Server.java:389)
at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:167)
at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:140)
at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:541)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:258)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:206)
at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:220)
at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:197)
at org.elasticsearch.common.logging.LogConfigurator.configureStatusLogger(LogConfigurator.java:125)
at org.elasticsearch.common.logging.LogConfigurator.configureWithoutConfig(LogConfigurator.java:67)
at org.elasticsearch.cli.Command.main(Command.java:85)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:89)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:82)

ERROR: no log4j2.properties found; tried [/home/venkata.bollineni/mywizardservices/elasticsearch/elasticsearch-5.2.0/config] and its subdirectories

Hi All,

I run the elastic-search .I will show the data.Could you please tell me its working fine or not.

[2017-04-11T06:20:03,955][INFO ][o.e.n.Node ] [] initializing ...
[2017-04-11T06:20:04,080][INFO ][o.e.e.NodeEnvironment ] [ua5xLr6] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [28.8gb], net total_space [31.4gb], spins? [unknown], types [rootfs]
[2017-04-11T06:20:04,081][INFO ][o.e.e.NodeEnvironment ] [ua5xLr6] heap size [2gb], compressed ordinary object pointers [unknown]
[2017-04-11T06:20:04,082][INFO ][o.e.n.Node ] node name [ua5xLr6] derived from node ID [ua5xLr6lRmSScDe8wKXyeg]; set [node.name] to override
[2017-04-11T06:20:04,084][INFO ][o.e.n.Node ] version[5.2.0], pid[23618], build[24e05b9/2017-01-24T19:52:35.800Z], OS[Linux/3.10.0-514.10.2.el7.x86_64/amd64], JVM[IBM Corporation/IBM J9 VM/1.8.0/2.8]
[2017-04-11T06:20:05,192][INFO ][o.e.p.PluginsService ] [ua5xLr6] loaded module [aggs-matrix-stats]
[2017-04-11T06:20:05,192][INFO ][o.e.p.PluginsService ] [ua5xLr6] loaded module [ingest-common]
[2017-04-11T06:20:05,192][INFO ][o.e.p.PluginsService ] [ua5xLr6] loaded module [lang-expression]
[2017-04-11T06:20:05,192][INFO ][o.e.p.PluginsService ] [ua5xLr6] loaded module [lang-groovy]
[2017-04-11T06:20:05,192][INFO ][o.e.p.PluginsService ] [ua5xLr6] loaded module [lang-mustache]
[2017-04-11T06:20:05,193][INFO ][o.e.p.PluginsService ] [ua5xLr6] loaded module [lang-painless]
[2017-04-11T06:20:05,193][INFO ][o.e.p.PluginsService ] [ua5xLr6] loaded module [percolator]
[2017-04-11T06:20:05,193][INFO ][o.e.p.PluginsService ] [ua5xLr6] loaded module [reindex]
[2017-04-11T06:20:05,193][INFO ][o.e.p.PluginsService ] [ua5xLr6] loaded module [transport-netty3]
[2017-04-11T06:20:05,193][INFO ][o.e.p.PluginsService ] [ua5xLr6] loaded module [transport-netty4]
[2017-04-11T06:20:05,194][INFO ][o.e.p.PluginsService ] [ua5xLr6] no plugins loaded
[2017-04-11T06:20:06,933][INFO ][o.e.n.Node ] initialized
[2017-04-11T06:20:06,933][INFO ][o.e.n.Node ] [ua5xLr6] starting ...
[2017-04-11T06:20:07,058][INFO ][o.e.t.TransportService ] [ua5xLr6] publish_address {127.0.0.1:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300}
[2017-04-11T06:20:07,063][WARN ][o.e.b.BootstrapChecks ] [ua5xLr6] max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2017-04-11T06:20:10,105][INFO ][o.e.c.s.ClusterService ] [ua5xLr6] new_master {ua5xLr6}{ua5xLr6lRmSScDe8wKXyeg}{LK5yowMoQvqFaEleoR_DFQ}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-elected-as-master ([0] nodes joined)
[2017-04-11T06:20:10,122][INFO ][o.e.h.HttpServer ] [ua5xLr6] publish_address {127.0.0.1:9200}, bound_addresses {[::1]:9200}, {127.0.0.1:9200}
[2017-04-11T06:20:10,122][INFO ][o.e.n.Node ] [ua5xLr6] started
[2017-04-11T06:20:10,136][INFO ][o.e.g.GatewayService ] [ua5xLr6] recovered [0] indices into cluster_state

It's fine for development not for production.
You'll need to fix bootstrap messages.

How to fix bootstraps messages

could you please tell me.

Just search for bootstrap in the docs. Everything is explained.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.