You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by opensaf dev <op...@gmail.com> on 2014/05/21 06:59:05 UTC

Memory issue

Hi guys,

I am trying to run Cassandra on CentOS as an user X other then root or
cassandra. When I run as user cassandra, it starts and runs fine. But, when
I run under user X, I am getting the below error once cassandra started and
system freezes totally.

*Insufficient memlock settings:*

WARN [main] 2011-06-15 09:58:56,861 CLibrary.java (line 118) Unable to
lock JVM memory (ENOMEM).
This can result in part of the JVM being swapped out, especially with
mmapped I/O enabled.
Increase RLIMIT_MEMLOCK or run Cassandra as root.


I have tried the tips available online to change the memlock and other
limits both for users cassadra and X, but did not solve the problem.


What else I should consider when I run cassandra other then user cassandra/root.


Any help is much appreciated.


Thanks

Dev

Re: Memory issue

Posted by opensaf dev <op...@gmail.com>.
Well Romain, I had tried restarting the VM as well but problem still
remained.

What I noticed is after sometime irrespective I run cassandra from other
user or using the normal cassandra the problem still remains. As soon as it
starts, the JVM is get killed because of memory issue. Is there some other
settings other then limits.conf file I need to configure.

Also to note that I dont have a /etc/limits.d/cassandra.conf file. I just
configured them in limits.conf. Even though I made same the group ID of
both the users(cassanda, X) but no use. Is there anything like cassandra
has to be started under cassandra user only? What are the special
configurations required if we try to run cassandra under a different user?

Thanks
Dev






On Tue, May 20, 2014 at 10:44 PM, Romain HARDOUIN <romain.hardouin@urssaf.fr
> wrote:

> Well... you have already changed the limits ;-)
> Keep in mind that changes in the limits.conf file will not affect
> processes that are already running.
>
> opensaf dev <op...@gmail.com> a écrit sur 21/05/2014 06:59:05 :
>
> > De : opensaf dev <op...@gmail.com>
> > A : user@cassandra.apache.org,
> > Date : 21/05/2014 07:00
> > Objet : Memory issue
> >
> > Hi guys,
> >
> > I am trying to run Cassandra on CentOS as an user X other then root
> > or cassandra. When I run as user cassandra, it starts and runs fine.
> > But, when I run under user X, I am getting the below error once
> > cassandra started and system freezes totally.
> >
> > Insufficient memlock settings:
> > WARN [main] 2011-06-15 09:58:56,861 CLibrary.java (line 118) Unable
> > to lock JVM memory (ENOMEM).
> > This can result in part of the JVM being swapped out, especially
> > with mmapped I/O enabled.
> > Increase RLIMIT_MEMLOCK or run Cassandra as root.
> >
> >
> > I have tried the tips available online to change the memlock and
> > other limits both for users cassadra and X, but did not solve the
> problem.
> >
>
> > What else I should consider when I run cassandra other then user
> > cassandra/root.
> >
> >
> > Any help is much appreciated.
> >
> >
> > Thanks
> > Dev
> >
>

RE: Memory issue

Posted by Romain HARDOUIN <ro...@urssaf.fr>.
Well... you have already changed the limits ;-)
Keep in mind that changes in the limits.conf file will not affect 
processes that are already running.

opensaf dev <op...@gmail.com> a écrit sur 21/05/2014 06:59:05 :

> De : opensaf dev <op...@gmail.com>
> A : user@cassandra.apache.org, 
> Date : 21/05/2014 07:00
> Objet : Memory issue
> 
> Hi guys,
> 
> I am trying to run Cassandra on CentOS as an user X other then root 
> or cassandra. When I run as user cassandra, it starts and runs fine.
> But, when I run under user X, I am getting the below error once 
> cassandra started and system freezes totally.
> 
> Insufficient memlock settings:
> WARN [main] 2011-06-15 09:58:56,861 CLibrary.java (line 118) Unable 
> to lock JVM memory (ENOMEM).
> This can result in part of the JVM being swapped out, especially 
> with mmapped I/O enabled.
> Increase RLIMIT_MEMLOCK or run Cassandra as root.
> 
> 
> I have tried the tips available online to change the memlock and 
> other limits both for users cassadra and X, but did not solve the 
problem.
> 

> What else I should consider when I run cassandra other then user 
> cassandra/root.
> 
> 
> Any help is much appreciated.
> 
> 
> Thanks
> Dev
> 

