Re: questions about rbd image

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Well connecting an rbd to two servers would be like mapping a block
device from a storage array onto two different hosts,
that's is possible and (was) done.
(it would be much more difficult though to connect a single physical
harddisk to two computers)

The point is that as mentioned above you would need a cluster aware
filesystem on that rbd.
Not and ext4, not a zfs but gfs2 was mentioned above, I tried it once
just for fun using ocfs2 and it worked.

I wouldn't do that though nowadays (especially not in production).
AFAIK "cluster aware" filesysstem came a while BEFORE "clusterd and
distributed" filesystems.

With ocfs2 on rbd (one mount is read/write, second and following
mounts are read only right) you have to take care of two layers,
so two layers of prossible problems.

What you probably really want to have is a "clustered distributed
filesystem" such as cephfs or glusterfs (as to name two of them)
you can have as many replicas as you like, any number of host can
mount and read-write onto such a filesystem and - given the right set
up -
a bunch of hosts can even fail and the "clustered distributed"
filesystem is still available.

hth

On Mon, Dec 11, 2017 at 3:37 PM, David Turner <drakonstein@xxxxxxxxx> wrote:
> An RBD can only be mapped to a single client host.  There is no way around
> this.  An RBD at its core is a block device.  Connecting an RBD to 2 servers
> would be like connecting a harddrive to 2 servers.
>
> On Mon, Dec 11, 2017 at 9:13 AM 13605702596 <13605702596@xxxxxxx> wrote:
>>
>> hi Jason
>> thanks for your answer.
>> there is one more question, that is:
>> can we use rbd image to share data between two clients? one wirtes data,
>> another just reads?
>>
>> thanks
>>
>>
>> At 2017-12-11 21:52:54, "Jason Dillaman" <jdillama@xxxxxxxxxx> wrote:
>> >On Mon, Dec 11, 2017 at 7:50 AM, 13605702596@xxxxxxx
>> ><13605702596@xxxxxxx> wrote:
>> >> hi
>> >>
>> >> i'm testing on rbd image. the are TWO questions that confused me.
>> >> ceph -v
>> >> ceph version 10.2.10 (5dc1e4c05cb68dbf62ae6fce3f0700e4654fdbbe)
>> >> uname -r
>> >> 3.10.0-514.el7.x86_64
>> >>
>> >> (1)  does rbd image supports multiple clients to write data
>> >> simultaneously?
>> >
>> >You would need to put a clustered file system like GFS2 on top of the
>> >block device to utilize it concurrently.
>> >
>> >> if it supports, how can share data between several clients using rbd
>> >> image?
>> >> client A: write data to rbd/test
>> >> client B: rbd map, and mount it to /mnt, file can be found in /mnt dir,
>> >> but
>> >> the content is miss.
>> >>
>> >> on monitor:
>> >> rbd create rbd/test -s 1024
>> >> rbd info rbd/test
>> >> rbd image 'test':
>> >> size 1024 MB in 256 objects
>> >> order 22 (4096 kB objects)
>> >> block_name_prefix: rbd_data.121d238e1f29
>> >> format: 2
>> >> features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
>> >> flags:
>> >> then i disble the feature: object-map, fast-diff, deep-flatten
>> >>
>> >> on client A:
>> >> rbd map rbd/test
>> >> mkfs -t xfs /dev/rbd0
>> >> mount /dev/rbd/rbd/test /mnt/
>> >> echo 124 > /mnt/host124
>> >> cat host124
>> >> 124
>> >>
>> >> on client B:
>> >> rbd map rbd/test
>> >> mount /dev/rbd/rbd/test /mnt/
>> >> cat  host124  --> show nothing!
>> >>
>> >> echo 125 > /mnt/host125
>> >> cat /mnt/host125
>> >> 125
>> >>
>> >> then on client C:
>> >> rbd map rbd/test
>> >> mount /dev/rbd/rbd/test /mnt/
>> >> cd /mnt
>> >> cat host124 --> show nothing!
>> >> cat host125 --> show nothing!
>> >>
>> >> (2) does rbd image supports stripping? if does, howto?
>> >
>> >Not yet, but it's a work-in-progress for krbd to support "fancy"
>> >striping (librbd would support it via rbd-nbd).
>> >
>> >> on monitor, i create an image as following:
>> >> rbd create rbd/test --image-feature layering,striping,exclusive-lock
>> >> --size
>> >> 1024 --object-size 4096 --stripe-unit 4096  --stripe-count 2
>> >> stripe unit is not a factor of the object size
>> >> rbd create rbd/test --image-feature layering,striping,exclusive-lock
>> >> --size
>> >> 1024 --object-size 8M --stripe-unit 4M --stripe-count 2
>> >> rbd: the argument ('4M') for option '--unit' is invalid
>> >> i don't know why those cmd fails?
>> >
>> >Only Luminous and later releases support specifying the stripe unit
>> >with B/K/M suffixes.
>> >
>> >> finally, i successed with the following cmd:
>> >> rbd create rbd/test --image-feature layering,striping,exclusive-lock
>> >> --size
>> >> 1024 --object-size 8388608 --stripe-unit 4194304  --stripe-count 2
>> >>
>> >> but whe i map it on client, it fails.
>> >> the error msg:
>> >> rbd: image test: unsupported stripe unit (got 4194304 want 8388608)
>> >>
>> >> best wishes
>> >> thanks
>> >>
>> >> ________________________________
>> >> 13605702596@xxxxxxx
>> >>
>> >> _______________________________________________
>> >> ceph-users mailing list
>> >> ceph-users@xxxxxxxxxxxxxx
>> >> http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com
>> >>
>> >
>> >
>> >
>> >--
>> >Jason
>>
>> _______________________________________________
>> ceph-users mailing list
>> ceph-users@xxxxxxxxxxxxxx
>> http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com
>
>
> _______________________________________________
> ceph-users mailing list
> ceph-users@xxxxxxxxxxxxxx
> http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com
>
_______________________________________________
ceph-users mailing list
ceph-users@xxxxxxxxxxxxxx
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com



[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux