You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jeremy Hanna (JIRA)" <ji...@apache.org> on 2011/02/15 20:36:58 UTC

[jira] Created: (CASSANDRA-2169) user created with debian packaging is unable to increase memlock

user created with debian packaging is unable to increase memlock
----------------------------------------------------------------

                 Key: CASSANDRA-2169
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2169
             Project: Cassandra
          Issue Type: Bug
          Components: Packaging
            Reporter: Jeremy Hanna
            Priority: Minor


To reproduce:
Install a fresh copy of ubuntu 10.04.
Install sun's java6 jdk.
Install libjna-java 3.2.7 into /usr/share/java.
Install cassandra 0.7.0 from the apache debian packages.
Start cassandra using /etc/init.d/cassandra
In the output.log there will be the following error:
{quote}
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.
{quote}
This shouldn't be as the debian package creates /etc/security/limits.d/cassandra.conf and sets the cassandra user's memlock limit to 'unlimited'.

I tried a variety of things including making the memlock unlimited for all users in /etc/security/limits.conf.  I was able to run cassandra using root with jna by symbolically linked into /usr/share/cassandra from /usr/share/java, but I could never get the init.d script to work and get beyond that error.

Based on all the trial and error, I think it might have to do with the cassandra user itself, but my debian/ubuntu fu isn't as good as others'.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (CASSANDRA-2169) user created with debian packaging is unable to increase memlock

Posted by "paul cannon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12996243#comment-12996243 ] 

paul cannon commented on CASSANDRA-2169:
----------------------------------------

Actually, durr, you could just do 'ulimit -l unlimited' in sh before switching users. It should stick. Sorry, I'm slow tonight.

Still might be a good idea to keep limits.d/cassandra.conf around, in case people want to su or sudo to the cassandra user for testing stuff.

> user created with debian packaging is unable to increase memlock
> ----------------------------------------------------------------
>
>                 Key: CASSANDRA-2169
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2169
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>            Reporter: Jeremy Hanna
>            Priority: Minor
>
> To reproduce:
> - Install a fresh copy of ubuntu 10.04.
> - Install sun's java6 jdk.
> - Install libjna-java 3.2.7 into /usr/share/java.
> - Install cassandra 0.7.0 from the apache debian packages.
> - Start cassandra using /etc/init.d/cassandra
> In the output.log there will be the following error:
> {quote}
> 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.
> {quote}
> This shouldn't be as the debian package creates /etc/security/limits.d/cassandra.conf and sets the cassandra user's memlock limit to 'unlimited'.
> I tried a variety of things including making the memlock unlimited for all users in /etc/security/limits.conf.  I was able to run cassandra using root with jna symbolically linked into /usr/share/cassandra from /usr/share/java, but I could never get the init.d script to work and get beyond that error.
> Based on all the trial and error, I think it might have to do with the cassandra user itself, but my debian/ubuntu fu isn't as good as others'.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (CASSANDRA-2169) user created with debian packaging is unable to increase memlock

Posted by "Jeremy Hanna (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12996493#comment-12996493 ] 

Jeremy Hanna commented on CASSANDRA-2169:
-----------------------------------------

Paul: so is that something that would go in the /debian configuration as a change?  Would you like me to try that in my test server and see if that resolves the problem?

> user created with debian packaging is unable to increase memlock
> ----------------------------------------------------------------
>
>                 Key: CASSANDRA-2169
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2169
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>            Reporter: Jeremy Hanna
>            Priority: Minor
>
> To reproduce:
> - Install a fresh copy of ubuntu 10.04.
> - Install sun's java6 jdk.
> - Install libjna-java 3.2.7 into /usr/share/java.
> - Install cassandra 0.7.0 from the apache debian packages.
> - Start cassandra using /etc/init.d/cassandra
> In the output.log there will be the following error:
> {quote}
> 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.
> {quote}
> This shouldn't be as the debian package creates /etc/security/limits.d/cassandra.conf and sets the cassandra user's memlock limit to 'unlimited'.
> I tried a variety of things including making the memlock unlimited for all users in /etc/security/limits.conf.  I was able to run cassandra using root with jna symbolically linked into /usr/share/cassandra from /usr/share/java, but I could never get the init.d script to work and get beyond that error.
> Based on all the trial and error, I think it might have to do with the cassandra user itself, but my debian/ubuntu fu isn't as good as others'.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (CASSANDRA-2169) user created with debian packaging is unable to increase memlock

