You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by vi...@apache.org on 2012/03/09 17:10:33 UTC

svn commit: r1298898 - in /incubator/accumulo/trunk: ./ README src/server/src/main/resources/web/vis.xml

Author: vines
Date: Fri Mar  9 16:10:32 2012
New Revision: 1298898

URL: http://svn.apache.org/viewvc?rev=1298898&view=rev
Log:
Merging ACCUMULO-404 and some visualization thing


Modified:
    incubator/accumulo/trunk/   (props changed)
    incubator/accumulo/trunk/README
    incubator/accumulo/trunk/src/server/src/main/resources/web/vis.xml

Propchange: incubator/accumulo/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar  9 16:10:32 2012
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215,1227231,1227611,1228195,1230180,1230736,1231043,1236873,1245632
 /incubator/accumulo/branches/1.3.5rc:1209938
-/incubator/accumulo/branches/1.4:1201902-1298163
+/incubator/accumulo/branches/1.4:1201902-1298897

Modified: incubator/accumulo/trunk/README
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/README?rev=1298898&r1=1298897&r2=1298898&view=diff
==============================================================================
--- incubator/accumulo/trunk/README (original)
+++ incubator/accumulo/trunk/README Fri Mar  9 16:10:32 2012
@@ -170,6 +170,53 @@ certain column.
     row1 colf1:colq2 []    val2
 
 
+If you are running on top of hdfs with kerberos enabled, then you need to do
+some extra work. We currently do not internally support kerberos, so you must
+manually manage the accumulo users tickets. First, create an accumulo principal
+
+  kadmin.local -q "addprinc -randkey accumulo/<host.domain.name>"
+
+where <host.domain.name> is replaced by a fully qualified domain name. Export
+the principals to a keytab file
+
+  kadmin.local -q "xst -k accumulo.keytab -glob accumulo*"
+
+Place this file in $ACCUMULO_HOME/conf for every host. It should be owned by
+the accumulo user and chmodded to 400. Add the following to the accumulo-env.sh
+
+  kinit -kt $ACCUMULO_HOME/conf/accumulo.keytab accumulo/`hostname -f`
+
+And set the following crontab for every host
+
+  0 5 * * * kinit -kt $ACCUMULO_HOME/conf/accumulo.keytab accumulo/`hostname -f`
+
+Additionally, adjust the $ACCUMULO_HOME/conf/monitor.security.policy to change
+
+  permission java.util.PropertyPermission "*", "read";
+
+to
+  
+  permission java.util.PropertyPermission "*", "read,write";
+
+And add these lines to the end of the policy file
+
+  permission javax.security.auth.AuthPermission "createLoginContext.hadoop-user-kerberos";
+  permission java.lang.RuntimePermission "createSecurityManager";
+  permission javax.security.auth.AuthPermission "doAs";
+  permission javax.security.auth.AuthPermission "getPolicy";
+  permission java.security.SecurityPermission "createAccessControlContext";
+  permission javax.security.auth.AuthPermission "getSubjectFromDomainCombiner";
+  permission java.lang.RuntimePermission "getProtectionDomain";
+  permission javax.security.auth.AuthPermission "modifyPrivateCredentials";
+  permission javax.security.auth.PrivateCredentialPermission "javax.security.auth.kerberos.KerberosTicket javax.security.auth.kerberos.KerberosPrincipal \"*\"", "read";
+  permission javax.security.auth.kerberos.ServicePermission "krbtgt/<REALM>@<REALM>", "initiate";
+  permission javax.security.auth.kerberos.ServicePermission "hdfs/<namenode.domain.name>@<REALM>", "initiate";
+  permission javax.security.auth.kerberos.ServicePermission "mapred/<jobtracker.domain.name>@<REALM>", "initiate";
+
+Where <REALM> is replaced with the kerberos realm for the Hadoop cluster, 
+<namenode.domain.name> is replaced with the fully qualified domain name of the 
+server running the namenode and <jobtracker.domain.name> is replaced with the 
+fully qualified domain name of the server running the job tracker.
 
 
 ******************************************************************************

Modified: incubator/accumulo/trunk/src/server/src/main/resources/web/vis.xml
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/resources/web/vis.xml?rev=1298898&r1=1298897&r2=1298898&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/resources/web/vis.xml (original)
+++ incubator/accumulo/trunk/src/server/src/main/resources/web/vis.xml Fri Mar  9 16:10:32 2012
@@ -28,7 +28,6 @@ var maxDotRadius = dotSpacing - dotPaddi
 var dotSize = new Array(numDots); // current sizes
 var dotSizeGrowing = new Array(numDots); // true when dot size is growing, false when shrinking
 var ids = new Array(numDots); // server ids
-var extras = new Array(numDots); // info from which color and motion is derived
 var mousedDot = 0; // the dot currently under the mouse
 
 var allStats = new Array(numDots);
@@ -59,9 +58,11 @@ setSize(document.getElementById('size'))
 // xml loading variables
 var xmlReturned = true;
 var xmlhttp=new XMLHttpRequest(); // don't bother allowing for IE 5 or 6 since canvas won't work
+xmlhttp.overrideMimeType("text/xml");
 xmlhttp.onreadystatechange=function() {
   handleNewData();
 }
