4

assume if I synchronized two servers and I used DRBD, and after I synced them I installed application on both, if I wanted to add a third server. is that possible? since I think I should create block device and use it in the installation and that is made during configuration of the DRBD on both servers

if yes, is that (add more servers in future) also applicable to NextCloud servers?

Thanks

ibr
  • 91
  • 6

4 Answers4

7

As it was mentioned already, DRBD isn't greatest solution especially if you have a requirements for further scale. I believe that the best solution on Linux would be Ceph Cluster - https://en.wikipedia.org/wiki/Ceph_(software) with its native cluster aware file system CephFS. For the configuration of an HA storage on Windows, take into account StarWind VSAN Free, which can be deployed in cloud as well (Asure/AWS).

batistuta09
  • 8,981
  • 10
  • 23
  • 1
    Hi, when you said **"the best solution on Linux would be Ceph Cluster"** does that include `Ubuntu 16.04` ? since i had troubles before of not supported application with Ubuntu – ibr Feb 06 '18 at 11:13
  • 1
    also is it scalable in future? – ibr Feb 06 '18 at 12:55
  • 1
    by the way my case is that i have Amazon EC2 instances and i already configured them in High Availability mode but what i need to do is to use something like DEBD to install some applications and for loggings, so i would have these application working as a one on the EC2 instances cluster that i already have configured, is Ceph Cluster fit for that scenario? – ibr Feb 06 '18 at 13:10
  • 2
    Ceph is super-scalable! You can add new OSD and rebalance your data every single moment. – BaronSamedi1958 Feb 06 '18 at 16:40
5

Yes, you can absolutely do that! See:

https://docs.linbit.com/doc/users-guide-83/s-three-nodes/

The only problem you need to have cluster-aware file system or do active-passive-passive mode with file system remount on failover (in this case only one node can have operational write-capable application). Good cover story is here:

https://forums.starwindsoftware.com/viewtopic.php?f=5&t=1392

P.S. DRBD isn't greatest solution we have for HA storage these days, so I'd encourage to take a look at something more OS-specific.

BaronSamedi1958
  • 13,676
  • 1
  • 21
  • 53
  • 1
    It's not even clear what exactly OP wants to synchronize, and a cluster file system is a minimal requirement to even read DRBD resource on the second server, as a secondary device can't be even read (so, with DRBD, active/passive setups are not possible). – Sven Feb 04 '18 at 15:43
  • 2
    You can use non-clustered file system with non-readable second replica. – BaronSamedi1958 Feb 05 '18 at 16:43
  • 1
    DRBD has autopromote features in DRBD 9, so any attempt to access the data on the secondary server after the primary has failed will result in the secondary promoting to primary. DRBD is one of the most generic replication tools out there. It replicates at the block level, and almost everything gets put down to a block device at some point... Sure, if you have something specific (like database replication for example), use that, but otherwise I'd be surprised if DRBD doesn't fit the bill. – Matt Kereczman Feb 06 '18 at 15:10
  • 1
    This is what I was trying to tell to @Sven. P.S. Thanks for downvote, I appreciate that! :( – BaronSamedi1958 Feb 06 '18 at 16:43
2

DRBD 9 can scale to 31 replicas of your data, so 32 nodes. DRBD 8 was limited to 4 nodes through stacking, but it was still possible. You can certainly start with 2 nodes, and then add a third with DRBD 8 or 9.

DRBD is in the mainline Linux kernel, so unless NextCloud is only providing distros that remove DRBD from the kernel, it will be and work there.

There seem to be some misconceptions flying around about DRBD in this thread: You don't need any cluster aware filesystems for DRBD in Active-Passive mode. You would in Active/Active, same as with a shared block device on a SAN. Also, DRBD 9 scales pretty well with up to 32 nodes per cluster, with fancy ways to increase that number.

Matt Kereczman
  • 1,899
  • 9
  • 12
  • 1
    after there has been mention by *batistuta09* about Ceph, im thinking to shift to it instead of DRBD, is really Ceph better that DRBD?, also the installation of Ceph is not as straight forward as DRBD, after reading Documents still can tell if osd node is a server node or not, and does Ceph or with Ubuntu 16 EC2 instances or not? .....thanks – ibr Feb 06 '18 at 15:14
  • 1
    Honestly, you're probably best off trying both in your situation and deciding for yourself. With Ceph there will have to be some form of locking across nodes to prevent concurrent access, which usually comes with a performance impact, but it would be hard to gauge without trying. – Matt Kereczman Feb 06 '18 at 15:26
  • 2
    @ibr Ceph needs many nodes to get reasonably high performance, it just starts with 3 nodes as a minimum and I'd say 8 is a reasonable number to put into production. DRBD is 2-node solution by design so... It's basically apples to oranges :) – BaronSamedi1958 Feb 06 '18 at 16:40
  • @BaronSamedi1958: DRBD 8 is two nodes by design, DRBD 9 is up to 32 nodes by design ;) They're two completely different softwares. LINBIT has taken to calling DRBD 9: "LINBIT SDS", and DRBD 8: "LINBIT HA". – Matt Kereczman Feb 06 '18 at 18:25
  • OK so assuming i have two nodes running now, after 6 months i wanted to add another node, how to add it? because honestly in the installation guide it seems that its one time configuration and i didn't find any reference on how to add more nodes in future at DRBD.....with the consideration i have AWS RDS as DB for all instances and S3 bucket as storage, thanks – ibr Feb 07 '18 at 08:14
