search
HomeWeb Front-endCSS TutorialRHCS uses css_tool command to create HA cluster and create gfs2 cluster file system

Preparing the environment

node1:192.168.139.2

node2:192.168.139.4

node4:192.168.139.8

node5:192.168 .139.9


node1 as the target end

node2 node4 node5 as the initiator end


and node2 node4 node5 is configured into a three-node RHCS high-availability cluster after installing cman+rgmanager. Because gfs2 is a cluster file system, faulty nodes must be fenced with the help of the HA high-availability cluster, and node information must be transferred using the Message Layer.

Because the discovered and logged-in target needs to be made into an integrated file system, gfs2-utils must be installed on node2 node4 node5


First use the original Stop the cluster service created by luci/ricci (a cluster service I made in a previous experiment, which has nothing to do with this experiment)


[root@node2 mnt]# clusvcadm -d Web_Service

Local machine disabling service:Web_Service...

[root@node2 mnt]# clustat

Cluster Status for zxl @ Wed Dec 21 17:55:46 2016

Member Status: Quorate


## Member Name                       ID     Status

------- ----                                                                                      ----

node2.zxl.com         1 Online, Local, rgmanager

node4.zxl.com                               1 Online, rgmanager

# Service Name                 Owner (Last)                                                                                                                                                                                                                                                                            

service:Web_Service (node2.zxl.com) disabled

[root@node2 mnt]# service rgmanager stop

[root@node2 mnt]# service cman stop

[root@node4 mnt]# service rgmanager stop

[root@node4 mnt]# service cman stop

[root@node4 mnt]# rm -rf /etc/cluster/cluster .conf

[root@node4 mnt]# rm -rf /etc/cluster/cluster.conf

Every time the configuration file is changed, it will be backed up and deleted

[ root@node2 mnt]# ls /etc/cluster/

cluster.conf.bak cman-notify.d

[root@node2 mnt]# rm -f /etc/cluster/*

If cman or rgmanager is not installed, execute the following command


[root@node2 mnt]#yum -y install cman rgmanager


Use the css_tool command to create a cluster, the cluster name is mycluster

[root@node2 mnt]# ccs_tool create mycluster

[ root@node2 mnt]# cat /etc/cluster/cluster.conf


## < ;fencedevices>



##Add Fence device (RHCS cluster Required)

[root@node2 mnt]# ccs_tool addfence meatware fence_manual

[root@node2 mnt]# ccs_tool lsfence

Name         Agent

meatware fence_manual

-v specifies the number of votes the node has

-n specifies the node identifier

-f specifies the Fence device name


Add three nodes, the RHCS cluster must have at least three nodes

[root@node2 mnt]# ccs_tool addnode -v 1 -n 1 -f meatware node2.zxl .com

[root@node2 mnt]# ccs_tool addnode -v 1 -n 2 -f meatware node4.zxl.com

[root@node2 mnt]# ccs_tool addnode -v 1 - n 3 -f meatware node5.zxl.com

View cluster nodes

[root@node2 mnt]# ccs_tool lsnode

Cluster name: MyCluster, Config_version: 5

## Nodename votes nodeid fencetype

node2.zxl.com 1 1 meatware 4.zxl. COM 1 2 Meatware

Node5.zxl.com 1 3 Meatware

Copy the configuration file. /etc/cluster/cluster.conf node4:/etc/cluster/


[root@node2 mnt]# scp /etc/cluster/cluster.conf node5:/etc/cluster/

Each node starts cman rgmanager

[root@node2 mnt]# service cman start

[root@node2 mnt]# service rgmanager start

[root@node4 mnt] # service cman start

[root@node4 mnt]# service rgmanager start

[root@node5 mnt]# service cman start

[root@node5 mnt]# service rgmanager start

[root@node2 mnt]# clustat

Cluster Status for mycluster @ Wed Dec 21 18:40:26 2016

Member Status: Quorate


## Member Name ID Status

-- ---- ----                                                                                                                 node2.zxl.com                            node2. ## node5.zxl.com 3 Online

##[root@node2 mnt]# rpm -ql gfs2-utils

/etc/rc.d/ init.d/gfs2

/sbin/fsck.gfs2


/sbin/mkfs.gfs2 \\Format

/sbin/mount.gfs2 to create the gfs2 file system \\Mount the gfs2 file system

/usr/sbin/gfs2_convert

-j Specify the use of the mkfs.gfs2 command The number of log areas can be mounted by several nodes, because after formatting into a cluster file system, each node must have log records

-J specifies the log size, the default is 128M


-p {lock_dlm|lock_nolock} Distributed lock management|No lock required

-t Specify the name of the lock table

Note: A cluster can have multiple files System, for example, a cluster shares two disks. The two disks can be gfs2 and ocfs2 file systems. When different file systems are locked, different lock tables must be used to uniquely identify them, so each lock must have a lock. Name

Format of lock table name

cluster_name: lock table name

For example: mycluster:lock_sda

-D Display detailed Debug information

Log in to the target and format it as a gfs2 file system

[root@node2 mnt]# iscsiadm -m node -T iqn.2016-12.com.zxl :store1.disk1 -p 192.168.139.2 -l

