For running ArangoDB in clusters doing performance tests we wanted to have a non virtualized set of descent hardware with fast ethernet connection, enough RAM (since thats what Arango needs) and multicore CPU. Since you need a bunch of them, cheap ARM devel boards come to mind. The original Raspberry PI (we have those) is out of the game due to V8 is not supporting it anymore. The now available PI 2 doesn’t cut it, since its ethernet NIC is connected via USB (as on the original PI). The Odroid series only have one of both: Fast ethernet or enough RAM. The Cubieboard 4 wasn’t available yet, but its Allwinner A80 SOC seemed a good choice. Then we met the Merii Optimus board, which seems to be almost the same as the PCDuino (now renamed to Arches) with the A80. While we got a bunch of them for a descent price over at Pollin, the upstream support wasn’t that good.

However, with some help of the SunXi-Linux Project we started flashing OS images to replace the preloaded Android image with the Merii Linux image. Since the userland of the Merii image is pretty sparse, we wanted something more useable. There is already a how-to on running Ubuntu which requires running a Windows host. We prefer a Linux host and want to run a Debian. Since the new Pi2 is also able to run regular Debian with ArmV7, we pick the root fs from sjoerd.

IMG_7640

Building the Merii SDK

The works of Merii have collected a little dust on their way from china, so it doesn’t work out of the box on a recent Debian. Our buildhost is an Amd64 Jessie using multiarch to also be able to run i386 binaries from the SDK. Verify that multiarch is working properly:

Since we want to run a more recent userland with systemd, we need to enable CONFIG_FANOTIFY – else /etc/fstab entries for the SD-Card will fail to mount during boot. We edit linux-3.4/.config and change the line:

To enabled:

After some fiddling, bending download URLs to places where the software still can be found, picking up dangling symlinks, and waiting for the Compiler to do its job, we get:

This is an image intended to be flashed to the board using the sunxi Livesuite. As mentioned above, it only brings some busybox userland, which we want to pimp now. Use the output of dmesg to find the SD-Card device. Then flash the Raspberry pi disk image to an SD-Card:

and mount its root filesystem:

Since we need to copy some things from Merii image, and we can’t mount it directly, we locate the raw root filesystem in the buildroot and mount it using the loopback device:

Now we can access the files from the Merii root, and copy it (i.e. the kernel modules) so we have it available later on:

Sadly the generated filesystem doesn’t allow to enter the UBOOT prompt. So we need to modify kernel boot parameters in tools/pack/chips/sun9iw1p1/configs/default/env.cfg before packing the image. I.e. we may want to make systemd offer a rescue console (which helped me a lot, since fiddling serial console to work wouldn’t have been possible otherwise):

Now we see that the disk is 32G, but we only have 512MB on the board for the root image. So now we need to create a smaller image so it fits:

As Lars Vogdt describes in his excellent blog post, we fix the serial console:

Then edit etc/systemd/system/getty.target.wants/getty@ttyS0.service and set the correct baud rate:

We configure the ethernet adding / editing etc/network/interfaces.d/eth0:

Edit the etc/fstab and replace the pi specific stuff:

Finally, we have to add some fix up to etc/rc.local:

Now we can copy everything into the root filesystem image:

We have our beautiful Image which we can flash to the board. We first start the livesuite mentioned above, and select the image. Then we need to put the board into FEL-mode using minicom and the serial to USB cable that came with the board. If you’re able to access the UBOOT prompt, the efex command can do this. Otherwise holding down the 2 key during power up will do the job.

Some more links that helped me a lot to figure everything out:

Conclusion

It will take a while for the verry powerfull A80 SOC to gain ground. Part of this slow uptake is the very sparse communication policy of Allwinner and Merii. However, that seems to change a bit. With the Cubieboard 4 and the LinkSprite Arches (PCDuino) nice boards with a very active community will become available, I guess Olimex will follow soon. Expect them to arrive at exp-tech, Pollin or Watterott. Also devices with better WAF to look nice in your livingroom are about to arive.

In the next blog post we will install ArangoDB on this cluster and show some performance results. Therefore we will use fast micro-SD cards to provide additional disk-space.