Posted by "Jeremy Hanna (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeremy Hanna updated CASSANDRA-2169:
------------------------------------

    Description: 
To reproduce:
- Install a fresh copy of ubuntu 10.04.
- Install sun's java6 jdk.
- Install libjna-java 3.2.7 into /usr/share/java.
- Install cassandra 0.7.0 from the apache debian packages.
- Start cassandra using /etc/init.d/cassandra
In the output.log there will be the following error:
{quote}
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.
{quote}
This shouldn't be as the debian package creates /etc/security/limits.d/cassandra.conf and sets the cassandra user's memlock limit to 'unlimited'.

I tried a variety of things including making the memlock unlimited for all users in /etc/security/limits.conf.  I was able to run cassandra using root with jna symbolically linked into /usr/share/cassandra from /usr/share/java, but I could never get the init.d script to work and get beyond that error.

Based on all the trial and error, I think it might have to do with the cassandra user itself, but my debian/ubuntu fu isn't as good as others'.

  was:
To reproduce:
- Install a fresh copy of ubuntu 10.04.
- Install sun's java6 jdk.
- Install libjna-java 3.2.7 into /usr/share/java.
- Install cassandra 0.7.0 from the apache debian packages.
- Start cassandra using /etc/init.d/cassandra
In the output.log there will be the following error:
{quote}
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.
{quote}
This shouldn't be as the debian package creates /etc/security/limits.d/cassandra.conf and sets the cassandra user's memlock limit to 'unlimited'.

I tried a variety of things including making the memlock unlimited for all users in /etc/security/limits.conf.  I was able to run cassandra using root with jna by symbolically linked into /usr/share/cassandra from /usr/share/java, but I could never get the init.d script to work and get beyond that error.

Based on all the trial and error, I think it might have to do with the cassandra user itself, but my debian/ubuntu fu isn't as good as others'.


> user created with debian packaging is unable to increase memlock
> ----------------------------------------------------------------
>
>                 Key: CASSANDRA-2169
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2169
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>            Reporter: Jeremy Hanna
>            Priority: Minor
>
> To reproduce:
> - Install a fresh copy of ubuntu 10.04.
> - Install sun's java6 jdk.
> - Install libjna-java 3.2.7 into /usr/share/java.
> - Install cassandra 0.7.0 from the apache debian packages.
> - Start cassandra using /etc/init.d/cassandra
> In the output.log there will be the following error:
> {quote}
> 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.
> {quote}
> This shouldn't be as the debian package creates /etc/security/limits.d/cassandra.conf and sets the cassandra user's memlock limit to 'unlimited'.
> I tried a variety of things including making the memlock unlimited for all users in /etc/security/limits.conf.  I was able to run cassandra using root with jna symbolically linked into /usr/share/cassandra from /usr/share/java, but I could never get the init.d script to work and get beyond that error.
> Based on all the trial and error, I think it might have to do with the cassandra user itself, but my debian/ubuntu fu isn't as good as others'.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (CASSANDRA-2169) user created with debian packaging is unable to increase memlock

Posted by "Jeremy Hanna (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12995524#comment-12995524 ] 

Jeremy Hanna edited comment on CASSANDRA-2169 at 2/16/11 9:18 PM:
------------------------------------------------------------------

Based on a suggestion from jake and brandon, I added {quote}session required pam_limits.so{quote} to /etc/pam.d/common-session and rebooted.  That made it so the memlock value was set correctly.  However, for some reason, using /etc/init.d/cassandra still gives the memory locking error.  I su to the cassandra user and run {quote}/usr/sbin/cassandra -f{quote} and it is able to lock the memory.

For the pam setting, see http://posidev.com/blog/2009/06/04/set-ulimit-parameters-on-ubuntu/

      was (Author: jeromatron):
    Based on a suggestion from jake and brandon, I added {quote}session required pam_limits.so{quote} to /etc/pam.d/common-session and rebooted.  That made it so the memlock value was set correctly.  However, for some reason, using /etc/init.d/cassandra still gives the memory locking error.  I su to the cassandra user and run {quote}/usr/sbin/cassandra -f{quote} and it is able to lock the memory.
  