Re: Memory issue

Posted by Aaron Morton <aa...@thelastpickle.com>.
>   As soon as it starts, the JVM is get killed because of memory issue.
What is the memory issue that gets kills the JVM ? 

The log message below is simply a warning

> WARN [main] 2011-06-15 09:58:56,861 CLibrary.java (line 118) Unable to lock JVM memory (ENOMEM).
> This can result in part of the JVM being swapped out, especially with mmapped I/O enabled.
> Increase RLIMIT_MEMLOCK or run Cassandra as root.

Is there anything in the system logs ? 

Cheers
Aaron 
-----------------
Aaron Morton
New Zealand
@aaronmorton

Co-Founder & Principal Consultant
Apache Cassandra Consulting
http://www.thelastpickle.com

On 24/05/2014, at 9:17 am, Robert Coli <rc...@eventbrite.com> wrote:

> On Fri, May 23, 2014 at 2:08 PM, opensaf dev <op...@gmail.com> wrote:
> I have a different service which controls the cassandra service for high availability.
> 
> IMO, starting or stopping a Cassandra node should never be a side effect of another system's properties. YMMV.
> 
> https://issues.apache.org/jira/browse/CASSANDRA-2356
> 
> For some related comments.
> 
> =Rob
> 


Re: Memory issue

Posted by Robert Coli <rc...@eventbrite.com>.
On Fri, May 23, 2014 at 2:08 PM, opensaf dev <op...@gmail.com> wrote:

> I have a different service which controls the cassandra service for high
> availability.
>

IMO, starting or stopping a Cassandra node should never be a side effect of
another system's properties. YMMV.

https://issues.apache.org/jira/browse/CASSANDRA-2356

For some related comments.

=Rob

Re: Memory issue

Posted by opensaf dev <op...@gmail.com>.
I have a different service which controls the cassandra service for high
availability.

Thanks
Dev


On Fri, May 23, 2014 at 7:35 AM, Patricia Gorla
<pa...@thelastpickle.com>wrote:

>
> On Wed, May 21, 2014 at 12:59 AM, opensaf dev <op...@gmail.com>wrote:
>
>> When I run as user cassandra, it starts and runs fine.
>
>
> Why do you want to run Cassandra as a different user?
>
> --
> Patricia Gorla
> @patriciagorla
>
> Consultant
> Apache Cassandra Consulting
> http://www.thelastpickle.com <http://thelastpickle.com>
>

Re: Memory issue

Posted by Patricia Gorla <pa...@thelastpickle.com>.
On Wed, May 21, 2014 at 12:59 AM, opensaf dev <op...@gmail.com> wrote:

> When I run as user cassandra, it starts and runs fine.


Why do you want to run Cassandra as a different user?

-- 
Patricia Gorla
@patriciagorla

Consultant
Apache Cassandra Consulting
http://www.thelastpickle.com <http://thelastpickle.com>

RE: Memory issue

Posted by Romain HARDOUIN <ro...@urssaf.fr>.
Hi,

You have to define limits for the user. 
Here is an example for the user cassandra:

# cat /etc/security/limits.d/cassandra.conf 
cassandra   -   memlock     unlimited
cassandra   -   nofile      100000

best,

Romain

opensaf dev <op...@gmail.com> a écrit sur 21/05/2014 06:59:05 :

> De : opensaf dev <op...@gmail.com>
> A : user@cassandra.apache.org, 
> Date : 21/05/2014 07:00
> Objet : Memory issue
> 
> Hi guys,
> 
> I am trying to run Cassandra on CentOS as an user X other then root 
> or cassandra. When I run as user cassandra, it starts and runs fine.
> But, when I run under user X, I am getting the below error once 
> cassandra started and system freezes totally.
> 
> Insufficient memlock settings:
> WARN [main] 2011-06-15 09:58:56,861 CLibrary.java (line 118) Unable 
> to lock JVM memory (ENOMEM).
> This can result in part of the JVM being swapped out, especially 
> with mmapped I/O enabled.
> Increase RLIMIT_MEMLOCK or run Cassandra as root.
> 
> 
> I have tried the tips available online to change the memlock and 
> other limits both for users cassadra and X, but did not solve the 
problem.
> 

> What else I should consider when I run cassandra other then user 
> cassandra/root.
> 
> 
> Any help is much appreciated.
> 
> 
> Thanks
> Dev
>