使用glusterfs API

如果是通过rpm安装的glusterfs

 

在执行 glusterfs/api/example/gfapi.py 之前,需要执行

 

ln -s /usr/lib64/libglusterfs.so.0 /usr/lib64/libglusterfs.so
ln -s /usr/lib64/libgfapi.so.0 /usr/lib64/libgfapi.so
ln -s /usr/lib64/libgfxdr.so.0 /usr/lib64/libgfxdr.so

 

 运行:python gfapi.py abc /mnt


PASS: wrote 5 bytes
PASS: read 'fubar'
PASS: lstat got correct size 5
FAIL: new path not working after rename
  (skipping known failure)
PASS: unlink worked
PASS: mkdir worked
PASS: create (in dir) worked
PASS: directory listing worked
PASS: unlink (in dir) worked
FAIL: dir still there after rmdir
  (skipping known failure)
PASS: setxattr worked
PASS: getxattr worked
PASS: listxattr worked
2 failures (2 expected)

 

 

 在编译 glusterfs/api/example/glfsxmp.c 之前,需要执行

 

> cd api/example/

> sed -i s/"api\/"// glfsxmp.c

编译glfsxmp.c

> gcc -o glfsxmp glfsxmp.c -I../src/ -lgfxdr -lgfapi

你可能感兴趣的:(gluster)