# Unable to install elasticsearch in RHEL 7 due to polkit error

**URL:** <https://discuss.elastic.co/t/unable-to-install-elasticsearch-in-rhel-7-due-to-polkit-error/249845>\
**Category:** Elasticsearch\
**Created:** [September 24, 2020, 3:08pm UTC](https://discuss.elastic.co/t/unable-to-install-elasticsearch-in-rhel-7-due-to-polkit-error/249845 "2020-09-24T15:08:59Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![aknraj](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@aknraj](https://discuss.elastic.co/u/aknraj)\
**Post date:** [September 24, 2020, 3:08pm UTC](https://discuss.elastic.co/t/unable-to-install-elasticsearch-in-rhel-7-due-to-polkit-error/249845/1 "2020-09-24T15:08:59Z")

</div>

Trying to install elasticsearch in RHEL 7, but it has been failed with polkit error (please refer below for the detailed error) - I tried to reinstall and also with full permissions on the file as recommended in other topic but didn't get success. Please help if you have come across and resolved this error.

## Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: fatal error in thread [main], exiting Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: java.lang.NoClassDefFoundError: Could not initialize class c Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.systemd.Libsystemd.lambda$static$0(Libs Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at java.security.AccessController.doPrivileged(Native Method Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.systemd.Libsystemd.(Libsystemd. Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.systemd.SystemdPlugin.sd\_notify(Systemd Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.systemd.SystemdPlugin.onNodeStarted(Sys Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at java.util.ArrayList.forEach(ArrayList.java:1259) Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.node.Node.start(Node.java:868) Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.bootstrap.Bootstrap.start(Bootstrap.jav Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsea Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.bootstrap.Elasticsearch.execute(Elastic Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.cli.EnvironmentAwareCommand.execute(Env Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Co Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.cli.Command.main(Command.java:90) Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsea Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsea Sep 24 10:30:50 lfltst001x systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE Sep 24 10:30:50 lfltst001x systemd[1]: Failed to start Elasticsearch. -- Subject: Unit elasticsearch.service has failed -- Defined-By: systemd -- Support: [http://lists.freedesktop.org/mailman/listinfo/systemd-devel](http://lists.freedesktop.org/mailman/listinfo/systemd-devel)

## -- Unit elasticsearch.service has failed.

-- The result is failed.  
Sep 24 10:30:50 lfltst001x systemd[1]: Unit elasticsearch.service entered failed state.  
Sep 24 10:30:50 lfltst001x systemd[1]: elasticsearch.service failed.  
Sep 24 10:30:50 lfltst001x polkitd[1010]: Unregistered Authentication Agent for unix-process:15998:366323193 (syst  
lines 2021-2050/2050 (END)

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 28, 2020, 3:51am UTC](https://discuss.elastic.co/t/unable-to-install-elasticsearch-in-rhel-7-due-to-polkit-error/249845/2 "2020-09-28T03:51:48Z")

</div>

Welcome to our community! 😃

Can you please check your Elasticsearch logs and see if there is anything further?

---

<div class="post-metadata">

**Author:** ![aknraj](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@aknraj](https://discuss.elastic.co/u/aknraj)\
**Post date:** [September 28, 2020, 5:58pm UTC](https://discuss.elastic.co/t/unable-to-install-elasticsearch-in-rhel-7-due-to-polkit-error/249845/3 "2020-09-28T17:58:07Z")

</div>

Thank you Mark,

Yaa.. i see that JNA native support library were unable to load... below is the elasticsearch log

[2020-09-24T12:09:34,837][WARN][o.e.b.Natives] [lfltst001x] unable to load JNA native support library, native methods will be disabled.  
java.lang.UnsatisfiedLinkError: /tmp/elasticsearch-15068793945104209523/jna5892265188709333092.tmp: /tmp/elasticsearch-15068793945104209523/jna5892265188709333092.tmp: failed to map segment from shared object: Operation not permitted  
at jdk.internal.loader.NativeLibraries.load(Native Method) ~[?:?]  
at jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:383) ~[?:?]  
at jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:227) ~[?:?]  
at jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:169) ~[?:?]  
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:2407) ~[?:?]  
at java.lang.Runtime.load0(Runtime.java:747) ~[?:?]  
at java.lang.System.load(System.java:1857) ~[?:?]  
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1018) ~[jna-5.5.0.jar:5.5.0 (b0)]  
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:988) ~[jna-5.5.0.jar:5.5.0 (b0)]  
at com.sun.jna.Native.(Native.java:195) ~[jna-5.5.0.jar:5.5.0 (b0)]  
at java.lang.Class.forName0(Native Method) ~[?:?]  
at java.lang.Class.forName(Class.java:377) ~[?:?]  
at org.elasticsearch.bootstrap.Natives.(Natives.java:45) [elasticsearch-7.9.2.jar:7.9.2]  
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:110) [elasticsearch-7.9.2.jar:7.9.2]  
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178) [elasticsearch-7.9.2.jar:7.9.2]  
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393) [elasticsearch-7.9.2.jar:7.9.2]  
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) [elasticsearch-7.9.2.jar:7.9.2]  
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) [elasticsearch-7.9.2.jar:7.9.2]  
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-7.9.2.jar:7.9.2]  
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127) [elasticsearch-cli-7.9.2.jar:7.9.2]  
at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-7.9.2.jar:7.9.2]  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) [elasticsearch-7.9.2.jar:7.9.2]  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) [elasticsearch-7.9.2.jar:7.9.2]  
[2020-09-24T12:09:34,847][WARN][o.e.b.Natives] [lfltst001x] cannot check if running as root because JNA is not available  
[2020-09-24T12:09:34,847][WARN][o.e.b.Natives] [lfltst001x] cannot install system call filter because JNA is not available  
[2020-09-24T12:09:34,848][WARN][o.e.b.Natives] [lfltst001x] cannot register console handler because JNA is not available  
[2020-09-24T12:09:34,849][WARN][o.e.b.Natives] [lfltst001x] cannot getrlimit RLIMIT\_NPROC because JNA is not available  
[2020-09-24T12:09:34,849][WARN][o.e.b.Natives] [lfltst001x] cannot getrlimit RLIMIT\_AS because JNA is not available  
[2020-09-24T12:09:34,849][WARN][o.e.b.Natives] [lfltst001x] cannot getrlimit RLIMIT\_FSIZE because JNA is not available  
[2020-09-24T12:09:35,019][INFO][o.e.n.Node] [lfltst001x] version[7.9.2], pid[24266], build[default/rpm/d34da0ea4a966c4e49417f2da2f244e3e97b4e6e/2020-09-23T00:45:33.626720Z], OS[Linux/3.10.0-1127.18.2.el7.x86\_64/amd64], JVM[AdoptOpenJDK/OpenJDK 64-Bit Server VM/15/15+36]  
[2020-09-24T12:09:35,021][INFO][o.e.n.Node] [lfltst001x] JVM home [/usr/share/elasticsearch/jdk]