> user created with debian packaging is unable to increase memlock
> ----------------------------------------------------------------
>
>                 Key: CASSANDRA-2169
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2169
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>            Reporter: Jeremy Hanna
>            Priority: Minor
>
> To reproduce:
> - Install a fresh copy of ubuntu 10.04.
> - Install sun's java6 jdk.
> - Install libjna-java 3.2.7 into /usr/share/java.
> - Install cassandra 0.7.0 from the apache debian packages.
> - Start cassandra using /etc/init.d/cassandra
> In the output.log there will be the following error:
> {quote}
> 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.
> {quote}
> This shouldn't be as the debian package creates /etc/security/limits.d/cassandra.conf and sets the cassandra user's memlock limit to 'unlimited'.
> I tried a variety of things including making the memlock unlimited for all users in /etc/security/limits.conf.  I was able to run cassandra using root with jna symbolically linked into /usr/share/cassandra from /usr/share/java, but I could never get the init.d script to work and get beyond that error.
> Based on all the trial and error, I think it might have to do with the cassandra user itself, but my debian/ubuntu fu isn't as good as others'.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (CASSANDRA-2169) user created with debian packaging is unable to increase memlock

Posted by "Brandon Williams (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12995451#comment-12995451 ] 

Brandon Williams commented on CASSANDRA-2169:
---------------------------------------------

Just to be certain limits.conf is taking effect, have you tried rebooting the box since changing it?

> user created with debian packaging is unable to increase memlock
> ----------------------------------------------------------------
>
>                 Key: CASSANDRA-2169
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2169
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>            Reporter: Jeremy Hanna
>            Priority: Minor
>
> To reproduce:
> - Install a fresh copy of ubuntu 10.04.
> - Install sun's java6 jdk.
> - Install libjna-java 3.2.7 into /usr/share/java.
> - Install cassandra 0.7.0 from the apache debian packages.
> - Start cassandra using /etc/init.d/cassandra
> In the output.log there will be the following error:
> {quote}
> 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.
> {quote}
> This shouldn't be as the debian package creates /etc/security/limits.d/cassandra.conf and sets the cassandra user's memlock limit to 'unlimited'.
> I tried a variety of things including making the memlock unlimited for all users in /etc/security/limits.conf.  I was able to run cassandra using root with jna symbolically linked into /usr/share/cassandra from /usr/share/java, but I could never get the init.d script to work and get beyond that error.
> Based on all the trial and error, I think it might have to do with the cassandra user itself, but my debian/ubuntu fu isn't as good as others'.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (CASSANDRA-2169) user created with debian packaging is unable to increase memlock

Posted by "Brandon Williams (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12995446#comment-12995446 ] 

Brandon Williams commented on CASSANDRA-2169:
---------------------------------------------

What happens if you su to the cassandra user and check ulimit?

> user created with debian packaging is unable to increase memlock
> ----------------------------------------------------------------
>
>                 Key: CASSANDRA-2169
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2169
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>            Reporter: Jeremy Hanna
>            Priority: Minor
>
> To reproduce:
> - Install a fresh copy of ubuntu 10.04.
> - Install sun's java6 jdk.
> - Install libjna-java 3.2.7 into /usr/share/java.
> - Install cassandra 0.7.0 from the apache debian packages.
> - Start cassandra using /etc/init.d/cassandra
> In the output.log there will be the following error:
> {quote}
> 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.
> {quote}
> This shouldn't be as the debian package creates /etc/security/limits.d/cassandra.conf and sets the cassandra user's memlock limit to 'unlimited'.
> I tried a variety of things including making the memlock unlimited for all users in /etc/security/limits.conf.  I was able to run cassandra using root with jna symbolically linked into /usr/share/cassandra from /usr/share/java, but I could never get the init.d script to work and get beyond that error.
> Based on all the trial and error, I think it might have to do with the cassandra user itself, but my debian/ubuntu fu isn't as good as others'.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (CASSANDRA-2169) user created with debian packaging is unable to increase memlock

Posted by "Jeremy Hanna (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12994961#comment-12994961 ] 

Jeremy Hanna commented on CASSANDRA-2169:
-----------------------------------------

Upgraded to 0.7.1 and still appears to have the same issue.

