forked from erlong15/otus-gluster
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathinstall_gluster.sh
More file actions
49 lines (37 loc) · 818 Bytes
/
install_gluster.sh
File metadata and controls
49 lines (37 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
#
install_gluster(){
dnf install -y centos-release-gluster10
yum install -y glusterfs-server
systemctl start glusterd
systemctl status glusterd | cat
}
create_cluster(){
for octet in 151 152 153
do
gluster peer probe 192.168.7.$octet
done
}
show_cluster_state(){
gluster peer status
}
format_and_mount_bricks(){
for brick_dev in sd{b..f}
do
dev_path=/dev/$brick_dev
dev_mnt_path=/mnt/$brick_dev
brick_path=/mnt/$brick_dev/b
mkfs.xfs -i size=512 $dev_path
mkdir -p $dev_mnt_path
echo "$dev_path $dev_mnt_path xfs defaults 1 2" >> /etc/fstab
# create directory inside mounted brick filesystem
mount $dev_path
mkdir -p $brick_path
done
}
main(){
format_and_mount_bricks
install_gluster
# create_cluster - this step should start only on one server
}
main