You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@accumulo.apache.org by Ask Stack <as...@yahoo.com> on 2013/01/15 17:20:57 UTC
scripted way to create users
Hello
I like to make an accumulo commands file to create users. Something like "createuser hello -s low" But "createuser" command does not have an option to provide user password. The script will stop and prompt me for the new user password. Does anyone know how to solve this problem?
Thanks.
Re: scripted way to create users
Posted by John Vines <vi...@apache.org>.
Alternatively, you could write a utility using the java API
On Tue, Jan 15, 2013 at 12:07 PM, William Slacum <
wilhelm.von.cloud@accumulo.net> wrote:
> You could redirect input from a file.
>
>
> On Tue, Jan 15, 2013 at 8:20 AM, Ask Stack <as...@yahoo.com> wrote:
>
>> Hello
>> I like to make an accumulo commands file to create users. Something like
>> "createuser hello -s low" But "createuser" command does not have an option
>> to provide user password. The script will stop and prompt me for the new
>> user password. Does anyone know how to solve this problem?
>> Thanks.
>>
>
>
Re: scripted way to create users
Posted by Adam Fuchs <af...@apache.org>.
Using the Java API through JRuby or Jython would be another option. With
Jython, that would look something like this:
> export
JYTHONPATH=$ACCUMULO_HOM/lib/accumulo-core-1.4.2.jar:$ACCUMULO_HOME/lib/log4j-1.2.16.jar:$ZOOKEEPER_HOME/zookeeper-*.jar:$HADOOP_HOME/hadoop-core-1.0.3.jar:$ACCUMULO_HOME/lib/libthrift-0.6.1.jar:$HADOOP_HOME/lib/commons-logging-1.1.1.jar:$HADOOP_HOME/lib/slf4j-log4j12-1.4.3.jar:$HADOOP_HOME/lib/slf4j-api-1.4.3.jar:$ACCUMULO_HOME/lib/cloudtrace-1.4.2.jar
> jython adduser.jython
____contents of adduser.jython_____
import java
from org.apache.accumulo.core.client import ZooKeeperInstance
from org.apache.accumulo.core.security import Authorizations
from org.python.core.util import StringUtil
inst = ZooKeeperInstance("instanceName","localhost")
conn = inst.getConnector("root","password")
conn.securityOperations().createUser("foo",StringUtil.toBytes("bar"),Authorizations())
Cheers,
Adam
On Tue, Jan 15, 2013 at 1:12 PM, Ask Stack <as...@yahoo.com> wrote:
> echo password_file | cbshell -f command_file seems to work. any better
> solutions?
> I am not a programmer so I am not going to try the java option but thanks.
>
>
>
> ________________________________
> From: William Slacum <wi...@accumulo.net>
> To: user@accumulo.apache.org; Ask Stack <as...@yahoo.com>
> Sent: Tuesday, January 15, 2013 12:07 PM
> Subject: Re: scripted way to create users
>
>
> You could redirect input from a file.
>
>
> On Tue, Jan 15, 2013 at 8:20 AM, Ask Stack <as...@yahoo.com> wrote:
>
> Hello
> > I like to make an accumulo commands file to create users. Something like
> "createuser hello -s low" But "createuser" command does not have an option
> to provide user password. The script will stop and prompt me for the new
> user password. Does anyone know how to solve this problem?
> >Thanks.
> >
>
Re: scripted way to create users
Posted by Ask Stack <as...@yahoo.com>.
echo password_file | cbshell -f command_file seems to work. any better solutions?
I am not a programmer so I am not going to try the java option but thanks.
________________________________
From: William Slacum <wi...@accumulo.net>
To: user@accumulo.apache.org; Ask Stack <as...@yahoo.com>
Sent: Tuesday, January 15, 2013 12:07 PM
Subject: Re: scripted way to create users
You could redirect input from a file.
On Tue, Jan 15, 2013 at 8:20 AM, Ask Stack <as...@yahoo.com> wrote:
Hello
> I like to make an accumulo commands file to create users. Something like "createuser hello -s low" But "createuser" command does not have an option to provide user password. The script will stop and prompt me for the new user password. Does anyone know how to solve this problem?
>Thanks.
>
Re: scripted way to create users
Posted by William Slacum <wi...@accumulo.net>.
You could redirect input from a file.
On Tue, Jan 15, 2013 at 8:20 AM, Ask Stack <as...@yahoo.com> wrote:
> Hello
> I like to make an accumulo commands file to create users. Something like
> "createuser hello -s low" But "createuser" command does not have an option
> to provide user password. The script will stop and prompt me for the new
> user password. Does anyone know how to solve this problem?
> Thanks.
>