> user created with debian packaging is unable to increase memlock
> ----------------------------------------------------------------
>
>                 Key: CASSANDRA-2169
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2169
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>            Reporter: Jeremy Hanna
>            Priority: Minor
>
> To reproduce:
> - Install a fresh copy of ubuntu 10.04.
> - Install sun's java6 jdk.
> - Install libjna-java 3.2.7 into /usr/share/java.
> - Install cassandra 0.7.0 from the apache debian packages.
> - Start cassandra using /etc/init.d/cassandra
> In the output.log there will be the following error:
> {quote}
> 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.
> {quote}
> This shouldn't be as the debian package creates /etc/security/limits.d/cassandra.conf and sets the cassandra user's memlock limit to 'unlimited'.
> I tried a variety of things including making the memlock unlimited for all users in /etc/security/limits.conf.  I was able to run cassandra using root with jna symbolically linked into /usr/share/cassandra from /usr/share/java, but I could never get the init.d script to work and get beyond that error.
> Based on all the trial and error, I think it might have to do with the cassandra user itself, but my debian/ubuntu fu isn't as good as others'.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (CASSANDRA-2169) user created with debian packaging is unable to increase memlock

Posted by "Jeremy Hanna (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12995455#comment-12995455 ] 

Jeremy Hanna commented on CASSANDRA-2169:
-----------------------------------------

I made sure it took effect for the user I originally logged in as - ubuntu for my ec2 instance and jeremy for my local vm.  It took effect for those users whenever I changed it.  I also tried rebooting.  That was the way it took effect for the ec2 server's ubuntu user iirc.  But it didn't take effect for the cassandra user.

> user created with debian packaging is unable to increase memlock
> ----------------------------------------------------------------
>
>                 Key: CASSANDRA-2169
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2169
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>            Reporter: Jeremy Hanna
>            Priority: Minor
>
> To reproduce:
> - Install a fresh copy of ubuntu 10.04.
> - Install sun's java6 jdk.
> - Install libjna-java 3.2.7 into /usr/share/java.
> - Install cassandra 0.7.0 from the apache debian packages.
> - Start cassandra using /etc/init.d/cassandra
> In the output.log there will be the following error:
> {quote}
> 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.
> {quote}
> This shouldn't be as the debian package creates /etc/security/limits.d/cassandra.conf and sets the cassandra user's memlock limit to 'unlimited'.
> I tried a variety of things including making the memlock unlimited for all users in /etc/security/limits.conf.  I was able to run cassandra using root with jna symbolically linked into /usr/share/cassandra from /usr/share/java, but I could never get the init.d script to work and get beyond that error.
> Based on all the trial and error, I think it might have to do with the cassandra user itself, but my debian/ubuntu fu isn't as good as others'.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (CASSANDRA-2169) user created with debian packaging is unable to increase memlock

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12996242#comment-12996242 ] 

Jonathan Ellis commented on CASSANDRA-2169:
-------------------------------------------

bq. 2: implement limit setting and user switching in cassandra itself. is there any good way to do setrlimit() and setuid() in java?

No, you'd have to write a JNI wrapper or use JNA.  (Which I guess is technically feasible since JNA is packaged for both deb and rpm but eww. :)

> user created with debian packaging is unable to increase memlock
> ----------------------------------------------------------------
>
>                 Key: CASSANDRA-2169
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2169
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>            Reporter: Jeremy Hanna
>            Priority: Minor
>
> To reproduce:
> - Install a fresh copy of ubuntu 10.04.
> - Install sun's java6 jdk.
> - Install libjna-java 3.2.7 into /usr/share/java.
> - Install cassandra 0.7.0 from the apache debian packages.
> - Start cassandra using /etc/init.d/cassandra
> In the output.log there will be the following error:
> {quote}
> 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.
> {quote}
> This shouldn't be as the debian package creates /etc/security/limits.d/cassandra.conf and sets the cassandra user's memlock limit to 'unlimited'.
> I tried a variety of things including making the memlock unlimited for all users in /etc/security/limits.conf.  I was able to run cassandra using root with jna symbolically linked into /usr/share/cassandra from /usr/share/java, but I could never get the init.d script to work and get beyond that error.
> Based on all the trial and error, I think it might have to do with the cassandra user itself, but my debian/ubuntu fu isn't as good as others'.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (CASSANDRA-2169) user created with debian packaging is unable to increase memlock

Posted by "paul cannon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12996240#comment-12996240 ] 

paul cannon commented on CASSANDRA-2169:
----------------------------------------

I grepped through jsvc's source, and I don't see any references to pam at all. So unless the jre has some special "switch users and set up a pam session" functionality I don't know about, jsvc isn't setting up a pam session when switching users.

This means limits.conf (and limits.d/cassandra.conf) are useless, except in what they define for root's resource limits.

