From 9514327622bbd4dfc1e887827d6f6ed008b075b9 Mon Sep 17 00:00:00 2001 From: Misty Stanley-Jones Date: Tue, 16 Jun 2015 14:13:00 +1000 Subject: [PATCH] HBASE-13907 Document how to deploy a coprocessor --- src/main/asciidoc/_chapters/cp.adoc | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/main/asciidoc/_chapters/cp.adoc b/src/main/asciidoc/_chapters/cp.adoc index a99e903..bc898c6 100644 --- a/src/main/asciidoc/_chapters/cp.adoc +++ b/src/main/asciidoc/_chapters/cp.adoc @@ -187,6 +187,39 @@ DESCRIPTION ENABLED WARNING: There is no guarantee that the framework will load a given coprocessor successfully. For example, the shell command neither guarantees a jar file exists at a particular location nor verifies whether the given class is actually contained in the jar file. +== Guidelines For Deploying A Coprocessor + +Bundling Coprocessors:: + If possible, bundle all classes for a coprocessor into a + single JAR on the RegionServer's classpath, so that the RegionServer can load + the entire JAR and resolve dependencies. Otherwise, place all dependencies on + the RegionServer's classpath so that they can be loaded during RegionServer + start-up. The classpath for a RegionServer is set in the RegionServer's `hbase- + env.sh` file. You can also set a dynamic path in hbase-site.xml using + `hbase.dynamic.jars.dir`, and place the JAR or dependencies into this directory. +Automating Deployment:: + You can use a tool such as Puppet, Chef, or + Ansible to ship the JAR for the coprocessor to the required location on your + RegionServers' filesystems and restart each RegionServer, to automate + coprocessor deployment. Details for such set-ups are out of scope of this + document. +Updating a Coprocessor:: + Deploying a new version of a given + coprocessor is not as simple as disabling it, replacing the JAR, and re-enabling + the coprocessor. This is because you cannot reload a class in a JVM unless you + delete all the current references to it. Since the current JVM has reference to + the existing coprocessor, you must kill the JVM (restart the RegionServer) in + order to replace it. Alternately, you can include the coprocessor version in its + classname. This way you can unload the old coprocessor and load the new one, + without restarting the RegionServer. +Configuration and Log Files For Coprocessors:: + No API is provided for custom configuration files or logging + outputs for coprocessors. It usually makes sense to locate configuration files in + the `conf/` directory and log to the location specified in the system property `HBASE_LOG_DIR`, + which is set in the RegionServer's `hbase-env.sh` file. If you do develop your + own mechanisms for these features, be sure to name and locate your files in such + a way that they will not be overwritten by HBase updates. + == Check the Status of a Coprocessor To check the status of a coprocessor after it has been configured, use the `status` HBase Shell command. @@ -216,6 +249,8 @@ coprocessors=[AggregateImplementation] 0 dead servers ---- + + == Monitor Time Spent in Coprocessors HBase 0.98.5 introduced the ability to monitor some statistics relating to the amount of time spent executing a given coprocessor. -- 2.3.2 (Apple Git-55)