NFS-Ganesha with libcephfs on Ubuntu 14.04

This week I’m testing a lot with CephFS and one of the things I never tried was re-exporting CephFS using NFS-Ganesha and libcephfs.

NFS-Ganesha is a NFS server which runs in userspace. It has multiple backends (FSALs) it can use and libcephfs is one of them.

libcephfs is a userspace library which you can use to access CephFS. It is written in C/C++ and has Java and Python bindings. NFS-Ganesha however links to the native C++ bindings.

Running NFS-Ganesha on Ubuntu 14.04 is not plug and play, it involves manual compiling which I’ll explain below.

I tested this using:

  • Ubuntu 14.04.1
  • Ceph 0.89
  • NFS-Ganesha 2.1

Building NFS-Ganesha

It starts with installing a couple of packages:

apt-get install git-core cmake build-essential portmap libcephfs-dev bison 
flex libkrb5-dev libtirpc1

We then clone the Git repository:

cd /usr/src
git clone https://github.com/nfs-ganesha/nfs-ganesha.git
cd nfs-ganesha
git checkout -b V2.1-stable origin/V2.1-stable
git submodule update --init

Now we have the sources we can build it:

mkdir build
cd build
cmake ../src
make
make install

NFS-Ganesha uses DBus and we have to copy a DBus profile:

cp ../src/scripts/ganeshactl/org.ganesha.nfsd.conf /etc/dbus-1/system.d/

Configuring the NFS export

Now we can create our NFS-Ganesha configuration:

nano /usr/local/etc/ganesha.conf

Add the following:

EXPORT
{
    Export_ID = 1;
    Path = "/";
    Pseudo = "/";
    Access_Type = RW;
    NFS_Protocols = "3";
    Squash = No_Root_Squash;
    Transport_Protocols = TCP;
    SecType = "none";

    FSAL {
        Name = CEPH;
    }
}

With this configuration we say that we want to export (Path) “/” of our CephFS filesystem as “/” (Pseudo) from our NFS server.

Configuring Ceph

To run NFS-Ganesha you have to make sure that CephFS is up and running and that the server where you are going to run Ganesha on can access the Ceph cluster.

Make sure your ceph.conf and ceph.client.admin.keyring file are both present in /etc/ceph and run:

ceph -s

If that works you can start NFS-Ganesha

Starting NFS-Ganesha

Now Ceph is working we can start the NFS server:

ganesha.nfsd -f /usr/local/etc/ganesha.conf -L /tmp/ganesha.log -N NIV_DEBUG -d

This makes the NFS server log with a DEBUG profile. It gives you a lot of insight on what’s happing. You probably want to disable this when it all works.

Mounting NFS

On a NFS client we can now mount the NFS filesystem which is actually our CephFS:

mkdir /mnt/cephfs-nfs
mount -o rw,noatime 1.2.3.4:/ /mnt/cephfs-nfs

Replace 1.2.3.4 with the hostname/IP-Address of the server running NFS-Ganesha.

You should now have a NFS mount which shows you your CephFS filesystem! This way legacy clients can access the most awesome filesystem.

Driving to the Arctic with my Tesla Model S!

The Tesla SuperCharger Network

The Tesla SuperCharger network keeps expanding rapidly in the US, Europe and Asia. Looking at the community maintained website supercharge.info I saw that the SuperCharger network was slowly expanding to the North of Norway.

I have never seen the Aurora and it’s still on my bucketlist. So watching the SuperCharger network expand I got the crazy idea to drive there with my Tesla Model S!

My father lives on Bali (Indonesia), but I thought it would be a very cool trip to do together. I gave him a call and he promptly answered: YES!

This January we will be driving from Amersfoort (The Netherlands) to the most Northern SuperCharger in the world: Setermoen in Norway!

6500km round-trip

Following the SuperCharger network through Germany, Denmark, Sweden and Norway it will be a trip of roughly ~3.250km to the most Northern SuperCharger. So in total we will be driving 6.500km using just the Tesla SuperCharger network.

During the trip we’ll encounter rain, snow, temperatures well below -10C and the beautiful nature Sweden and Norway have to offer!

Route to Norway

Above is the route we will follow. The main goal is to only use the SuperCharger network. We might plug in at a regular socket overnight to keep the battery warm during the cold weather, but 90% of our charge should come from the SuperChargers.

Schedule

My father will arrive in the Netherlands on Jan 15th 2015 and we plan to leave the 20th or 21st.

The first day we will try to reach the SuperCharger in Middelfart (Denmark) and stay there for the night. The next day we’ll travel to Copenhagen and continue our journey to Stockholm and towards Norway.

Our current expectation is that the entire trip will to 3 to 4 weeks. We are not in a hurry. We both have never seen Copenhagen nor Stockholm, so we’ll probably stay there to do a quick city tour. Afterwards we’ll slowly continue our journey towards Norway and the Arctic.

If all goes well we should be back in the Netherlands on February ~20th, but we’ll see how it goes!

Preparations

Since we are going to be driving in sub-zero temperatures we have to prepare. We will be driving on remote roads and should be prepared for the fact that we might get stuck. We would rather not get stuck, but you never know.

Nokian Hakkapeliitta R2

It all starts with a good set of winter tyres! I bought a set of Nokian Hakkapeliitta R2 tyres. Tesla owners from Norway and the Northern parts of the USA said they were very happy with these under winter conditions.

‘Better be safe than sorry’ is probably a good thing when going to Sweden and Norway in January and February, so in case we get stuck along the road I bought a Multi-Fuel Stove from XGK:

XGK EX with bottle

The MSR XGK EX Multi-Fuel Stove burns White Gas, Kerosine and Diesel, which makes it suiteable for cooking while temperatures are well below zero. Should be get stuck on a very remote location we should still be able to cook ourselfs a warm meal.

Follow us!

During our trip I’ll be updating this blog and you can follow me on Twitter on @widodh.

We’ll be leaving for Norway somewhere around Jan 20th 2015! We are looking forward to it 🙂

Ceph with a cluster and public network on IPv6

I’m a big fan of Ceph and IPv6, so I always try to deploy Ceph over IPv6 when possible. Ceph is the future, just like IPv6 is. Why implement legacy?

Recently I did a deployment of Ceph with a public and cluster network running over IPv6. It has a small catch, so I let me explain the cluster and public network first.

Ceph cluster and public network

This image comes from the Ceph documentation and shows the two types of network:

  • Public network for clients and monitors
  • Cluster network for inter-OSD communication (Replication and recovery)

If you want to run your Ceph cluster over IPv6 you have a couple of settings to make:

[global]
ms_bind_ipv6 = true
mon_host = [2a00:f10:XX:XX::XX]:6789, [2a00:f10:XX:XX::XY]:6789, [2a00:f10:XX:XX::YY]:6789

As you can see, you have to write the IPv6 address enclosed by [ and ]

When configuring the cluster and/or public network in the ceph.conf you should however not use them:

[global]
public_network = 2a00:f10:XX:XX:XX::/64
cluster_network = 2a00:f10:XX:XX:XY::/64

When that is set correctly it should all be working fine and your Ceph cluster will be running over IPv6 with different networks!