In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how CentOS monopolizes the activation of volume groups". In daily operation, I believe many people have doubts about how CentOS monopolizes the activation of volume groups. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "how CentOS monopolizes the activation of volume groups". Next, please follow the editor to study!
Background: exclusive activation of the shared disk needs to be implemented on the dual computers of the CentOS, that is, the shared disk can only be mounted on one of the machines, and the other machine cannot be mounted at the same time. If necessary, you can manually switch and mount to another machine.
Implementation method: relying on rhcs cluster function, exclusive activation using vgchange-a / e
I. Environmental preparation
# cat / etc/redhat-release
CentOS release 6.6 (Final)
Vim / etc/hosts
192.168.58.20 vm-test01
192.168.58.21 vm-test02
Second, install the cluster
1. Install rhcs cluster related software packages
Yum install-y cluster-glue resource-agents pacemaker
Yum install-y luci ricci cman openais rgmanager lvm2-cluster gfs2-utils
2. Start the cluster service
Service luci start
Service ricci start
Service rgmanager start
Service cman start
If there is an error in starting cman:
Starting cman... Xmlconfig cannot find / etc/cluster/cluster.conf [FAILED] is because the node has not joined the cluster and no configuration file / etc/cluster/cluster.conf has been generated
Negligible
3. Set the cluster service to start itself.
Chkconfig luci on
Chkconfig ricci on
Chkconfig rgmanager on
Chkconfig cman on
4. Modify the password of ricci user
Use the passwd ricci command to set the user's ricci password to the password of root
Third, configure clusters
Log in to https://192.168.58.20:8084 with ie
Create cluster
Create a volume group with a shared disk
Pvcreate / dev/sdb
Vgcreate vgrhcs1 / dev/sdb
Lvcreate-L 20m-n lvtest1 vgrhcs1
Mkfs.ext3 / dev/vgrhcs1/lvtest1
Mkdir / rhcs1
Synchronize volume group information on another node
Pvscan
Vgscan
Vgchange-an vgrhcs1
Execute on both nodes:
Vim / etc/lvm/lvm.conf
Locking_type = 3
In the node activated by vg, add the cluster attribute of the node and execute
Vgchange-an vgrhcs1
Vgchange-c y vgrhcs1
Exclusive Activation Volume Group
Vgchange-an e vgrhcs1
On mount / dev/vgrhcs1/lvtest1 / rhcs1 mount, it is guaranteed that the vg cannot be deactivated at any node.
Note:
Vgchange-a y vgxx means to activate a volume group on all nodes
Vgchange-an vgxx means to deactivate the volume group on all nodes
Vgchange-an e vgxx means to activate the volume group exclusively on a node
At this point, the study on "how CentOS monopolizes the activation of volume groups" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.