If we want to use both limits.conf and jsvc, then hrm. Maybe we could switch users in the initscript using /bin/su, but afaik default debian and ubuntu systems all comment out pam_limits.so from /etc/pam.d/su , so that wouldn't work without monkeying with users' conffiles.

We could switch users in the initscript with sudo, but it's pretty hard to be sure the user hasn't done something funky with their sudoers file which would break our startup.

I can only come up with 2 halfway-decent options: both involve ditching limits.d/cassandra.conf.

1: just /bin/su in the initscript and do a 'ulimit -l unlimited' in the child before exec'ing jsvc.

2: implement limit setting and user switching in cassandra itself. is there any good way to do setrlimit() and setuid() in java?

> user created with debian packaging is unable to increase memlock
> ----------------------------------------------------------------
>
>                 Key: CASSANDRA-2169
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2169
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>            Reporter: Jeremy Hanna
>            Priority: Minor
>
> To reproduce:
> - Install a fresh copy of ubuntu 10.04.
> - Install sun's java6 jdk.
> - Install libjna-java 3.2.7 into /usr/share/java.
> - Install cassandra 0.7.0 from the apache debian packages.
> - Start cassandra using /etc/init.d/cassandra
> In the output.log there will be the following error:
> {quote}
> 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.
> {quote}
> This shouldn't be as the debian package creates /etc/security/limits.d/cassandra.conf and sets the cassandra user's memlock limit to 'unlimited'.
> I tried a variety of things including making the memlock unlimited for all users in /etc/security/limits.conf.  I was able to run cassandra using root with jna symbolically linked into /usr/share/cassandra from /usr/share/java, but I could never get the init.d script to work and get beyond that error.
> Based on all the trial and error, I think it might have to do with the cassandra user itself, but my debian/ubuntu fu isn't as good as others'.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (CASSANDRA-2169) user created with debian packaging is unable to increase memlock

Posted by "Jeremy Hanna (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12995449#comment-12995449 ] 

Jeremy Hanna edited comment on CASSANDRA-2169 at 2/16/11 6:51 PM:
------------------------------------------------------------------

"ulimit -l" always returns 64.

I gave the cassandra user a shell so I can su to that user.  When I do, the memlock doesn't ever take - whether it's defined in /etc/security/limits.conf for the cassandra user, for all users '*', or in the /etc/security/limits.d/cassandra.conf.

      was (Author: jeromatron):
    "ulimit -l" always returns 64.

I gave the cassandra user a shell so I can su to that user.  When I do, the memlock doesn't ever take - whether it's defined in /etc/security/limits.conf for the cassandra user, for all users (*), or in the /etc/security/limits.d/cassandra.conf.
  
> user created with debian packaging is unable to increase memlock
> ----------------------------------------------------------------
>
>                 Key: CASSANDRA-2169
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2169
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>            Reporter: Jeremy Hanna
>            Priority: Minor
>
> To reproduce:
> - Install a fresh copy of ubuntu 10.04.
> - Install sun's java6 jdk.
> - Install libjna-java 3.2.7 into /usr/share/java.
> - Install cassandra 0.7.0 from the apache debian packages.
> - Start cassandra using /etc/init.d/cassandra
> In the output.log there will be the following error:
> {quote}
> 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.
> {quote}
> This shouldn't be as the debian package creates /etc/security/limits.d/cassandra.conf and sets the cassandra user's memlock limit to 'unlimited'.
> I tried a variety of things including making the memlock unlimited for all users in /etc/security/limits.conf.  I was able to run cassandra using root with jna symbolically linked into /usr/share/cassandra from /usr/share/java, but I could never get the init.d script to work and get beyond that error.
> Based on all the trial and error, I think it might have to do with the cassandra user itself, but my debian/ubuntu fu isn't as good as others'.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (CASSANDRA-2169) user created with debian packaging is unable to increase memlock

Posted by "Jeremy Hanna (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12995449#comment-12995449 ] 

Jeremy Hanna commented on CASSANDRA-2169:
-----------------------------------------

"ulimit -l" always returns 64.

I gave the cassandra user a shell so I can su to that user.  When I do, the memlock doesn't ever take - whether it's defined in /etc/security/limits.conf for the cassandra user, for all users (*), or in the /etc/security/limits.d/cassandra.conf.