-3

Unless you use a specialized cluster-aware file system, you can't use DRBD to sync file systems of two running servers. The reason is that both servers would think they have exclusive access to the file system and overwrite changes made by the other one. Total file system loss will be the result.

Nextcloud works very differently, but is also not really suitable to sync general file systems of two servers, because it's really easy to make conflicting changes in the same file. In some cases, it could be used to sync data directories, but you have to be aware how Nextcloud works and how your application work to see if this could work out.

-- Edit

If you goal is to cluster a Nextcloud installation, DRBD is not a very good solution, as you could use it only for a small part of what makes up a Nextcloud server. Things like the SQL database can not be clustered in this way.

Read https://docs.nextcloud.com/server/9/admin_manual/operations/scaling_multiple_machines.html

Sven
  • 98,649
  • 14
  • 180
  • 226
  • 1
    Thanks sven for the answer, but I didn't get exactly what do you mean by "sync general file systems of two servers", my case is installed NextCloud servers and to "Mirror Sync" client's files, is that what you meant?......also it seems you know DRBD well, so one more question, does it work with AWS EC2 (Ubuntu) instances? – ibr Feb 04 '18 at 13:59
  • 1
    I think what you meant is that syncing two servers using the NextCloud, but actually I need to Sync two servers that is installed on them NextCloud, so the case is to sync between two servers that contain NextCloud, then add another server that contains NextCloud, also I found this [article](https://help.ubuntu.com/lts/serverguide/drbd.html) does it work with EC2 or there is another approach? thanks – ibr Feb 04 '18 at 15:19
  • 1
    well, there is the trick, since I already use an AWS RDS as database for all NextCloud servers, and S3 bucket as a primary storage for all servers as well, so I only need DRBD for NextCloud installation so they work as one :) – ibr Feb 05 '18 at 08:04
  • 2
    No need for cluster aware filesystems with DRBD. DRBD is "shared nothing clustering", so you're more likely to diverge data than corrupt it, but DRBD 9 has quorum features that will help prevent even that. You can certainly replicate a database with DRBD as well btw... – Matt Kereczman Feb 06 '18 at 15:16
  • 1
    @MattKereczman: We come back to the question what exactly OP wants to achieve. HA with failover would work without a cluster FS, but if the goal is load-balancing (where all clients needs RW access to the data store), you would need a cluster FS to make use of DRBD (IIRC, in DRBD8 you can't even mount a non-primary DRBD volume). – Sven Feb 06 '18 at 15:31
  • 1
    @Sven: Sure; that's still true about DRBD. However, there is a lot of speculation about what OP wants to do, when really, he just asked a very simple question of whether you can add a node to a DRBD cluster, and whether that still works in NextCloud deployments. – Matt Kereczman Feb 06 '18 at 15:40
  • Hi, i have the following, AWS EC2 instances, and database for them is AWS RDS, and their primary storage is S3, now i ONLY found this guide on how to make the instances works as one server(Synced) is this [article](https://help.nextcloud.com/t/nexcloud-server-sync/2165) forgetting Pacemaker and Corosync i already havemade HA cluster to EC2s, but as you can see in the article IT'S required by NextCloud to use Storage Sync for *installation* so honestly right now, i don't know which to use? Ceph or DRBD?......thanks – ibr Feb 07 '18 at 08:24