Тёмный

How to use Heartbeat and DRBD for HA (high availability) 

Daniel Persson
Подписаться 11 тыс.
Просмотров 9 тыс.
50% 1

We look into high availability using Heartbeat and DRBD. Heartbeat is a software to monitor and failover when a machine is unresponsive and DRBD can help you replicate data between machines making your setup highly available. This solution can help you doing maintenance work without downtime.
Git repository:
github.com/kalaspuffar/high-a...
Join the Google Cloud-led certificate program on Coursera and dive into security principles in cloud computing. Master cloud risk management and attack mitigation techniques. Equip yourself with cutting-edge cybersecurity skills.
imp.i384100.net/c/3402234/209...
Get Proficient knowledge in Azure services and infrastructures, managing cloud resources, cloud security with our Cloud Support Associate Certificate !
imp.i384100.net/c/3402234/203...
Join the channel to get access to more perks:
/ @danielpersson
Or visit my blog at:
danielpersson.dev
Outro music: Sanaas Scylla
#dbrd #heartbeat #available

Опубликовано:

 

21 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 49   
@governmentcheese2257
@governmentcheese2257 3 года назад
I fought this for 4 days until i found your video. Thank you so much!
@jamallmahmoudi9481
@jamallmahmoudi9481 6 месяцев назад
HI, Daniel great video, Thank a lot for sharing 🙏
@alissonsilva1412
@alissonsilva1412 3 года назад
A man, a legend, a world treasure
@smoocher
@smoocher Год назад
Outstanding video, thank you!
@gunasekarkesavalu921
@gunasekarkesavalu921 3 года назад
Thanks lot Daniel...It is very good
@ubuntux22
@ubuntux22 3 года назад
love that blade runner style background music
@AndreBarretoism
@AndreBarretoism 3 года назад
You just saved our discipline work. Thank you very much for this tutorial.
@rupesharora8561
@rupesharora8561 3 года назад
Hey Daniel Persson instaed of hearbeat you can use keepalived to do failover, moreover it will assign virtual IP itself. I also used keepalived with drbd to do complete failover.
@DanielPersson
@DanielPersson 3 года назад
Hi Rupesh. Great suggestion. We use virtual IPs as well and switch over when Heartbeat switches machine. So both solutions work, but our implementation is something we used for a while and is stable. But I guess there are many other great solutions for this problem that you can try out. Thank you for watching my videos. Best regards Daniel
@johnkarippery9919
@johnkarippery9919 3 года назад
Finally, I found a RU-vidr in my field. thank you so much for this video. I have few questions. I think it is better to use the pacemaker cluster. what is your opinion? How can sync 3 servers or more for free (drbd9 is not free)? Is that possible to mount a different folder to drbd? for that, should I make different resources in drbd conf file? Thank you again
@DanielPersson
@DanielPersson 3 года назад
Hi John. Thank you for watching my videos. I'm sorry, but I might not have the answers you seek. I've never used pacemaker, so I don't have any opinion there. Using more than 2 servers in this kind of setup might not be the best solution. I would switch over to a Ceph cluster at that point. DRBD doesn't really map directories, to my knowledge. They work on devices, or at least that is the most efficient way to use them. But using multiple virtual devices in different directories would probably work just fine. And in that case, that would be multiple resources. I hope this helps. Best regards Daniel
@francanales442
@francanales442 3 года назад
Hi Daniel. Your explanation is great and very clear, this situation is exactly what I need for a share nfs resource with an extra redundant optons in case of a failover. I've folowed the vide step by step but there is something that is not working in my case. When I turn of one of the nodes (with for example init 0 comand), the secondary server gets control of he drbd, but if I tur on the primary server again, it is not mounting correctly the drbd resource.
@DanielPersson
@DanielPersson 3 года назад
Hi Fran. That is strange. Usually, it takes over when heartbeat finds that the resource is available again. The message log usually gives you some indication of the status of your services. Perhaps it will yield an error that could help you progress. I hope this helps. Thank you for watching my videos. Best regards Daniel
@francanales442
@francanales442 3 года назад
@@DanielPersson I will check the logs, it is something that I must mount.
@PraveenNelsonv6
@PraveenNelsonv6 3 года назад
Hi Daniel, can i do Active/Active with GFS2 Filesytsem on this setup? can i avoid pacemaker, corosync (it just becoming complex) thanks for the video!
@DanielPersson
@DanielPersson 3 года назад
Hi Praveen. Thank you for watching my videos. To my knowledge, you can't have multiple active filesystems. It would make the model much more complex and harder to manage. Perhaps a system could handle that for you, but if you need a solution for an always-on disk that could expand, I will look into a Ceph solution. I have videos about that as well on my channel. I hope this helps. Best regards Daniel
@dennismoral2700
@dennismoral2700 4 года назад
Hi Daniel, i really want to learn what youre doing, what course should i take to learn creating configuratuon and to understand the languages you use, please it is a big matter for me.TIA
@DanielPersson
@DanielPersson 4 года назад
Hi Dennis. Thank you for watching my videos. Most of the things I know I figure out by doing. But if you are looking for solid courses or more material then I could point you to www.itpro.tv/ I have not used them myself but I listen to twit.tv and they recommend them as an authority when it comes to devops so you should probably be able to find good material over there. Best regards Daniel
@davidchang5862
@davidchang5862 Год назад
Hi Daniel. Just like to clarify. Can DrDb Cluster help to avoid a split brain or jeopardy scenario which often is fixed or handled with the use of fencing or a quorum disk ? Thanks
@DanielPersson
@DanielPersson Год назад
Hi David. Well, I'm not sure of all the ways of using DRBD. But our use-case is using one Primary and then a Secondary and both should never be writeable at the same time. I know that we have had both active at the same time and gotten problems but our solution have mostly been to choose one of the copies and replace with the other. So not a great situation. Might be more advanced routes for handling the split brain scenario. I hope this helps. Thank you for watching my videos. Best regards Daniel
@davidchang5862
@davidchang5862 Год назад
@@DanielPersson Thanks Daniel. I see what I can do to explore this whole contraption :)
@irajnorouzi3974
@irajnorouzi3974 3 года назад
thanks a lot Daniel Persson.i have a question:i want use from drbd for 10 T storage thats can work for me?Does Drbd Service have a block storage limit?
@DanielPersson
@DanielPersson 3 года назад
Hi, Iraj. DRBD is multi write over multiple instances, usually between two hosts, and I don't think that the block storage size has a limit, but then again, I've not read up on the subject. I know that we have instances with a couple of terabytes using DRBD and that works just fine. If you are looking to create a fallback system with huge data loads, then perhaps a solution like Ceph could be better suited for it. I have a couple of videos about that as well. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Uvbp3mtOltw.html ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-XtfjYp8ikaU.html I hope this helps. Best regards Daniel
@irajnorouzi3974
@irajnorouzi3974 3 года назад
@@DanielPersson thank you so much freind.
@maximefromspace3001
@maximefromspace3001 2 года назад
Hi DP, and thx much 4 that vdo. Why not make loadbalancing, since the servers are exactly the same thx 2 DRBD ?
@DanielPersson
@DanielPersson 2 года назад
Hi Maxime Thank you for watching my videos. Sadly, the DRBD disk is configured in a primary/secondary setup where the secondary mirrored disk is read only and in our case not even mounted. So to switch over you need to change the primary to secondary and then mount the drive on the secondary machine. This is fast so switching over don't give any down time and is good for fail over. But if you want a high availability you should have 3-4 servers at least with load balancer and shared storage. Perhaps using Ceph. I hope this helps Best regards Daniel
@maximefromspace3001
@maximefromspace3001 2 года назад
@@DanielPersson Yeah thx, I thought DRBD could allow me to have 2 servers running at the same time, with a load balancing. Think it's possible ? And.. I'm afraid DRBD allows only the sharing of a partition, not the whole system ? Maybe I need Gluster (3 machines but one only is front). I'd like 2 clones working 2gether in fact it's 4 a commercial website. THX v3ry much
@DanielPersson
@DanielPersson 2 года назад
Hi Maxime. I don't think it's possible, but you might prove me wrong :) Gluster could be a good solution. We use Ceph and then multiple web frontends using the same backend data. However, there are so many solutions out there to load balance and handle your data that you should probably find a solution that fits your need. In our case, we have a production environment where the load is not that high, and we need redundancy to do maintenance, and if a machine goes down, there should be another takeover, then DRBD is a good choice. But for a more significant website, you should probably have a bunch of frontends handling the delivery of pages and then have the backbone to deliver data. I hope this helps. Best regards Daniel
@jdrosarios
@jdrosarios 3 года назад
doing this with centos but cannot find heartbeat to install it... is there a repo for this im not aware of? thank you for this video... now i cannot live quiet anymore knowing it is possible to do this without any issues. or rocket science... ;)
@DanielPersson
@DanielPersson 3 года назад
Hi Jose. Thank you for watching my videos. I think you have to Google that, I'm afraid. Have not worked a lot with Centos. Most distros have Heartbeat as a package, but there might be a transition, so they only have Pacemaker as a package now as Heartbeat, for some reason, is thought of as old and deprecated even though it's easy and solves the problem. I hope this helps Best regards Daniel
@prestonrakobe584
@prestonrakobe584 2 года назад
I managed to run heartbeat actively, but when I switch it off on the vm1, it does not send sharefs contents to vm2 but it can see that vm1 is down and it says "foreign resources acquired - take over complete for node vm1"
@prestonrakobe584
@prestonrakobe584 2 года назад
actually everything seems to be running accordingly, but it is not writting to the sharefs
@DanielPersson
@DanielPersson 2 года назад
Hi Preston. Thank you for watching my videos. To get the switch over for DRBD, you need to configure the interface to change the server to primary when the other goes down. So if you check your DRBD status on VM2, it should be secondary when VM1 is running. When you turn off VM1 or stop heartbeat, VM2 should notice it and switch the DBRD instance to primary and handling reads and writes. If it stays in the secondary mode, you can't modify the drive. I hope this helps. Best regards Daniel
@prestonrakobe584
@prestonrakobe584 2 года назад
hello @Daniel, can you share a source to which I can get heartbeat. I can't seem to locate a source file.
@DanielPersson
@DanielPersson 2 года назад
Hi Preston I don't know if heartbeat is open source, I only used the packages that came with debian. So looking for an executable solution you should be able to install it with your package manager. If you need source then Slackware might have the code for the package. I hope this helps. Thank you for watching my videos. Best regards Daniel
@prestonrakobe584
@prestonrakobe584 2 года назад
@@DanielPersson I managed to find heartbeat. It was just a matter of fetching it using wget.
@user-eh7fm7yi2h
@user-eh7fm7yi2h 8 месяцев назад
HI how to share drbd0 resources between two ore more VM
@DanielPersson
@DanielPersson 7 месяцев назад
Hi bveh Sharing between two VMs is no problem, it's what I do in the video. Same setup as I describe in the video. But using more than two VMs are not supported by DRBD as it's a mirror solution between two drives. I hope this helps. Best regards Daniel
@3a_rafiachmadfadilah772
@3a_rafiachmadfadilah772 Год назад
hi daniel, i trying to configuration the drbd, and i will create the meta data block, use drbdadm create-md resource, and the device or resource are busy, i dont know how to solve this :((
@DanielPersson
@DanielPersson Год назад
Hi Achmad. The device being busy usually means that it's in use by another process. Perhaps you have mounted it or maybe the system is doing some other job against the drive. My suggestion would be to reboot the computer to see if you can rectify the problem. There is also tooling like lsof or similar that can see what program or process is currently using the resource. I hope this helps. Thank you for watching my videos. Best regards Daniel
@3a_rafiachmadfadilah772
@3a_rafiachmadfadilah772 Год назад
@@DanielPersson thanks for respons my comment, i can solve this problem, but i wanna ask, how to create an account linbit danielss :(
@DanielPersson
@DanielPersson Год назад
Hi Achmad I'm sorry, but I don't understand the question. Best regards Daniel
@3a_rafiachmadfadilah772
@3a_rafiachmadfadilah772 Год назад
@@DanielPerssonsorry if my question make u dont understand, i mean when i stop the heartbeat service's at the node 1, status of node 2 is not change to primary, how can i solve this daniel
@3a_rafiachmadfadilah772
@3a_rafiachmadfadilah772 Год назад
the error code like this, 0: State change failed: (-12) Device is held open by someone Command 'drbdsetup-84 secondary 0' terminated with exit code 11
@carrywang2391
@carrywang2391 3 года назад
Hi. Could I replicate the entire machine by drbd ?
@DanielPersson
@DanielPersson 2 года назад
Hi 王策 I would not recommend that setup. DRBD is more suitable for getting live sync between different hard drives to have a live copy. So you easily could switch over, but writing an entire system could be a hazard. Best regards Daniel
@dkkaran1996
@dkkaran1996 10 месяцев назад
Is there any floating IP like that?
@DanielPersson
@DanielPersson 10 месяцев назад
Hi Kirubhakaran I'm not really sure what you are asking. But you could use Heartbeat to set a static IP that is shared in-between the servers. I hope this helps. Thank you for watching my videos. Best regards Daniel
Далее
Hamster Kombat 20 July Mini Game
00:13
Просмотров 10 млн
Automatic install of Redhat 9 using Kickstart
19:26
Просмотров 9 тыс.
We DESTROYED Our Production Ceph Cluster
18:19
Просмотров 13 тыс.
Building reliable Ceph clusters
40:17
Просмотров 11 тыс.
Ceph for Enterprise
46:58
Просмотров 7 тыс.