Return-Path: Delivered-To: apmail-cassandra-dev-archive@www.apache.org Received: (qmail 28648 invoked from network); 6 May 2010 12:50:50 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 6 May 2010 12:50:50 -0000 Received: (qmail 90811 invoked by uid 500); 6 May 2010 12:50:49 -0000 Delivered-To: apmail-cassandra-dev-archive@cassandra.apache.org Received: (qmail 90770 invoked by uid 500); 6 May 2010 12:50:49 -0000 Mailing-List: contact dev-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list dev@cassandra.apache.org Received: (qmail 90762 invoked by uid 99); 6 May 2010 12:50:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 May 2010 12:50:49 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gdusbabek@gmail.com designates 74.125.83.44 as permitted sender) Received: from [74.125.83.44] (HELO mail-gw0-f44.google.com) (74.125.83.44) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 May 2010 12:50:43 +0000 Received: by gwaa12 with SMTP id a12so2852436gwa.31 for ; Thu, 06 May 2010 05:50:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:reply-to :in-reply-to:references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Gitqlu0kvZFqCO4obPCLAGM7aPjBjc00WzKPwu+6XN8=; b=UtWb1dr2jrIRKby7lL+y/z/dfuAr+GZwyrifuqxY6ZKAjJb0MQQkh5I+Y6TScE1faH jDAmCYCLY1g6KJHBJe0i+jL+tyeE2WK9stfa3l0Nrqiy0NxF9z/gB0el4vqHdbHdUSR2 u0jSwORCDEbRRg9B7wO3nPkMGYh+Vhp2JuIfQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; b=sQCLLa9/OxQSyhHWxj7avVmMtcj7XFzsp/WJz2ke7G5WmlxNtKCvJ6q+0Lmh1HkSRd iPNxIsCWPe44t6V04koJs+EKGZqpbLJL2UNN6161OQu/2jZ+kARY7+A2SepRpYqhq8mF gpr90ynVvQIAIAazpYjeE5qsIPw6jigBKqJrw= MIME-Version: 1.0 Received: by 10.150.251.10 with SMTP id y10mr1867493ybh.123.1273150220805; Thu, 06 May 2010 05:50:20 -0700 (PDT) Received: by 10.150.201.6 with HTTP; Thu, 6 May 2010 05:50:20 -0700 (PDT) Reply-To: gdusbabek@gmail.com In-Reply-To: References: <1272982863.17468.71.camel@erebus.lan> <4BE05378.9060207@openx.org> <20100504174909.GB7305@alumni.caltech.edu> Date: Thu, 6 May 2010 07:50:20 -0500 Message-ID: Subject: Re: admin web UI From: Gary Dusbabek To: dev@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org If there is enough interest in having this in trunk, I suggest this approac= h: 1) Make the CassandraDaemon.java changes, except modify it so that the adapter will only spin up if one of the mx4j classes is found in the classpath. 2) Place the required mx4j jars in contrib. The license (http://mx4j.sourceforge.net/docs/ch01s06.html) appears to be Apache compatible. >From an operations standpoint, I don't think that many large cluster users (who probably already have Real Management Tools at their disposal) will be interested in this since it adds more moving parts, requires additional resources, etc. But from the standpoint of small-cluster management, I see some utility in this. Gary. On Thu, May 6, 2010 at 03:17, Ran Tavory wrote: > Thanks Gabriele, it's quite nice! > The code change is pretty small I would even say for simplicity it's bett= er > to just commit that to the core. I'll paste the code below. > In main(): > =A0=A0 =A0 =A0 =A0 =A0 =A0daemon.startJmxOverHttp(); > > And we have: > =A0=A0 =A0public void startJmxOverHttp() > =A0=A0 =A0{ > =A0=A0 =A0 =A0 =A0try > =A0=A0 =A0 =A0 =A0{ > =A0=A0 =A0 =A0 =A0 =A0 =A0MBeanServer mbs =3D ManagementFactory.getPlatfo= rmMBeanServer(); > =A0=A0 =A0 =A0 =A0 =A0 =A0ObjectName processorName =3D new > ObjectName("Server:name=3DXSLTProcessor"); > =A0=A0 =A0 =A0 =A0 =A0 =A0HttpAdaptor adapter =3D new HttpAdaptor(9292); > =A0=A0 =A0 =A0 =A0 =A0 =A0ObjectName httpName =3D new ObjectName("system:= name=3Dhttp"); > =A0=A0 =A0 =A0 =A0 =A0 =A0mbs.registerMBean(adapter, httpName); > =A0=A0 =A0 =A0 =A0 =A0 =A0XSLTProcessor processor =3D new XSLTProcessor()= ; > =A0=A0 =A0 =A0 =A0 =A0 =A0adapter.setProcessor(processor); > =A0=A0 =A0 =A0 =A0 =A0 =A0mbs.registerMBean(processor, processorName); > =A0=A0 =A0 =A0 =A0 =A0 =A0adapter.start(); > =A0=A0 =A0 =A0 =A0} catch(MalformedObjectNameException ex) > =A0=A0 =A0 =A0 =A0{ > =A0=A0 =A0 =A0 =A0 =A0logger.warn("Could not start JMX over HTTP service,= wrong name > specifed in code: {}", ex); > =A0=A0 =A0 =A0 =A0} catch(InstanceAlreadyExistsException ex) > =A0=A0 =A0 =A0 =A0{ > =A0=A0 =A0 =A0 =A0 =A0logger.warn("Could not start JMX over HTTP service,= already > started: {}", ex); > =A0=A0 =A0 =A0 =A0} catch(IOException ex) > =A0=A0 =A0 =A0 =A0{ > =A0=A0 =A0 =A0 =A0 =A0logger.warn("Could not start JMX over HTTP service:= {}", ex); > =A0=A0 =A0 =A0 =A0} catch(JMException ex) > =A0=A0 =A0 =A0 =A0{ > =A0=A0 =A0 =A0 =A0 =A0logger.warn("Could not start register mbean in JMX:= {}", ex); > =A0=A0 =A0 =A0 =A0} > =A0=A0 =A0} > That's all, now just add mx4j.jar and mx4j-tools.jar to lib and you're do= ne. > See screenshot for what you get from that on a live cassandra node. > I'll try this for my installation but I think it'll be also nice to have > that for everyone, let me know what you think. If you prefer contrib, the= n > I'm not sure how to do that without having to run two processes. > > On Thu, May 6, 2010 at 10:15 AM, gabriele renzi wrote= : >> >> On Wed, May 5, 2010 at 12:00 PM, Ran Tavory wrote: >> > can you send it to me? I'll try to work from it. >> >> I updated it to trunk, moved the code into a method and added a few >> catch'es (before: in main() throws Exception) . >> As you can see, once exception handling and imports are removed it's >> about ten lines. >> >> To compile you need the jars mx4j-tools.jar, mx4j.jar from the mx4j >> distribution, compile, run cassandra, connect to 9292. >> >> I recall I've seen better looking mx4j-over-http interfaces (in e.g. >> mule ESB) which I'd say depends on the default stylesheet, but for a >> quick glance it kind of works. It should also be possible to only >> expose selected beans, though I have not investigated it. >> >> -- >> blog en: http://www.riffraff.info >> blog it: http://riffraff.blogsome.com > >