Building Alluxio From Source

Slack Docker Pulls GitHub edit source

This guide describes how to clone the Alluxio repository, compile the source code, and run tests in your environment.

Required Software

Checkout Source Code

Checkout the Alluxio master branch from Github:

  1. $ git clone git://github.com/alluxio/alluxio.git
  2. $ cd alluxio

By default, cloning the repository will check out the master branch. If you are looking to build a particular version of the code you may check out the version using a git tag.

  1. $ git tag
  2. $ git checkout <TAG_NAME>

Build

Build the source code using Maven:

  1. $ mvn clean install -DskipTests

To speed up the compilation, you can run the following instruction to skip different checks:

  1. $ mvn -T 2C clean install -DskipTests -Dmaven.javadoc.skip -Dfindbugs.skip \
  2. -Dcheckstyle.skip -Dlicense.skip

Note: The flag -Dskip.protoc skips generating source files related to gRPC proto. You can skip this step if you have already built them.

If you are seeing java.lang.OutOfMemoryError: Java heap space, please set the following variable to increase the memory heap size for maven:

  1. $ export MAVEN_OPTS="-Xmx2g -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=512m"

The Maven build system fetches its dependencies, compiles source code, runs unit tests, and packages the system. If this is the first time you are building the project, it can take a while to download all the dependencies. Subsequent builds, however, will be much faster.

Test

Once Alluxio is built, you can validate and start it with:

  1. $ # Alluxio uses ./underFSStorage for under file system storage by default
  2. $ mkdir ./underFSStorage
  3. $ ./bin/alluxio validateEnv local
  4. $ ./bin/alluxio format
  5. $ ./bin/alluxio-start.sh local SudoMount

To verify that Alluxio is running, you can visit http://localhost:19999 or check the log in the alluxio/logs directory. The worker.log and master.log files will typically be the most useful. It may take a few seconds for the web server to start. You can also run a simple program to test that data can be read and written to Alluxio’s UFS:

  1. $ ./bin/alluxio runTests

You should be able to see the result Passed the test!

You can stop the local Alluxio system by using:

  1. $ ./bin/alluxio-stop.sh local

Build Options

Compute Framework Support

Since Alluxio 1.7, you do not need to run Maven build with different compute profiles. The Alluxio client jar built and located at /<PATH_TO_ALLUXIO>/client/alluxio-2.2.2-client.jar will work with different compute frameworks (e.g., Spark, Flink, Presto and etc) by default.

Hadoop Distribution Support

To build Alluxio against one of the different distributions of hadoop, you can run the following command by specifying <HADOOP_PROFILE> and the corresponding hadoop.version.:

  1. $ mvn install -P<HADOOP_PROFILE> -Dhadoop.version=<HADOOP_VERSION> -DskipTests

where <HADOOP_VERSION> can be set for different distributions. Available Hadoop profiles include hadoop-1, hadoop-2, hadoop-3 to cover the major Hadoop versions 1.x, 2.x and 3.x.

Apache

All main builds are from Apache so all Apache releases can be used directly

  1. -Phadoop-1 -Dhadoop.version=1.0.4
  2. -Phadoop-1 -Dhadoop.version=1.2.0
  3. -Phadoop-2 -Dhadoop.version=2.2.0
  4. -Phadoop-2 -Dhadoop.version=2.3.0
  5. -Phadoop-2 -Dhadoop.version=2.4.1
  6. -Phadoop-2 -Dhadoop.version=2.5.2
  7. -Phadoop-2 -Dhadoop.version=2.6.5
  8. -Phadoop-2 -Dhadoop.version=2.7.3
  9. -Phadoop-2 -Dhadoop.version=2.8.0
  10. -Phadoop-2 -Dhadoop.version=2.9.0
  11. -Phadoop-3 -Dhadoop.version=3.0.0

Cloudera

To build against Cloudera’s releases, just use a version like $apacheRelease-cdh$cdhRelease

  1. -Phadoop-2 -Dhadoop.version=2.3.0-cdh5.1.0
  2. -Phadoop-2 -Dhadoop.version=2.0.0-cdh4.7.0

Hortonworks

To build against a Hortonworks release, just use a version like $apacheRelease.$hortonworksRelease

  1. -Phadoop-2 -Dhadoop.version=2.1.0.2.0.5.0-67
  2. -Phadoop-2 -Dhadoop.version=2.2.0.2.1.0.0-92
  3. -Phadoop-2 -Dhadoop.version=2.4.0.2.1.3.0-563