---

<div class="post-metadata">

**Author:** ![jkfields](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@jkfields](https://discuss.elastic.co/u/jkfields)\
**Post date:** [September 28, 2020, 6:41pm UTC](https://discuss.elastic.co/t/unable-to-install-elasticsearch-in-rhel-7-due-to-polkit-error/249845/4 "2020-09-28T18:41:21Z")

</div>

I saw something similar when I licensed my cluster; I explicitly set xpack.security.enabled = false on my 3 master nodes, but not on my data nodes. After I installed the license through Kibana, I saw my cluster go down. When I explicitly disable xpack security on the data nodes and restarted them the issue cleared up.

---

<div class="post-metadata">

**Author:** ![aknraj](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@aknraj](https://discuss.elastic.co/u/aknraj)\
**Post date:** [September 28, 2020, 6:58pm UTC](https://discuss.elastic.co/t/unable-to-install-elasticsearch-in-rhel-7-due-to-polkit-error/249845/5 "2020-09-28T18:58:48Z")

</div>

> [@jkfields](#):
>
> xpack.security.enabled

Thanks @jkfields, will try this option to see if it helps.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 28, 2020, 8:59pm UTC](https://discuss.elastic.co/t/unable-to-install-elasticsearch-in-rhel-7-due-to-polkit-error/249845/6 "2020-09-28T20:59:35Z")

</div>

We'd strongly recommend against disabling security protection on your cluster.

---

<div class="post-metadata">

**Author:** ![aknraj](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@aknraj](https://discuss.elastic.co/u/aknraj)\
**Post date:** [September 28, 2020, 9:18pm UTC](https://discuss.elastic.co/t/unable-to-install-elasticsearch-in-rhel-7-due-to-polkit-error/249845/7 "2020-09-28T21:18:00Z")

</div>

@warkolm, sure, can you please advise other alternative to resolve this issue? I am having same issue still. Thank you !

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 28, 2020, 9:30pm UTC](https://discuss.elastic.co/t/unable-to-install-elasticsearch-in-rhel-7-due-to-polkit-error/249845/8 "2020-09-28T21:30:17Z")

</div>

> [@jkfields](#):
>
> I explicitly set xpack.security.enabled = false on my 3 master nodes, but not on my data nodes

That is guaranteed to cause issues. Security needs to be enabled on all nodes in the cluster.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 28, 2020, 9:30pm UTC](https://discuss.elastic.co/t/unable-to-install-elasticsearch-in-rhel-7-due-to-polkit-error/249845/9 "2020-09-28T21:30:38Z")

</div>

Try the solution here [Unable to start elasticsearch from systemctl in centos 7.7](https://discuss.elastic.co/t/unable-to-start-elasticsearch-from-systemctl-in-centos-7-7/230025).

---

<div class="post-metadata">

**Author:** ![aknraj](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@aknraj](https://discuss.elastic.co/u/aknraj)\
**Post date:** [September 29, 2020, 3:23am UTC](https://discuss.elastic.co/t/unable-to-install-elasticsearch-in-rhel-7-due-to-polkit-error/249845/10 "2020-09-29T03:23:06Z")

</div>

ok, will try this solution tomorrow, and see if it works.. will keep you posted

---

<div class="post-metadata">

**Author:** ![aknraj](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@aknraj](https://discuss.elastic.co/u/aknraj)\
**Post date:** [September 29, 2020, 6:38pm UTC](https://discuss.elastic.co/t/unable-to-install-elasticsearch-in-rhel-7-due-to-polkit-error/249845/11 "2020-09-29T18:38:26Z")

</div>

i changed the recommended variable and tried to restart but again, i see the same error

[2020-09-24T12:09:34,837][WARN][o.e.b.Natives] [lfltst001x] unable to load JNA native support library, native methods will be disabled.  
java.lang.UnsatisfiedLinkError: /tmp/elasticsearch-15068793945104209523/jna5892265188709333092.tmp: /tmp/elasticsearch-15068793945104209523/jna5892265188709333092.tmp: failed to map segment from shared object: Operation not permitted  
at jdk.internal.loader.NativeLibraries.load(Native Method) ~[?:?]  
at jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:383) ~[?:?]  
at jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:227) ~[?:?]  
at jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:169) ~[?:?]  
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:2407) ~[?:?]  
at java.lang.Runtime.load0(Runtime.java:747) ~[?:?]  
at java.lang.System.load(System.java:1857) ~[?:?]  
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1018) ~[jna-5.5.0.jar:5.5.0 (b0)]  
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:988) ~[jna-5.5.0.jar:5.5.0 (b0)]  
at com.sun.jna.Native.(Native.java:195) ~[jna-5.5.0.jar:5.5.0 (b0)]  
at java.lang.Class.forName0(Native Method) ~[?:?]  
at java.lang.Class.forName(Class.java:377) ~[?:?]  
at org.elasticsearch.bootstrap.Natives.(Natives.java:45) [elasticsearch-7.9.2.jar:7.9.2]  
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:110) [elasticsearch-7.9.2.jar:7.9.2]  
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178) [elasticsearch-7.9.2.jar:7.9.2]  
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393) [elasticsearch-7.9.2.jar:7.9.2]  
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) [elasticsearch-7.9.2.jar:7.9.2]  
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) [elasticsearch-7.9.2.jar:7.9.2]  
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-7.9.2.jar:7.9.2]  
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127) [elasticsearch-cli-7.9.2.jar:7.9.2]  
at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-7.9.2.jar:7.9.2]  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) [elasticsearch-7.9.2.jar:7.9.2]  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) [elasticsearch-7.9.2.jar:7.9.2]  
[2020-09-24T12:09:34,847][WARN][o.e.b.Natives] [lfltst001x] cannot check if running as root because JNA is not available  
[2020-09-24T12:09:34,847][WARN][o.e.b.Natives] [lfltst001x] cannot install system call filter because JNA is not available  
[2020-09-24T12:09:34,848][WARN][o.e.b.Natives] [lfltst001x] cannot register console handler because JNA is not available  
3,2-9 Top

