The Ceph project is always looking for more participants. If you are interested in using Ceph, or contributing to its development, please join our mailing list and drop us a line.
git clone git://ceph.newdream.net/ceph.gitor
git clone http://ceph.newdream.net/git/ceph.gitTo pull the latest,
git pullYou can browse the git repo at http://ceph.newdream.net/git.
git clone git://ceph.newdream.net/ceph.git cd ceph/src make mpi=no fuse=no(You can omit the mpi=no or fuse=no if you happen to have those installed.)
mkdir log
mkdir dev ln -s /dev/sda3 dev/osd.all # all nodes use /dev/sda3 ln -s /dev/sda4 dev/osd0 # except osd0, which should use /dev/sd4That is, when an osd starts up, it first looks for dev/osd$n, then dev/osd.all, in that order. These need not be "real" devices--they can be regular files too. To get going with fakesyn, for example, or to test a whole "cluster" running on the same node,
# create small "disks" for osd0-osd3 for f in 0 1 2 3; do # default is 4 OSDs dd if=/dev/zero of=dev/osd$f bs=1048576 count=1024 # 1 GB each doneNote that if your home/working directory is mounted via NFS or similar, you'll want to symlink dev/ to a directory on a local disk.
make fakesyn && ./fakesyn --mkfs --debug_ms 1 --debug_client 3 --syn rw 1 100000 # where those options mean: # --mkfs # start with a fresh file system # --debug_ms 1 # show message delivery # --debug_client 3 # show limited client stuff # --syn rw 1 100000 # write 1MB to a file in 100,000 byte chunks, then read it backOne the synthetic workload finishes, the synthetic client unmounts, and the whole system shuts down. The full set of command line arguments can be found in config.cc.
#!/bin/sh killall cosd cmds cmonand a start.sh script like
#!/bin/sh ./stop.sh ./mkmonmap 1.2.3.4:12345 # your IP here; any unused port will do ./cmon --mkfs --mon 0 & ./cosd --mkfs --osd 0 & ./cosd --mkfs --osd 1 & ./cosd --mkfs --osd 2 & ./cosd --mkfs --osd 3 & ./cmds &Note that the IP you specify is for the monitor. This is the only fixed and static ip:port in the system. The rest of the cluster daemons bind to a random port and register themselves with the monitor.
modprobe fuse # make sure fuse module is loaded mkdir mnt # or whereever you want your mount point make fakefuse && ./fakefuse --mkfs --debug_ms 1 mntYou should be able to ls, copy files, or whatever else (in another terminal; fakefuse will stay in the foreground). Control-C will kill fuse and cause an orderly shutdown. Alternatively, fusermount -u mnt will unmount. If fakefuse crashes or hangs, you may need to kill -9 fakefuse and/or fusermount -u mnt to clean up. Overall, FUSE is pretty well-behaved. If you have the cluster daemon's already running (as above), you can mount via the standalone fuse client:
modprobe fuse mkdir mnt make cfuse && ./cfuse mnt
$ cd linux $ patch -p1 < ~/ceph/src/kernel/kconfig.patch patching file fs/Kconfig patching file fs/Makefile $ cp ~/ceph/src/kernel/sample.uml.config .config $ ln -s ~/ceph/src/kernel fs/ceph $ ln -s ~/ceph/src/include/ceph_fs.h include/linux $ make ARCH=umI am using this x86_64 Debian UML root fs image, but any image will do (see http://user-mode-linux.sf.net) as long as the architecture (e.g. x86_64 vs i386) matches your host. Start up the UML instance with something like
./linux ubda=Debian-3.1-AMD64-root_fs mem=256M eth0=tuntap,,,1.2.3.4 # 1.2.3.4 is the _host_ ipNote that if UML crashes/oopses/whatever, you can restart quick-and-dirty (up arrow + enter) with
reset ; killall -9 linux ; ./linux ubda=Debian-3.1-AMD64-root_fs mem=256M eth0=tuntap,,,1.2.3.4You'll need to configure the network in UML with an unused IP. For my debian-based root fs image, this /etc/network/interfaces file does the trick:
iface eth0 inet static address 1.2.3.5 # unused ip in your host's netowrk netmask 255.0.0.0 gateway 1.2.3.4 # host ip auto eth0Note that you need install uml-utilities (apt-get install uml-utilities on debian distros) and add yourself to the uml-net group on the host (or run the UML instance as root) for the network to start up properly.
Inside UML, you'll want an /etc/fstab line like
none /host hostfs defaults 0 0You can then load the kernel client module and mount from the UML instance with
insmod /host/path/to/ceph/src/kernel/ceph.ko mount -t ceph 1.2.3.4:/ -o monport=12345,ip=1.2.3.5 mnt # 1.2.3.4 is host, 1.2.3.5 is uml ip
mpd & # for a single host mpiboot -n 10 # for multiple hosts (see MPICH docs) make newsyn && mpiexec -l -n 10 ./newsyn --mkfs --nummds 1 --numosd 6 --numclient 20 --syn writefile 100 16384You will probably want to make dev/osd.all a symlink to some block device that exists on every node you're starting an OSD on. Otherwise, you'll need a symlink (for "block device" file) for each osd. If you want to mount a distributed FS (instead of generating a synthetic workload), try
make newsyn && mpiexec -l -n 10 ./newsyn --mkfs --nummds 2 --numosd 6 --numclient 0 # 0 clients, just mds and osds # in another terminal, mkdir mnt make cfuse && ./cfuse mnt # and in yet another terminal, ls mnt touch mnt/asdf # etcCurrently, when the last client (cfuse instance, in this case) shuts down, the whole thing will shut down. Assuming things shut down cleanly, you should be able to start things up again without the --mkfs flag and recover the prior file system state.
Application | |||||
kernel | |||||
Application | FUSE glue | ||||
Client | MDS | ||||
Filer | ObjectCacher | MDLog | MDStore | ||
Objecter | |||||
(message layer) | |||||
OSD | |||||
ObjectStore | |||||
EBOFS | FakeStore | ||||
BlockDevice | |||||
Kernel POSIX interface | |||||
Key: | Network | Entity | Lib/module | Abstract interface | Kernel |