# Unable to link C library. native methods (mlockall) will be disabled

**URL:** <https://discuss.elastic.co/t/unable-to-link-c-library-native-methods-mlockall-will-be-disabled/18344>\
**Category:** Elasticsearch\
**Created:** [June 25, 2014, 10:28pm UTC](https://discuss.elastic.co/t/unable-to-link-c-library-native-methods-mlockall-will-be-disabled/18344 "2014-06-25T22:28:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dup90011](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@dup90011](https://discuss.elastic.co/u/dup90011)\
**Post date:** [June 25, 2014, 10:28pm UTC](https://discuss.elastic.co/t/unable-to-link-c-library-native-methods-mlockall-will-be-disabled/18344/1 "2014-06-25T22:28:08Z")

</div>

Centos 6(64)

Tried to start elasticsearch with mlockall. Started, but mlockall : false

Log file message:

[2014 ...,144][WARN][common.jna] unable to link C library. native methods (mlockall) will be disabled.

File jna-4.1.0.jar here: /usr/share/elasticsearch/lib/jna-4.1.0.jar

Any help?

---

<div class="post-metadata">

**Author:** ![Antonio\_Augusto\_Sant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/antonio_augusto_sant/32/82851_2.png) [@Antonio\_Augusto\_Sant](https://discuss.elastic.co/u/Antonio_Augusto_Sant)\
**Post date:** [June 26, 2014, 2:40pm UTC](https://discuss.elastic.co/t/unable-to-link-c-library-native-methods-mlockall-will-be-disabled/18344/2 "2014-06-26T14:40:31Z")

</div>

I've run into this problem because my /tmp is mounted as noexec.  
Worked around this using these java opts:  
"-Djna.tmpdir=/usr/share/elasticsearch/tmp  
-Djava.io.tmpdir=/usr/share/elasticsearch/tmp"

Cheers

On Wednesday, June 25, 2014 7:28:17 PM UTC-3, dup90011 wrote:

> Centos 6(64)
> 
> Tried to start elasticsearch with mlockall. Started, but mlockall : false
> 
> Log file message:
> 
> [2014 ...,144][WARN][common.jna] unable to link C library. native methods  
> (mlockall) will be disabled.
> 
> File jna-4.1.0.jar here: /usr/share/elasticsearch/lib/jna-4.1.0.jar
> 
> Any help?
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/unable-to-link-C-library-native-methods-mlockall-will-be-disabled-tp4058617.html](http://elasticsearch-users.115913.n3.nabble.com/unable-to-link-C-library-native-methods-mlockall-will-be-disabled-tp4058617.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d61f0dfb-0756-446a-8105-eb060fb7e5be%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d61f0dfb-0756-446a-8105-eb060fb7e5be%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dup90011](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@dup90011](https://discuss.elastic.co/u/dup90011)\
**Post date:** [June 26, 2014, 7:11pm UTC](https://discuss.elastic.co/t/unable-to-link-c-library-native-methods-mlockall-will-be-disabled/18344/3 "2014-06-26T19:11:53Z")

</div>

Hmmm ...

How /tmp affected link C library?

My /tmp is fine

Any elasticsearch support exists here or only for paid version?

---

<div class="post-metadata">

**Author:** ![Antonio\_Augusto\_San1](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@Antonio\_Augusto\_San1](https://discuss.elastic.co/u/Antonio_Augusto_San1)\
**Post date:** [June 26, 2014, 8:26pm UTC](https://discuss.elastic.co/t/unable-to-link-c-library-native-methods-mlockall-will-be-disabled/18344/4 "2014-06-26T20:26:35Z")

</div>

Check \*mlockall \*section on

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

The ES devs are around and they may answer your question. But real support  
only on paid version.

On Thu, Jun 26, 2014 at 4:11 PM, dup90011 [register@xdbr.com](mailto:register@xdbr.com) wrote:

> Hmmm ...
> 
> How /tmp affected link C library?
> 
> My /tmp is fine
> 
> Any elasticsearch support exists here or only for paid version?
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/unable-to-link-C-library-native-methods-mlockall-will-be-disabled-tp4058617p4058733.html](http://elasticsearch-users.115913.n3.nabble.com/unable-to-link-C-library-native-methods-mlockall-will-be-disabled-tp4058617p4058733.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/KmbvIUO1CoM/unsubscribe](https://groups.google.com/d/topic/elasticsearch/KmbvIUO1CoM/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/1403809913599-4058733.post%40n3.nabble.com](https://groups.google.com/d/msgid/elasticsearch/1403809913599-4058733.post%40n3.nabble.com)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGz5QREguKERZzE1LPHvnL3wBDW%2BgMaWfMZcPNh-UvAcY9csJw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGz5QREguKERZzE1LPHvnL3wBDW%2BgMaWfMZcPNh-UvAcY9csJw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [June 26, 2014, 9:42pm UTC](https://discuss.elastic.co/t/unable-to-link-c-library-native-methods-mlockall-will-be-disabled/18344/5 "2014-06-26T21:42:58Z")

</div>

ES runs on RHEL/Centos 6.

What exact RHEL/Centos 6 is this? Find out with command

cat /etc/redhat-release

What Java JVM do you use?

What file system do you have ES installed on? It must have permission to  
execute binaries.

Also you can run this little Java program to find the reason:

Save this as file with name LoadNativeC.java

import com.sun.jna.Native;  
public class LoadNativeC {  
public static void main(String argv) {  
try {  
Native.register("c");  
} catch (Throwable t) {  
t.printStackTrace();  
}  
}  
}

Then compile and run with

javac -classpath $ES\_HOME/lib/jna-4.1.0.jar LoadNativeC.java  
java -classpath $ES\_HOME/lib/jna-4.1.0.jar:. LoadNativeC

Jörg

On Thu, Jun 26, 2014 at 12:28 AM, dup90011 [register@xdbr.com](mailto:register@xdbr.com) wrote:

> Centos 6(64)
> 
> Tried to start elasticsearch with mlockall. Started, but mlockall : false
> 
> Log file message:
> 
> [2014 ...,144][WARN][common.jna] unable to link C library. native methods  
> (mlockall) will be disabled.
> 
> File jna-4.1.0.jar here: /usr/share/elasticsearch/lib/jna-4.1.0.jar
> 
> Any help?
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/unable-to-link-C-library-native-methods-mlockall-will-be-disabled-tp4058617.html](http://elasticsearch-users.115913.n3.nabble.com/unable-to-link-C-library-native-methods-mlockall-will-be-disabled-tp4058617.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/1403735289211-4058617.post%40n3.nabble.com](https://groups.google.com/d/msgid/elasticsearch/1403735289211-4058617.post%40n3.nabble.com)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG-NNA-xSpxbXnwL%2ByCjFSje5%2Bi9w9pynQSTxs6G4rSTg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG-NNA-xSpxbXnwL%2ByCjFSje5%2Bi9w9pynQSTxs6G4rSTg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 1:19am UTC](https://discuss.elastic.co/t/unable-to-link-c-library-native-methods-mlockall-will-be-disabled/18344/6 "2017-07-06T01:19:25Z")

</div>


