本文介紹如何將cephfs映射到windows的一個盤上,以磁盤映射的方式訪問cephfs。
https://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm-gcc-5.1.0-3.exe/download
dokan-0.6.0:
https://github.com/dokan-dev/dokany/wiki/Installation#choose-a-version
boost_1_63_0:
http://www.boost.org/users/history/version_1_63_0.html
1.下載必要安裝包
tdm-gcc:(安裝時選32位)https://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm-gcc-5.1.0-3.exe/download
dokan-0.6.0:
https://github.com/dokan-dev/dokany/wiki/Installation#choose-a-version
boost_1_63_0:
http://www.boost.org/users/history/version_1_63_0.html
2.編譯
步驟1:安裝tdm-gcc;(安裝時選32位);步驟2:將boost_163_0的源碼解壓到C:\boost_1_63_0;
步驟3:編譯boost;
到C:\boost_1_63_0目錄下,以管理員身份運行命令行:
C:\boost_1_63_0> .\bootstrap.bat gcc
C:\boost_1_63_0> .\b2 toolset=gcc --with-system
步驟4:編譯dokan;
將dokan源碼解壓到C:\ceph-dokan;修改Makefile,在libcephfs.dll后添加$(BOOST_SYSTEM_LIB)

執行編譯命令:
C:\ceph-dokan> mingw32-make ceph-dokan.exe C:\ceph-dokan> mingw32-make libcephfs.dll C:\ceph-dokan> mingw32-make test-cephfs.exe
3.安裝和使用
修改C:\ceph-dokan路徑下的ceph.conf(目前只支持auth=none),所以服務端也需要免鑒權mon addr = 10.0.0.183:6789
執行掛在命令,其中m是盤符,
C:\ceph-dokan> .\ceph-dokan.exe -c ceph.conf -l m
如果后台運行,以管理員身份運行命令行以下命令即可:
start /b C:\ceph-dokan\ceph-dokan.exe -c C:\ceph-dokan\ceph.conf -l m
最后執行成功結果如下: