Skip to main content

Fixing Oozie LZO ClassNotFound Errors and ShareLib Issues

When LZO compression is enabled in Hadoop, Oozie may fail to launch MapReduce jobs with a ClassNotFoundException for the LzoCodec. This article explains why it happens, how to fix the missing hadoop-lzo classes on the Oozie server, how to correctly deploy the Oozie sharelib and how to enable the legacy uber-jar feature for MapReduce actions in CDH-era clusters.

Note (2025): This article documents behaviour from the CDH 4.x/5.x Oozie + MapReduce stack. Oozie is legacy and many teams migrate to Apache Airflow, Dagster, Argo or cloud-native schedulers, but troubleshooting old clusters still requires understanding these patterns. The solutions here apply to Hadoop MR/LZO deployments still in maintenance or migration mode.

Symptom: Oozie fails after enabling LZO compression

When you add LZO codecs to core-site.xml, Oozie may suddenly fail to start any MapReduce job. Typical configuration looks like:

<property>
  <name>io.compression.codecs</name>
  <value>
    org.apache.hadoop.io.compress.GzipCodec,
    org.apache.hadoop.io.compress.DefaultCodec,
    com.hadoop.compression.lzo.LzoCodec,
    com.hadoop.compression.lzo.LzopCodec,
    org.apache.hadoop.io.compress.BZip2Codec
  </value>
</property>

<property>
  <name>io.compression.codec.lzo.class</name>
  <value>com.hadoop.compression.lzo.LzoCodec</value>
</property>

After restarting services, Oozie reports:

java.lang.ClassNotFoundException:
  Class com.hadoop.compression.lzo.LzoCodec not found

Root cause

Even though LZO is installed on Hadoop nodes, Oozie runs inside its own server JVM and classpath. If hadoop-lzo.jar is missing from /var/lib/oozie/ (or the directory your Oozie installation loads from), Oozie cannot load the LZO codec classes and refuses to start jobs.

Fix: Install the LZO JAR on the Oozie server

Copy (or symlink) the hadoop-lzo.jar into the Oozie library directory and restart Oozie:

cp /usr/lib/hadoop/lib/hadoop-lzo.jar /var/lib/oozie/
service oozie restart

Once Oozie can load com.hadoop.compression.lzo.LzoCodec, MapReduce jobs using LZO compression start normally.

The second common issue: missing or incorrect ShareLib

Even with the LZO JAR fixed, Oozie may still fail if the sharelib is missing or has wrong permissions. The sharelib provides the job launcher classpath for Oozie workflows.

Typical setup:

# Create Oozie home in HDFS
sudo -u hdfs hadoop fs -mkdir /user/oozie
sudo -u hdfs hadoop fs -chown oozie:oozie /user/oozie

# Extract the sharelib
mkdir /tmp/share
cd /tmp/share
tar xvfz /usr/lib/oozie/oozie-sharelib.tar.gz

# Upload it to HDFS
sudo -u oozie hadoop fs -put share /user/oozie/share

After uploading, restart Oozie or run:

oozie admin -sharelibupdate

Without a valid sharelib, Oozie cannot assemble the runtime classpath for MapReduce actions and will fail even if the LZO JAR is present on the Oozie server.

Uber JAR support (CDH 4.1+)

Starting with CDH 4.1, Oozie introduced a lightweight uber-jar feature. An uber-jar doesn’t bundle all dependencies into one fat JAR; instead, it carries references to dependent libraries in an internal lib/ directory.

To enable it globally, set the following in oozie-site.xml:

<property>
  <name>oozie.action.mapreduce.uber.jar.enable</name>
  <value>true</value>
</property>

Once enabled, workflow authors can tag a MapReduce action with:

oozie.mapreduce.uber.jar = <path-to-jar>

This tells Oozie that the provided JAR should be treated as an uber-jar, and Oozie will expand and distribute its libraries accordingly when launching the job.

Summary

  • LZO in core-site.xml often breaks Oozie because Oozie’s server classpath cannot see hadoop-lzo.jar.
  • Fix by copying hadoop-lzo.jar into /var/lib/oozie/.
  • Ensure /user/oozie/share exists and contains a valid sharelib.
  • Enable uber-jar support if your workflows depend on it.

With these steps, Oozie resumes launching MapReduce jobs correctly even when LZO compression is enabled cluster-wide.

If you need help with distributed systems, backend engineering, or data platforms, check my Services.

Most read articles

Why Is Customer Obsession Disappearing?

Many companies trade real customer-obsession for automated, low-empathy support. Through examples from Coinbase, PayPal, GO Telecommunications and AT&T, this article shows how reliance on AI chatbots, outsourced call centers, and KPI-driven workflows erodes trust, NPS and customer retention. It argues that human-centric support—treating support as strategic investment instead of cost—is still a core growth engine in competitive markets. It's wild that even with all the cool tech we've got these days, like AI solving complex equations and doing business across time zones in a flash, so many companies are still struggling with the basics: taking care of their customers. The drama around Coinbase's customer support is a prime example of even tech giants messing up. And it's not just Coinbase — it's a big-picture issue for the whole industry. At some point, the idea of "customer obsession" got replaced with "customer automation," and no...

How to scale MySQL perfectly

When MySQL reaches its limits, scaling cannot rely on hardware alone. This article explains how strategic techniques such as caching, sharding and operational optimisation can drastically reduce load and improve application responsiveness. It outlines how in-memory systems like Redis or Memcached offload repeated reads, how horizontal sharding mechanisms distribute data for massive scale, and how tools such as Vitess, ProxySQL and HAProxy support routing, failover and cluster management. The summary also highlights essential practices including query tuning, indexing, replication and connection management. Together these approaches form a modern DevOps strategy that transforms MySQL from a single bottleneck into a resilient, scalable data layer able to grow with your application. When your MySQL database reaches its performance limits, vertical scaling through hardware upgrades provides a temporary solution. Long-term growth, though, requires a more comprehensive approach. This invo...

What the Heck is Superposition and Entanglement?

This post is about superposition and interference in simple, intuitive terms. It describes how quantum states combine, how probability amplitudes add, and why interference patterns appear in systems such as electrons, photons and waves. The goal is to give a clear, non mathematical understanding of how quantum behavior emerges from the rules of wave functions and measurement. If you’ve ever heard the words superposition or entanglement thrown around in conversations about quantum physics, you may have nodded politely while your brain quietly filed them away in the "too confusing to deal with" folder.  These aren't just theoretical quirks; they're the foundation of mind-bending tech like Google's latest quantum chip, the Willow with its 105 qubits. Superposition challenges our understanding of reality, suggesting that particles don't have definite states until observed. This principle is crucial in quantum technologies, enabling phenomena like quantum comp...