How Do You Troubleshoot the Installation of Apache Accumulo on Linux?

Problem scenario
You are trying to install open source Accumulo on Linux. You have two GB of swap space. You have installed Java, Hadoop, and Zookeeper. You have run the bootstrap_config.sh script for Accumulo 1.9.2.

You run this (and expected it to work): /bin/accumulo-1.9.2/bin/accumulo init

But you get this error:

OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N 2019-03-20 17:21:56,705 [start.Main] ERROR: Problem initializing the class loader java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.accumulo.start.Main.getClassLoader(Main.java:101) at org.apache.accumulo.start.Main.main(Main.java:48) Caused by: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.apache.commons.vfs2.impl.DefaultFileSystemManager.(DefaultFileSystemManager.java:136) at org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader.generateVfs(AccumuloVFSClassLoader.java:258) at org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader.getClassLoader(AccumuloVFSClassLoader.java:210) ... 6 more Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at org.apache.accumulo.start.classloader.AccumuloClassLoader$2.loadClass(AccumuloClassLoader.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 9 more Exception in thread "Thread-0" java.lang.NoClassDefFoundError: org/apache/commons/io/FileUtils at org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader.close(AccumuloVFSClassLoader.java:425) at org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader$AccumuloVFSClassLoaderShutdownThread.run(AccumuloVFSClassLoader.java:75) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.FileUtils at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at org.apache.accumulo.start.classloader.AccumuloClassLoader$2.loadClass(AccumuloClassLoader.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 3 more

You have modified this script purely for troubleshooting purposes: /bin/accumulo-1.9.2/bin/accumulo

You have it print out the $CLASSPATH variable when it runs. In two directories that you see when you run it (before it errors out), you have copied the commons-io-2.5.jar file. This way two directories definitely have the .jar file. You changed the permissions and ownership of these files to various permissive settings. You kept reproducing the problem after you did this. The problem even happens when you log in as root and start HDFS and Yarn and then run accumulo init. Why are you getting the error above when the commons-io-2.5.jar file is present in the classpath? How do you install Accumulo and run the accumulo init script?

Solution
Modify the accumulo-site.xml file. It may be here on your server: /usr/bin/accumulo-1.9.2/conf/accumulo-site.xml

Determine the version of Hadoop you are using (e.g., 2 or 3, or something else). This example will be for Hadoop 3. Add the third line in the below section (you'll see lines 1, 2, and 4 below in the file above; the third line needs to be added):

  <!-- Hadoop 3 requirements -->
  $HADOOP_PREFIX/share/hadoop/client/[^.].*.jar,
  $HADOOP_PREFIX/share/hadoop/common/lib/.*.jar,
  <!-- End Hadoop 3 requirements -->

Leave a comment

Your email address will not be published. Required fields are marked *