码迷,mamicode.com
首页 > 其他好文 > 详细

corosync搭建

时间:2019-04-22 10:40:55      阅读:202      评论:0      收藏:0      [点我收藏+]

标签:conf   clu   get   dev   协议   100%   def   lis   bind   

sudo systemctl stop firewalld
sudo systemctl disable firewalld

sudo setenforce 0
getenforce
sudo iptables -F
sudo yum install –y gfs2-utils corosync lvm2-cluster

sudo vi /etc/hostname

CBM_001
CBM_002
CBM_003

iscsi
yum install scsi-target-utils


sudo vi /etc/hosts

 

172.31.22.128 CBM_001
172.31.24.241 CBM_002
172.31.29.11 CBM_003

sudo cp /etc/corosync/corosync.conf.example /etc/corosync/corosync.conf
sudo vi /etc/corosync/corosync.conf

route add -net 172.31.0.0/16 dev eth0
配置

172.31.0.0

 

# Please read the corosync.conf.5 manual page
totem {
version: 2
cluster_name: mycluster
clear_node_high_bit: yes


crypto_cipher: none
crypto_hash: none

interface {
ringnumber: 0
bindnetaddr: 172.31.0.0
mcastport: 5405
ttl: 1
}
udpu
}

logging {
fileline: off
to_logfile: yes
to_syslog: yes
logfile: /var/log/cluster/corosync.log
debug: off
timestamp: on
logger_subsys {
subsys: QUORUM
debug: off
}
}

nodelist {
node {
ring0_addr: 172.31.24.241
nodeid: 1
}

node {
ring0_addr: 172.31.22.128
nodeid: 2
}

 


}

quorum {
# Enable and configure quorum subsystem (default: off)
# see also corosync.conf.5 and votequorum.5
#provider: corosync_votequorum
provider: corosync_votequorum
expected_votes: 2
two_node: 1

}


sudo systemctl restart corosync
sudo systemctl enable corosync
sudo corosync-quorumtool –s (未解决)

CBM——003


sudo systemctl restart dlm

sudo systemctl enable dlm

Disk /dev/xvdf

sudo pvcreate /dev/xvdf

sudo vgcreate vg01 /dev/xvdf

sudo lvcreate -n lv01 -L 5G vg01
sudo lvcreate -n lv02 -L 4G vg01


sudo lvcreate -n lv01 -l 100%FREE vg01

sudo mkfs -t gfs2 -p lock_dlm -t mycluster:mydata2 -j 3 /dev/mapper/vg01-lv02
sudo mkfs -t gfs2 -p lock_nolock -t mycluster:mydata1 -j 2 /dev/mapper/vg01-lv01

-p lock_dlm 共享锁协议

-t ha_cluster:gfs2 锁的表格式为:clustername:lockspace

-j 2 日志盘的数量,数量为2,只允许两个节点挂载。
扩展时可用’gfs2_jadd -j 1’
/dev/vg_cluster/lv_cluster 卷的名称


sudo mount -t gfs2 /dev/mapper/vg01-lv01 /mnt/mydata1

sudo mount -t gfs2 /dev/mapper/vg01-lv02 /mnt/mydata1

corosync搭建

标签:conf   clu   get   dev   协议   100%   def   lis   bind   

原文地址:https://www.cnblogs.com/zhaizhaozhidi/p/10748668.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!