Author: buildbot Date: Tue May 6 18:10:56 2014 New Revision: 908217 Log: Staging update by buildbot for accumulo
Modified: websites/staging/accumulo/trunk/content/ (props changed) websites/staging/accumulo/trunk/content/1.6/examples/mapred.html Propchange: websites/staging/accumulo/trunk/content/ ------------------------------------------------------------------------------ --- cms:source-revision (original) +++ cms:source-revision Tue May 6 18:10:56 2014 @@ -1 +1 @@ -1592819 +1592820 Modified: websites/staging/accumulo/trunk/content/1.6/examples/mapred.html ============================================================================== --- websites/staging/accumulo/trunk/content/1.6/examples/mapred.html (original) +++ websites/staging/accumulo/trunk/content/1.6/examples/mapred.html Tue May 6 18:10:56 2014 @@ -281,7 +281,10 @@ explained above except that it uses a to password directly to the map-reduce job (this avoids having the password displayed in the job's configuration which is world-readable).</p> <p>To create a token file, use the create-token utility</p> -<p>$ ./bin/accumulo create-token</p> +<div class="codehilite"><pre>$ <span class="o">./</span><span class="n">bin</span><span class="o">/</span><span class="n">accumulo</span> <span class="n">create</span><span class="o">-</span><span class="n">token</span> +</pre></div> + + <p>It defaults to creating a PasswordToken, but you can specify the token class with -tc (requires the fully qualified class name). Based on the token class, it will prompt you for each property required to create the token.</p> @@ -290,22 +293,34 @@ exists, it will append the new token to a file, but only the first one for each user will be recognized.</p> <p>Rather than waiting for the prompts, you can specify some options when calling create-token, for example</p> -<p>$ ./bin/accumulo create-token -u root -p secret -f root.pw</p> +<div class="codehilite"><pre>$ <span class="o">./</span><span class="n">bin</span><span class="o">/</span><span class="n">accumulo</span> <span class="n">create</span><span class="o">-</span><span class="n">token</span> <span class="o">-</span><span class="n">u</span> <span class="n">root</span> <span class="o">-</span><span class="n">p</span> <span class="n">secret</span> <span class="o">-</span><span class="n">f</span> <span class="n">root</span><span class="p">.</span><span class="n">pw</span> +</pre></div> + + <p>would create a token file containing a PasswordToken for user 'root' with password 'secret' and saved to 'root.pw'</p> <p>This local file needs to be uploaded to hdfs to be used with the map-reduce job. For example, if the file were 'root.pw' in the local directory:</p> -<p>$ hadoop fs -put root.pw root.pw</p> +<div class="codehilite"><pre>$ <span class="n">hadoop</span> <span class="n">fs</span> <span class="o">-</span><span class="n">put</span> <span class="n">root</span><span class="p">.</span><span class="n">pw</span> <span class="n">root</span><span class="p">.</span><span class="n">pw</span> +</pre></div> + + <p>This would put 'root.pw' in the user's home directory in hdfs.</p> <p>Because the basic WordCount example uses Opts to parse its arguments (which extends ClientOnRequiredTable), you can use a token file with the basic WordCount example by calling the same command as explained above except replacing the password with the token file (rather than -p, use -tf).</p> -<p>$ ./bin/tool.sh lib/accumulo-examples-simple.jar org.apache.accumulo.examples.simple.mapreduce.WordCount -i instance -z zookeepers --input /user/username/wc -t wordCount -u username -tf tokenfile</p> +<div class="codehilite"><pre>$ <span class="o">./</span><span class="n">bin</span><span class="o">/</span><span class="n">tool</span><span class="p">.</span><span class="n">sh</span> <span class="n">lib</span><span class="o">/</span><span class="n">accumulo</span><span class="o">-</span><span class="n">examples</span><span class="o">-</span><span class="n">simple</span><span class="p">.</span><span class="n">jar</span> <span class="n">org</span><span class="p">.</span><span class="n">apache</span><span class="p">.</span><span class="n">accumulo</span><span class="p">.</span><span class="n">examples</span><span class="p">.</span><span class="n">simple</span><span class="p">.</span><span class="n">mapreduce</span><span class="p">.</span><span class="n">WordCount</span> <span class="o">-</span><span class="nb">i</span> <span class="n">instance</span> <span class="o">-</span><span class="n">z</span> <span class="n">zookeepers</span> <span class="o">--</span><span class="n">input</span> <span class="o">/</span><span class="n">user</span><span class="o">/</span><span class="n">username</span><span class="o">/</span><span class="n">wc</span> <span class="o">-</span><span class="n">t</span> <span class="n">wordCount</span> <span class="o">-</span><span class="n">u</span> <span class="n">username</span> <span class="o">-</span><span class="n">tf</span> <span class="n">tokenfile</span> +</pre></div> + + <p>In the above examples, username was 'root' and tokenfile was 'root.pw'</p> <p>However, if you don't want to use the Opts class to parse arguments, the TokenFileWordCount is an example of using the token file manually.</p> -<p>$ bin/tool.sh lib/accumulo-examples-simple.jar org.apache.accumulo.examples.simple.mapreduce.TokenFileWordCount instance zookeepers username tokenfile /user/username/wc wordCount</p> +<div class="codehilite"><pre>$ <span class="n">bin</span><span class="o">/</span><span class="n">tool</span><span class="p">.</span><span class="n">sh</span> <span class="n">lib</span><span class="o">/</span><span class="n">accumulo</span><span class="o">-</span><span class="n">examples</span><span class="o">-</span><span class="n">simple</span><span class="p">.</span><span class="n">jar</span> <span class="n">org</span><span class="p">.</span><span class="n">apache</span><span class="p">.</span><span class="n">accumulo</span><span class="p">.</span><span class="n">examples</span><span class="p">.</span><span class="n">simple</span><span class="p">.</span><span class="n">mapreduce</span><span class="p">.</span><span class="n">TokenFileWordCount</span> <span class="n">instance</span> <span class="n">zookeepers</span> <span class="n">username</span> <span class="n">tokenfile</span> <span class="o">/</span><span class="n">user</span><span class="o">/</span><span class="n">username</spa n><span class="o">/</span><span class="n">wc</span> <span class="n">wordCount</span> +</pre></div> + + <p>The results should be the same as the WordCount example except that the authentication token was not stored in the configuration. It was instead stored in a file that the map-reduce job pulled into the distributed cache.