Compiling on Debian
Login to your AWS account and launch an instance of Debian Testing. I used an‘m3.xlarge’ since that has a bunch of cores, more than enough memory, optimizednetwork and the instance store is on SSDs which can be switched to provisionedIOPs.
The Current AMI ID’s can be found in the Debian Wiki:
Upgrade to the very latest version
Once your EC2 instance is up, login ad and
sudo su to become
First, we remove the backports and change the primary sources.list
Update and upgrade the system. Make sure you don’t have any broken/unconfiguredpackages. Sometimes you need to run safe/full upgrade more than once. When youare done, reboot.
apt-get install aptitude
aptitude -y update
aptitude -y safe-upgrade
aptitude -y full-upgrade
Install build dependencies
Before you can build ArangoDB, you need a few packages pre-installed on your system.
Login again and install them.
sudo aptitude -y install git-core \
sudo aptitude -y install libldap2-dev # Enterprise Edition only
Download the latest source using git:
unix> git clone git://github.com/arangodb/arangodb.git
This will automatically clone the devel branch.
Note: if you only plan to compile ArangoDB locally and do not want to modify orpush any changes, you can speed up cloning substantially by using the—single-branch and —depth parameters for the clone command as follows:
unix> git clone --single-branch --depth 1 git://github.com/arangodb/arangodb.git
Switch into the ArangoDB directory
unix> cd arangodb
unix> cd build
In order to generate the build environment please execute
unix> cmake ..
cmake -DCMAKE_C_COMPILER=/opt/bin/gcc -DCMAKE_CXX_COMPILER=/opt/bin/g++ ..
If you compile on macOS, you should add the following options to the cmakecommand:
cmake .. -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11
If you also plan to make changes to the source code of ArangoDB, you may wantto compile with the
Debug build type:
Debug target enables additional sanity checks etc. which would slow downproduction binaries. If no build type is specified, ArangoDB will be compiledwith build type
RelWithDebInfo, which is a compromise between goodperformance and medium debugging experience.
Other options valuable for development:
Needed if you plan to make changes to AQL language (which is implemented usinga lexer and parser files in
arangod/Aql/tokens.ll)or if you want to enable runtime assertions. To use the maintainer mode, yoursystem has to contain the tools FLEX and BISON.
Use this option if you want to have C++ stacktraces attached to your exceptions.This can be useful to more quickly locate the place where an exception or anassertion was thrown. Note that this option will slow down the produces binariesa bit and requires building with maintainer mode.
This will optimize the binary for the target architecture, potentially enablingmore compiler optimizations, but making the resulting binary less portable.
ArangoDB will then automatically use the configuration from fileetc/relative/arangod.conf.
This option activates additional code in the server that intentionally makesthe server crash or misbehave (e.g. by pretending the system ran out of memory)when certain tests are run. This option is useful for writing tests.
By default ArangoDB will be built with a bundled version of the JEMallocallocator. This however will not work when using runtime analyzers such as ASANor Valgrind. In order to use these tools for instrumenting an ArangoDB binary,JEMalloc must be turned off during compilation.
Gyp is used as makefile generator by V8. Gyp requires shared memory to beavailable, which may not if you i.e. compile in a chroot. You can make itavailable like this:
none /opt/chroots/ubuntu_precise_x64/dev/shm tmpfs rw,nosuid,nodev,noexec 0 2
devpts /opt/chroots/ubuntu_precise_x64/dev/pts devpts gid=5,mode=620 0 0
Compile the programs (server, client, utilities) by executing
in the build subdirectory. This will compile ArangoDB and create the binary executablein file .
Starting and testing
Check the binary by starting it using the command line.
unix> build/bin/arangod -c etc/relative/arangod.conf --server.endpoint tcp://127.0.0.1:8529 /tmp/database-dir
This will start up the ArangoDB and listen for HTTP requests on port 8529 boundto IP address 127.0.0.1. You should see the startup messages similar to thefollowing:
Use your favorite browser to access the URL
This should bring up ArangoDB’s web interface.
Re-building ArangoDB after an update
To stay up-to-date with changes made in the main ArangoDB repository, you willneed to pull the changes from it and re-run
Normally, this will be as simple as follows:
unix> git pull
unix> (cd build && make)
From time to time there will be bigger structural changes in ArangoDB, which mayrender the old Makefiles invalid. Should this be the case and
make complainsabout missing files etc., the following commands should fix it:
unix> rm -rf build/*
unix> cd build && cmake .. <cmake options go here>
unix> (cd build && make)
Note that the above commands will run a full rebuild of ArangoDB and allof its third-party components. That will take a while to complete.
In a local development environment it is not necessary to install ArangoDBsomewhere, because it can be started from within the source directory asshown above.
If there should be the need to install ArangoDB, execute the following command:
(cd build && sudo make install)
The server will by default be installed in
The configuration file will be installed in
The database will be installed in
The ArangoShell will be installed in
You should add an arangodb user and group (as root), plus make sure it owns these directories:
Note: The installation directory will be different if you use one of the
precompiled packages. Please check the default locations of your operatingsystem, e. g.
When upgrading from a previous version of ArangoDB, please make sure you inspectArangoDB’s log file after an upgrade. It may also be necessary to start ArangoDBwith the —database.auto-upgrade parameter once to perform required upgrade orinitialization tasks.