> user created with debian packaging is unable to increase memlock
> ----------------------------------------------------------------
>
>                 Key: CASSANDRA-2169
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2169
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>            Reporter: Jeremy Hanna
>            Priority: Minor
>
> To reproduce:
> - Install a fresh copy of ubuntu 10.04.
> - Install sun's java6 jdk.
> - Install libjna-java 3.2.7 into /usr/share/java.
> - Install cassandra 0.7.0 from the apache debian packages.
> - Start cassandra using /etc/init.d/cassandra
> In the output.log there will be the following error:
> {quote}
> 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.
> {quote}
> This shouldn't be as the debian package creates /etc/security/limits.d/cassandra.conf and sets the cassandra user's memlock limit to 'unlimited'.
> I tried a variety of things including making the memlock unlimited for all users in /etc/security/limits.conf.  I was able to run cassandra using root with jna symbolically linked into /usr/share/cassandra from /usr/share/java, but I could never get the init.d script to work and get beyond that error.
> Based on all the trial and error, I think it might have to do with the cassandra user itself, but my debian/ubuntu fu isn't as good as others'.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (CASSANDRA-2169) user created with debian packaging is unable to increase memlock

Posted by "Jeremy Hanna (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12996562#comment-12996562 ] 

Jeremy Hanna commented on CASSANDRA-2169:
-----------------------------------------

so adding that manually to the /etc/init.d/cassandra script does the trick.  I will submit a patch that adds that.  Thanks guys!

> user created with debian packaging is unable to increase memlock
> ----------------------------------------------------------------
>
>                 Key: CASSANDRA-2169
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2169
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>            Reporter: Jeremy Hanna
>            Priority: Minor
>
> To reproduce:
> - Install a fresh copy of ubuntu 10.04.
> - Install sun's java6 jdk.
> - Install libjna-java 3.2.7 into /usr/share/java.
> - Install cassandra 0.7.0 from the apache debian packages.
> - Start cassandra using /etc/init.d/cassandra
> In the output.log there will be the following error:
> {quote}
> 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.
> {quote}
> This shouldn't be as the debian package creates /etc/security/limits.d/cassandra.conf and sets the cassandra user's memlock limit to 'unlimited'.
> I tried a variety of things including making the memlock unlimited for all users in /etc/security/limits.conf.  I was able to run cassandra using root with jna symbolically linked into /usr/share/cassandra from /usr/share/java, but I could never get the init.d script to work and get beyond that error.
> Based on all the trial and error, I think it might have to do with the cassandra user itself, but my debian/ubuntu fu isn't as good as others'.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (CASSANDRA-2169) user created with debian packaging is unable to increase memlock

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12996929#comment-12996929 ] 

Hudson commented on CASSANDRA-2169:
-----------------------------------

Integrated in Cassandra-0.7 #299 (See [https://hudson.apache.org/hudson/job/Cassandra-0.7/299/])
    increase memlock at daemon startup

Patch by Jeremy Hanna; reviewed by eevans for CASSANDRA-2169


> user created with debian packaging is unable to increase memlock
> ----------------------------------------------------------------
>
>                 Key: CASSANDRA-2169
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2169
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>    Affects Versions: 0.7.2
>            Reporter: Jeremy Hanna
>            Assignee: Jeremy Hanna
>            Priority: Minor
>             Fix For: 0.7.3
>
>         Attachments: 2169-0_7.txt
>
>
> To reproduce:
> - Install a fresh copy of ubuntu 10.04.
> - Install sun's java6 jdk.
> - Install libjna-java 3.2.7 into /usr/share/java.
> - Install cassandra 0.7.0 from the apache debian packages.
> - Start cassandra using /etc/init.d/cassandra
> In the output.log there will be the following error:
> {quote}
> 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.
> {quote}
> This shouldn't be as the debian package creates /etc/security/limits.d/cassandra.conf and sets the cassandra user's memlock limit to 'unlimited'.
> I tried a variety of things including making the memlock unlimited for all users in /etc/security/limits.conf.  I was able to run cassandra using root with jna symbolically linked into /usr/share/cassandra from /usr/share/java, but I could never get the init.d script to work and get beyond that error.
> Based on all the trial and error, I think it might have to do with the cassandra user itself, but my debian/ubuntu fu isn't as good as others'.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (CASSANDRA-2169) user created with debian packaging is unable to increase memlock

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-2169:
--------------------------------------

    Reviewer: urandom