+self.setInterval("getXML()",5000);
 
 window.requestAnimFrame = (function(callback){
   return window.requestAnimationFrame ||
@@ -90,15 +91,12 @@ function handleNewData() {
   var statValues = new Array(numNormalStats);
   for (i=0; i < idinfo.length; i++) {
     var info = idinfo[i].attributes[0].nodeValue;
-    var extra = ' (' + hostinfo[i].childNodes[0].nodeValue + ')';
+    var host = hostinfo[i].childNodes[0].nodeValue;
     for (j=0; j < numNormalStats; j++) {
-      if (j % 4 == 0)
-        extra = extra + '<br>\n';
       statValues[j] = Math.max(0,Math.floor(significance[j]*parseFloat(statinfo[j][i].childNodes[0].nodeValue))/significance[j]);
-      extra = extra + '&nbsp;&nbsp;' + statName[j] + ': <strong>' + statValues[j] + '</strong>';
     }
     setStats(statValues,i);
-    setDotInfo(info,extra,i);
+    setDotInfo(info,host,i);
   }
   numLive = idinfo.length;
   resetOverallStats();
@@ -115,8 +113,9 @@ function handleNewData() {
   xmlReturned = true;
 }
 
+// set the data for a given server
 function setStats(statValues,index) {
-  var newStats = new Array(numNormalStats+2);
+  var newStats = new Array(numNormalStats+3);
   for (j=0; j < numNormalStats; j++) {
     if (adjustMax[j])
       maxStatValue[j] = Math.max(statValues[j],maxStatValue[j]);
@@ -129,6 +128,7 @@ function setStats(statValues,index) {
     allStats[index] = newStats;
 }
 
+// set max and average
 function setOverallStats(statValues) {
   avgStat = 0;
   maxStat = 0;
@@ -146,36 +146,55 @@ function setOverallStats(statValues) {
   maxStat = Math.min(1,maxStat);
   statValues[numNormalStats] = Math.floor(significance[numNormalStats]*avgStat)/significance[numNormalStats];
   statValues[numNormalStats+1] = Math.floor(significance[numNormalStats+1]*maxStat)/significance[numNormalStats+1];
-  return maxIndex;
+  statValues[numNormalStats+2] = maxIndex;
 }
 
+// reset max and average for all servers (global maxes may have changed)
 function resetOverallStats() {
   for (i=0; i < numLive; i++) {
-    maxIndex = setOverallStats(allStats[i]);
-    extras[i] = extras[i] + '<br>\n&nbsp;&nbsp;avg: <strong>' + allStats[i][numNormalStats] + '</strong>&nbsp;&nbsp;max: <strong>' + allStats[i][numNormalStats+1] + '</strong> (' + statName[maxIndex] + ')';
+    setOverallStats(allStats[i]);
   }
 }
 
-function setDotInfo(id,extra,index) {
+// initialize or update dot info
+function setDotInfo(id,host,index) {
   if (index >= ids.length) {
-    ids.push(id);
-    extras.push(extra);
+    ids.push([id,host]);
     dotSize.push(maxDotRadius);
     dotSizeGrowing.push(false);
   } else {
-    ids[index] = id;
-    extras[index] = extra;
+    ids[index] = [id,host];
     // keep existing size and direction
   }
 }
 
-function drawDots(){
-  requestAnimFrame(drawDots);
+// construct server info for hover
+function getInfo(i) {
+  var extra = '<strong>' + ids[i][0] + '</strong>';
+  if (i < numLive) {
+    extra = extra + ' (' + ids[i][1] + ')';
+    for (j=0; j < numNormalStats; j++) {
+      if (j % 4 == 0)
+        extra = extra + '<br>\n';
+      extra = extra + '&nbsp;&nbsp;' + statName[j] + ': <strong>' + allStats[i][j] + '</strong>';
+    }
+    extra = extra + '<br>\n&nbsp;&nbsp;avg: <strong>' + allStats[i][numNormalStats] + '</strong>&nbsp;&nbsp;max: <strong>' + allStats[i][numNormalStats+1] + '</strong> (' + statName[allStats[i][numNormalStats+2]] + ')';
+  }
+  return extra;
+}
+
+// reload xml
+function getXML() {
   if (xmlReturned == true) {
     xmlReturned = false;
     xmlhttp.open('POST',xmlurl,true);
     xmlhttp.send();
   }
+}
+
+// redraw
+function drawDots() {
+  requestAnimFrame(drawDots);
   
   frame++;
   
@@ -217,7 +236,7 @@ function drawDots(){
       drawDot(x,y,Math.floor(dotSize[i]),getColor(getStat(i,colorStatType)));
   }
   if (mousedDot < numDots)
-    document.getElementById('vishoverinfo').innerHTML='<strong>' + ids[mousedDot] + '</strong>' + extras[mousedDot];
+    document.getElementById('vishoverinfo').innerHTML=getInfo(mousedDot);
 }
 
 // fill in a few grey dots
@@ -384,12 +403,13 @@ function setState() {
 // go to server page on click
 function goToServer(e) {
   if (mousedDot < numDots)
-    window.location = serverurl + ids[mousedDot];
+    window.location = serverurl + ids[mousedDot][0];
 }
 
 window.onload = function() {
   drawGrid();
   drawDots();
+  getXML();
 }
 </script>