[root@node2 mnt]# mkfs.gfs2 -j 2 -p lock_dlm -t mycluster:lock_sde1 /dev/sde1


Are you sure you want to proceed? [y/n] y

##Device:                 /dev/sde1

Blocksize:           4096

Device Size 3.00 GB (787330 blocks)

Filesystem Size:         3.00 GB (787328 blocks)

Journals:           2

Resource Groups:         13

Locking Protocol:    " lock_dlm"

Lock Table: " "mycluster:lock_sde1"

UUID: " 9ebdc83b-9a61-9a4a-3ba7-9c80e59a0a2d

Formatting completed, mount test

[root@node2 mnt]# mount -t gfs2 /dev/sde1 /mnt

[root@node2 mnt]# cd /mnt

[root@node2 mnt]# ll

total 0

[root@node2 mnt]# cp /etc/issue ./

[root@node2 mnt]# ll

total 8

-rw-r--r--. 1 root root 47 Dec 21 19:06 issue

##ok, change node4

[root@node4 ~]# iscsiadm -m node -T iqn.2016-12.com.zxl:store1.disk1 -p 192.168.139.2 -l

node4 does not need to be formatted again, mount it directly

[root@node4 ~]# mount -t gfs2 /dev/sdc1 /mnt


[root@node4 ~]# cd /mnt

[root@node4 mnt]# ll \\You can see the files copied by node1

total 8

-rw-r--r--. 1 root root 47 Dec 21 19:06 issue

When node4 creates a file a.txt, it will immediately notify other nodes so that they can see it. This is the benefit of the cluster file system gfs2

[root@node4 mnt]# touch a.txt

[root@node2 mnt]# ll

total 16

-rw-r--r--. 1 root root 0 Dec 21 19:10 a.txt

-rw-r--r--. 1 root root 47 Dec 21 19:06 issue

Adding a node node5

[root@ node5 ~]# iscsiadm -m node -T iqn.2016-12.com.zxl:store1.disk1 -p 192.168.139.2 -l

cannot be mounted because only two cluster log files are created. , a few logs and a few nodes can be mounted

[root@node5 ~]# mount -t gfs2 /dev/sdc1 /mnt


Too many nodes mounting filesystem, no free journals

Add log

[root@node2 mnt]# gfs2_jadd -j 1 /dev/sde1 \\-j 1 Add a log

Filesystem: /mnt

Old Journals 2

New Journals 3

[root@node2 mnt]# gfs2_tool journals /dev/sde1 \\This command can view several logs, each with a default size of 128M

journal2 - 128MB

journal1 - 128MB

journal0 - 128MB

3 journal(s) found.

[root@node5 ~]# mount -t gfs2 /dev/sdc1 /mnt \\node5 mounted successfully

[root@node5 ~]# cd /mnt

[root@node5 mnt]# touch b .txt

[root@node4 mnt]# ll

total 24

-rw-r--r--. 1 root root 0 Dec 21 19:10 a .txt

-rw-r--r--. 1 root root 0 Dec 21 19:18 b.txt

-rw-r--r--. 1 root root 47 Dec 21 19:06 issue

gfs2 cluster file system generally supports no more than 16 clusters. After that, the performance plummets

For more RHCS related articles on using the css_tool command to create an HA cluster and create a gfs2 cluster file system, please pay attention to the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
A Little Reminder That Pseudo Elements are Children, Kinda.A Little Reminder That Pseudo Elements are Children, Kinda.Apr 19, 2025 am 11:39 AM

Here's a container with some child elements:

Menus with 'Dynamic Hit Areas'Menus with 'Dynamic Hit Areas'Apr 19, 2025 am 11:37 AM

Flyout menus! The second you need to implement a menu that uses a hover event to display more menu items, you're in tricky territory. For one, they should

Improving Video Accessibility with WebVTTImproving Video Accessibility with WebVTTApr 19, 2025 am 11:27 AM

"The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect."- Tim Berners-Lee

Weekly Platform News: CSS ::marker pseudo-element, pre-rendering web components, adding Webmention to your siteWeekly Platform News: CSS ::marker pseudo-element, pre-rendering web components, adding Webmention to your siteApr 19, 2025 am 11:25 AM

In this week's roundup: datepickers are giving keyboard users headaches, a new web component compiler that helps fight FOUC, we finally get our hands on styling list item markers, and four steps to getting webmentions on your site.

Making width and flexible items play nice togetherMaking width and flexible items play nice togetherApr 19, 2025 am 11:23 AM

The short answer: flex-shrink and flex-basis are probably what you’re lookin’ for.

Position Sticky and Table HeadersPosition Sticky and Table HeadersApr 19, 2025 am 11:21 AM

You can't position: sticky; a

Weekly Platform News: HTML Inspection in Search Console, Global Scope of Scripts, Babel env Adds defaults QueryWeekly Platform News: HTML Inspection in Search Console, Global Scope of Scripts, Babel env Adds defaults QueryApr 19, 2025 am 11:18 AM

In this week's look around the world of web platform news, Google Search Console makes it easier to view crawled markup, we learn that custom properties

IndieWeb and WebmentionsIndieWeb and WebmentionsApr 19, 2025 am 11:16 AM

The IndieWeb is a thing! They've got a conference coming up and everything. The New Yorker is even writing about it:

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)