[ 
https://issues.apache.org/jira/browse/CASSANDRA-6301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13814228#comment-13814228
 ] 

Nikolai Grigoriev commented on CASSANDRA-6301:
----------------------------------------------

Hmmm...I do not think it is sourced by nodetool.

{code}
/opt/apache-cassandra-2.0.2 >grep cassandra-env.sh bin/* conf/*
bin/cassandra:if [ -f "$CASSANDRA_CONF/cassandra-env.sh" ]; then
bin/cassandra:    . "$CASSANDRA_CONF/cassandra-env.sh"
bin/debug-cql:if [ -f "$CASSANDRA_CONF/cassandra-env.sh" ]; then
bin/debug-cql:    . "$CASSANDRA_CONF/cassandra-env.sh"
conf/cassandra-env.sh:        echo "please set or unset MAX_HEAP_SIZE and 
HEAP_NEWSIZE in pairs (see cassandra-env.sh)"
conf/cassandra-topology.properties:# in cassandra-env.sh
conf/cassandra.yaml:# modify cassandra-env.sh as directed in the file.
{code}

I see that nodetool invokes JAVA directly, so it is sourced only by cassandra 
itself and debug-cql. And it seems to me that sourcing cassandra-env.sh from 
the tools would not be appropriate - it contains a number of settings that are 
server-specific all packed in JVM_OPTS. Or I am missing something...

The allocator is probably not needed, but, in general, a tool might need a 
native library that is used by the server too. Maybe I am using wrong example 
but something like native snappy library...so probably it may make sense to use 
the same set of native libraries for the tools as for the server itself. Even 
if not really needed now this may be more useful in the future. Just my two 
cents.

> nodetool fails with java.lang.UnsatisfiedLinkError (cannot find 
> libjemalloc.so) when JEMalloc is configured
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-6301
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6301
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>         Environment: Linux
> Cassandra 2.0.2
> libjemalloc.so in /usr/local/lib
>            Reporter: Nikolai Grigoriev
>            Priority: Trivial
>
> {code}
> >/opt/apache-cassandra-2.0.2/bin/nodetool ring
> Note: Ownership information does not include topology; for complete 
> information, specify a keyspace
> Datacenter: DC1
> ==========
> Address      Rack        Status State   Load            Owns                
> Token
>                                                                             
> 9208241795664305161
> 10.3.45.160  r1          Up     Normal  125.88 GB       16.41%              
> -9222548266947385654
> 10.3.45.160  r1          Up     Normal  125.88 GB       16.41%              
> -9177629719965963707
> 10.3.45.160  r1          Up     Normal  125.88 GB       16.41%              
> -9039272433194428886
> 10.3.45.160  r1          Up     Normal  125.88 GB       16.41%              
> -9037742357058937987
> ...
> Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load 
> library 'jemalloc': libjemalloc.so: cannot open shared object file: No such 
> file or directory
>         at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:164)
>         at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:237)
>         at com.sun.jna.Library$Handler.<init>(Library.java:140)
>         at com.sun.jna.Native.loadLibrary(Native.java:375)
>         at com.sun.jna.Native.loadLibrary(Native.java:359)
>         at 
> org.apache.cassandra.io.util.JEMallocAllocator.<init>(JEMallocAllocator.java:36)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
> Method)
>         at 
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
>         at 
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
>         at java.lang.Class.newInstance(Class.java:374)
>         at 
> org.apache.cassandra.utils.FBUtilities.construct(FBUtilities.java:488)
>         at 
> org.apache.cassandra.utils.FBUtilities.newOffHeapAllocator(FBUtilities.java:438)
>         at 
> org.apache.cassandra.config.DatabaseDescriptor.applyConfig(DatabaseDescriptor.java:442)
>         at 
> org.apache.cassandra.config.DatabaseDescriptor.<clinit>(DatabaseDescriptor.java:104)
>         at org.apache.cassandra.tools.NodeCmd.printRing(NodeCmd.java:286)
>         at org.apache.cassandra.tools.NodeCmd.main(NodeCmd.java:1092)
> {code}
> In my conf/cassandra-env.sh I have:
> {code}
> # Configure the following for JEMallocAllocator and if jemalloc is not 
> available in the system
> # library path (Example: /usr/local/lib/). Usually "make install" will do the 
> right thing.
> export LD_LIBRARY_PATH=/usr/local/lib
> JVM_OPTS="$JVM_OPTS -Djava.library.path=/usr/local/lib/"
> {code}
> I believe this file is not sourced by the tools, this is why a tool that 
> might need that library cannot find it.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to