Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Accumulo, mail # user - scripted way to create users


Copy link to this message
-
Re: scripted way to create users
Adam Fuchs 2013-01-18, 16:41
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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]; Ask Stack <[EMAIL PROTECTED]>
> 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 <[EMAIL PROTECTED]> 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.
> >
>