---

<div class="post-metadata">

**Author:** ![kavierkoo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kavierkoo/32/86555_2.png) [@kavierkoo](https://discuss.elastic.co/u/kavierkoo)\
**Post date:** [September 29, 2020, 6:52pm UTC](https://discuss.elastic.co/t/unable-to-install-elasticsearch-in-rhel-7-due-to-polkit-error/249845/12 "2020-09-29T18:52:28Z")

</div>

> [@aknraj](#):
>
> [2020-09-24T12:09:34,837][WARN][o.e.b.Natives] [lfltst001x] unable to load JNA native support library, native methods will be disabled.  
> java.lang.UnsatisfiedLinkError: /tmp/elasticsearch-15068793945104209523/jna5892265188709333092.tmp: /tmp/elasticsearch-15068793945104209523/jna5892265188709333092.tmp: failed to map segment from shared object: Operation not permitted

It seems to say that it could not map /tmp/elasticsearch directory.  
Is your /tmp _noexec_? You could remove _noexec_ from /tmp or try to change it to some other directory like what warkolm's link shows "/var/lib/elasticsearch/tmp"

Refer to below doc:

> **[Ensure JNA temporary directory permits executables | Elasticsearch Guide...](https://www.elastic.co/guide/en/elasticsearch/reference/current/executable-jna-tmpdir.html)**

---

<div class="post-metadata">

**Author:** ![aknraj](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@aknraj](https://discuss.elastic.co/u/aknraj)\
**Post date:** [October 6, 2020, 4:26pm UTC](https://discuss.elastic.co/t/unable-to-install-elasticsearch-in-rhel-7-due-to-polkit-error/249845/13 "2020-10-06T16:26:21Z")

</div>

@kavierkoo, Thank you very much, i tried after changing /tmp/with exec and it started successfully.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 3, 2020, 4:26pm UTC](https://discuss.elastic.co/t/unable-to-install-elasticsearch-in-rhel-7-due-to-polkit-error/249845/14 "2020-11-03T16:26:25Z")

</div>

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