> user created with debian packaging is unable to increase memlock
> ----------------------------------------------------------------
>
>                 Key: CASSANDRA-2169
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2169
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>    Affects Versions: 0.7.2
>            Reporter: Jeremy Hanna
>            Assignee: Jeremy Hanna
>            Priority: Minor
>             Fix For: 0.7.3
>
>         Attachments: 2169-0_7.txt
>
>
> To reproduce:
> - Install a fresh copy of ubuntu 10.04.
> - Install sun's java6 jdk.
> - Install libjna-java 3.2.7 into /usr/share/java.
> - Install cassandra 0.7.0 from the apache debian packages.
> - Start cassandra using /etc/init.d/cassandra
> In the output.log there will be the following error:
> {quote}
> 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.
> {quote}
> This shouldn't be as the debian package creates /etc/security/limits.d/cassandra.conf and sets the cassandra user's memlock limit to 'unlimited'.
> I tried a variety of things including making the memlock unlimited for all users in /etc/security/limits.conf.  I was able to run cassandra using root with jna symbolically linked into /usr/share/cassandra from /usr/share/java, but I could never get the init.d script to work and get beyond that error.
> Based on all the trial and error, I think it might have to do with the cassandra user itself, but my debian/ubuntu fu isn't as good as others'.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (CASSANDRA-2169) user created with debian packaging is unable to increase memlock

Posted by "Jeremy Hanna (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12995524#comment-12995524 ] 

Jeremy Hanna commented on CASSANDRA-2169:
-----------------------------------------

Based on a suggestion from jake and brandon, I added {quote}session required pam_limits.so{quote} to /etc/pam.d/common-session and rebooted.  That made it so the memlock value was set correctly.  However, for some reason, using /etc/init.d/cassandra still gives the memory locking error.  I su to the cassandra user and run {quote}/usr/sbin/cassandra -f{quote} and it is able to lock the memory.

> user created with debian packaging is unable to increase memlock
> ----------------------------------------------------------------
>
>                 Key: CASSANDRA-2169
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2169
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>            Reporter: Jeremy Hanna
>            Priority: Minor
>
> To reproduce:
> - Install a fresh copy of ubuntu 10.04.
> - Install sun's java6 jdk.
> - Install libjna-java 3.2.7 into /usr/share/java.
> - Install cassandra 0.7.0 from the apache debian packages.
> - Start cassandra using /etc/init.d/cassandra
> In the output.log there will be the following error:
> {quote}
> 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.
> {quote}
> This shouldn't be as the debian package creates /etc/security/limits.d/cassandra.conf and sets the cassandra user's memlock limit to 'unlimited'.
> I tried a variety of things including making the memlock unlimited for all users in /etc/security/limits.conf.  I was able to run cassandra using root with jna symbolically linked into /usr/share/cassandra from /usr/share/java, but I could never get the init.d script to work and get beyond that error.
> Based on all the trial and error, I think it might have to do with the cassandra user itself, but my debian/ubuntu fu isn't as good as others'.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (CASSANDRA-2169) user created with debian packaging is unable to increase memlock

Posted by "Jeremy Hanna (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeremy Hanna updated CASSANDRA-2169:
------------------------------------

    Attachment: 2169-0_7.txt

> user created with debian packaging is unable to increase memlock
> ----------------------------------------------------------------
>
>                 Key: CASSANDRA-2169
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2169
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>    Affects Versions: 0.7.2
>            Reporter: Jeremy Hanna
>            Assignee: Jeremy Hanna
>            Priority: Minor
>             Fix For: 0.7.3
>
>         Attachments: 2169-0_7.txt
>
>
> To reproduce:
> - Install a fresh copy of ubuntu 10.04.
> - Install sun's java6 jdk.
> - Install libjna-java 3.2.7 into /usr/share/java.
> - Install cassandra 0.7.0 from the apache debian packages.
> - Start cassandra using /etc/init.d/cassandra
> In the output.log there will be the following error:
> {quote}
> 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.
> {quote}
> This shouldn't be as the debian package creates /etc/security/limits.d/cassandra.conf and sets the cassandra user's memlock limit to 'unlimited'.
> I tried a variety of things including making the memlock unlimited for all users in /etc/security/limits.conf.  I was able to run cassandra using root with jna symbolically linked into /usr/share/cassandra from /usr/share/java, but I could never get the init.d script to work and get beyond that error.
> Based on all the trial and error, I think it might have to do with the cassandra user itself, but my debian/ubuntu fu isn't as good as others'.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira