Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deploy distributed Storage system DRBD under Linux

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge of "how to deploy distributed storage system DRBD under Linux". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

DRBD (Distributed Replicated Block Device) is a distributed storage system on the Linux platform. It contains core modules, several user space managers and shell scripts, which are commonly used in high availability (high availability, HA) clusters. DRBD is similar to RAID 1 (mirroring) of a disk array, except that RAID is on the same computer and DRBD is over the network.

one。 Install 1. Installation depends on yum install gcc gcc-c++ make glibc flex-Y2. Update the kernel and restart yum-y install kernel-devel kernel kernel-headers3 after installation. Import elrepo to install source rpm-- import https://www.elrepo.org/RPM-GPG-KEY-elrepo.orgrpm-Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm4. Install drbd90yum install-y drbd90-utils kmod-drbd905. Load the drbd module modprobe drbdecho drbd > / etc/modules-load.d/drbd.conf6. Verify whether drbd is loaded successfully lsmod | grep drbd II. Configuration 1. Configure hosts

Vim / etc/hosts

192.168.5.77 node1192.168.5.78 node22. Modify the global configuration mv / etc/drbd.d/global_common.conf / etc/drbd.d/global_common.conf.origcat / etc/drbd.d/global_common.confglobal {usage-count no;} common {net {protocol C;}} EOF3. Create a resource configuration cat / etc/drbd.d/drbd0.resresource drbd0 {disk / dev/sdb; device / dev/drbd0; meta-disk internal; on node1 {address 192.168.5.77 address 7789;} on node2 {address 192.168.5.78 virtual 7789;}} EOF4. Create the device source file drbdadm create-md drbd05. Start the drbd service systemctl start drbdsystemctl enable drbd6. Start the device source file drbdadm up drbd0 close: drbdadm down drbd07. Set up the master node and mount drbd0 (node1) drbdadm primary drbd0-- forcemkfs.xfs / dev/drbd0mount / dev/drbd0 / mnt to write to the test file: echo "hello,world" > / mnt/hello8. Synchronous test (node2) drbdadm down drbd0mount-t xfs / dev/sdb / mntls / mnt (to see if there are files in node1) 9. Active / standby handover

Node1:

Umount / mntdrbdadm secondary drbd0

Node2:

Drbdadm primary drbd0mount / dev/drbd0 / mnt10. Common command

View status:

Cat / proc/drbd

Connection status:

Drbdadm cstate r0

Role status:

Drbdadm role r0

Hard disk status:

Drbdadm dstate r0

Enable / close resources:

Drbdadm up drbdadm down

Role switching:

This is the end of drbdadm primary drbdadm secondary's "how to deploy distributed storage system DRBD under Linux". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report