使用两台Seagate GoFlex Home网络存储部署glusterfs分布式文件系统之后,我准备使用其中一个节点(如果支持浮动IP就更好)来挂载glusterfs卷。目的是为了实现部署跨网络镜像的TimeMachine存储

  • 在Arch Linux ARM上使用netatalk协议输出glusterfs存储卷
  • 将Apple产品(Mac/Iphone)的数据存储到glusterfs上,以便能够实现双副本备份。

配置 nas1/etc/fstab 添加内容如下

127.0.0.1:/g_backup    /g_data/g_backup  glusterfs       defaults,_netdev         0 0

然后挂载存储目录

mount /g_data/g_backup

使用的设备是Segate GoFlex Home网络存储,这个存储只有 128MB 内存,运行 glusterfs 服务器勉强可以,但是在使用glusterfs客户端挂载的时候有错误日志如下:

[2014-10-26 15:33:52.943617] E [quick-read.c:827:check_cache_size_ok] 0-g_backup-quick-read: Cache size 134217728 is greater than the max size of 124276736
[2014-10-26 15:33:52.943768] E [xlator.c:403:xlator_init] 0-g_backup-quick-read: Initialization of volume 'g_backup-quick-read' failed, review your volfile again
[2014-10-26 15:33:52.943849] E [graph.c:307:glusterfs_graph_init] 0-g_backup-quick-read: initializing translator failed
[2014-10-26 15:33:52.943921] E [graph.c:502:glusterfs_graph_activate] 0-graph: init failed
[2014-10-26 15:33:52.945593] W [glusterfsd.c:1095:cleanup_and_exit]  0-: received signum (0), shutting down
[2014-10-26 15:33:52.945712] I [fuse-bridge.c:5475:fini] 0-fuse: Unmounting '/g_data/g_backup'.
[2014-10-26 15:33:52.977175] W [glusterfsd.c:1095:cleanup_and_exit]  0-: received signum (15), shutting down

由于我这个是个人使用的存储设备,对性能要求不高,可以缩减缓存来满足glusterfs客户端运行,所以我准备将缓存调整成32MB

gluster volume info

显示输出(尚未添加参数)

Volume Name: g_backup
Type: Replicate
Volume ID: ad43bc1a-20c4-4f75-b6c1-8382d54064ec
Status: Started
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: 192.168.1.91:/data/backup
Brick2: 192.168.1.92:/data/backup

设置存储卷缓存为32MB

gluster volume set g_backup performance.cache-size 32MB

设置成功后,再次使用 gluster volume info 可以看到卷信息增加了以下内容

Options Reconfigured:
performance.cache-size: 32MB

再次挂载glusterfs卷则成功了。