分类: 服务器与存储
2010-04-22 18:35:48
|
目录 |
介绍配置glusterfs模拟存储集群:
为每个存储服务端建立一个目录:
$ sudo mkdir /home/cfs{0,1,2,3}$ sudo chmod 1777 /home/cfs{0,1,2,3}$ ls -ld /home/cfs[0-3]drwxrwxrwt 2 root root 4096 2007-01-14 13:42 /home/cfs0drwxrwxrwt 2 root root 4096 2007-01-14 13:42 /home/cfs1drwxrwxrwt 2 root root 4096 2007-01-14 13:42 /home/cfs2drwxrwxrwt 2 root root 4096 2007-01-14 13:42 /home/cfs3然后为每个服务端编写一个vol配置文件,使之监听不同端口。
volume brick type storage/posix option directory /home/cfs0end-volume volume server type protocol/server option transport-type tcp/server option listen-port 6996 option bind-address 127.0.0.1 subvolumes brick option auth.ip.brick.allow 127.0.0.1end-volumevolume brick type storage/posix option directory /home/cfs1end-volume volume server type protocol/server option transport-type tcp/server option listen-port 6997 option bind-address 127.0.0.1 subvolumes brick option auth.ip.brick.allow 127.0.0.1end-volumevolume brick type storage/posix option directory /home/cfs2end-volume volume server type protocol/server option transport-type tcp/server option listen-port 6998 option bind-address 127.0.0.1 subvolumes brick option auth.ip.brick.allow 127.0.0.1end-volumevolume brick type storage/posix option directory /home/cfs3end-volume volume server type protocol/server option transport-type tcp/server option listen-port 6999 option bind-address 127.0.0.1 subvolumes brick option auth.ip.brick.allow 127.0.0.1end-volumevolume client0 type protocol/client option transport-type tcp/client option remote-host 127.0.0.1 option remote-port 6996 option remote-subvolume brickend-volume volume client1 type protocol/client option transport-type tcp/client option remote-host 127.0.0.1 option remote-port 6997 option remote-subvolume brickend-volume volume client2 type protocol/client option transport-type tcp/client option remote-host 127.0.0.1 option remote-port 6998 option remote-subvolume brickend-volume volume ns type protocol/client option transport-type tcp/client option remote-host 127.0.0.1 option remote-port 6999 option remote-subvolume brickend-volume volume bricks type cluster/unify subvolumes client0 client1 client2 namespace ns option rr.limits.min-free-disk 10GB # In later versions, its changed to % based value. option scheduler rrend-volume ### Add writebehind featurevolume writebehind type performance/write-behind option aggregate-size 131072 # unit in bytes subvolumes bricksend-volume ### Add readahead featurevolume readahead type performance/read-ahead option page-size 65536 # unit in bytes option page-count 16 # cache per file = (page-count x page-size) subvolumes writebehindend-volume启动4个服务监听各自端口,守护各自目录:
$ sudo glusterfsd -f ./server0.vol
$ sudo glusterfsd -f ./server1.vol
$ sudo glusterfsd -f ./server2.vol
$ sudo glusterfsd -f ./server3.vol
$ ps w -C glusterfsd
PID TTY STAT
TIME COMMAND
13524 ? Ss 0:00 [glusterfsd]
13526 ? Ss 0:00 [glusterfsd]
13528 ? Ss 0:00 [glusterfsd]
13532 ? Ss 0:00 [glusterfsd]
然后通过客户端挂载:
$ mkdir ./glusterfs
$ sudo glusterfs -f ./client.vol ./glusterfs
检查是否挂载成功:
$ mount | tail -1
glusterfs:13548 on /home/toad/gfs/glusterfs type fuse
(rw,allow_other,default_permissions)
说明挂载成功!
进一步阅读