Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
7.1 kB
2
Indexable
Never
========================================
PREPARING FOR INSTALLATION
========================================
--------------------
All node
--------------------
# vi /etc/hosts
----------
10.30.6.101     OPENDATADB01
10.30.6.102     OPENDATADB02
10.30.6.103     OPENDATADB03
10.30.6.105     OPENDATAAPP01
10.30.6.106     OPENDATAAPP02
10.30.6.107     OPENDATAAPP03



========================================
FORMAT DISK
========================================
--------------------
OPENDATAAPP01 + OPENDATAAPP02 + OPENDATAAPP03
--------------------
fdisk /dev/sdb
----------
n -> p -> Enter (1) -> Enter -> Enter (full disk) -> t -> 8e -> w

mkfs.xfs /dev/sdb1

vgcreate data /dev/sdb1
lvcreate -n docker -l 100%FREE data
mkfs.xfs /dev/data/docker

mkdir /var/lib/docker

vi /etc/fstab
----------
/dev/mapper/data-docker /var/lib/docker xfs defaults 0 0

mount -a


--------------------
OPENDATADB01 + OPENDATAAPP01
--------------------
fdisk /dev/sdc
----------
n -> p -> Enter (1) -> Enter -> Enter (full disk) -> t -> 8e -> w

mkfs.xfs /dev/sdc1

vgcreate backup /dev/sdc1
lvcreate -n opendata -l 100%FREE backup
mkfs.xfs /dev/backup/opendata

mkdir /backup

vi /etc/fstab
----------
/dev/mapper/backup-opendata /backup xfs defaults 0 0

mount -a




========================================
INSTALL GLUSTERFS: CLUSTER DB
========================================
--------------------
OPENDATADB01
--------------------
fdisk /dev/sdb
----------
n -> p -> Enter (1) -> Enter -> Enter (full disk) -> t -> 8e -> w

mkfs.xfs /dev/sdb1

mkdir -p /glusterfs/bricks/1

vi /etc/fstab
----------
/dev/sdb1 /glusterfs/bricks/1 xfs defaults 0 0

mount -a
mkdir /glusterfs/bricks/1/brick


--------------------
OPENDATADB02
--------------------
fdisk /dev/sdb
----------
n -> p -> Enter (1) -> Enter -> Enter (full disk) -> t -> 8e -> w

mkfs.xfs /dev/sdb1

mkdir -p /glusterfs/bricks/2

vi /etc/fstab
----------
/dev/sdb1 /glusterfs/bricks/2 xfs defaults 0 0

mount -a
mkdir /glusterfs/bricks/2/brick


--------------------
OPENDATADB03
--------------------
fdisk /dev/sdb
----------
n -> p -> Enter (1) -> Enter -> Enter (full disk) -> t -> 8e -> w

mkfs.xfs /dev/sdb1

mkdir -p /glusterfs/bricks/3

vi /etc/fstab
----------
/dev/sdb1 /glusterfs/bricks/3 xfs defaults 0 0

mount -a
mkdir /glusterfs/bricks/3/brick


--------------------
OPENDATADB01 + OPENDATADB02 + OPENDATADB03
--------------------
yum -y install centos-release-gluster9
sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/CentOS-Gluster-9.repo
yum --enablerepo=centos-gluster9 -y install glusterfs-server
systemctl enable --now glusterd
gluster --version

firewall-cmd --add-service=glusterfs --permanent
firewall-cmd --reload


--------------------
OPENDATADB01
--------------------
gluster peer probe OPENDATADB02
gluster peer probe OPENDATADB03
gluster peer status

gluster volume create gfs replica 3 OPENDATADB01:/glusterfs/bricks/1/brick OPENDATADB02:/glusterfs/bricks/2/brick OPENDATADB03:/glusterfs/bricks/3/brick
gluster volume start gfs

--------------------
Setup security and authentication for this volume
--------------------
gluster volume set gfs auth.allow OPENDATADB01,OPENDATADB02,OPENDATADB03


--------------------
OPENDATADB01 + OPENDATADB02 + OPENDATADB03
--------------------
echo 'localhost:/gfs /mnt glusterfs defaults,_netdev,backupvolfile-server=localhost 0 0' >> /etc/fstab
mount.glusterfs localhost:/gfs /mnt




========================================
INSTALL GLUSTERFS: CLUSTER APP
========================================
--------------------
OPENDATAAPP01
--------------------
fdisk /dev/sdd
----------
n -> p -> Enter (1) -> Enter -> Enter (full disk) -> t -> 8e -> w

mkfs.xfs /dev/sdd1

mkdir -p /glusterfs/bricks/1

vi /etc/fstab
----------
/dev/sdd1 /glusterfs/bricks/1 xfs defaults 0 0

mount -a
mkdir /glusterfs/bricks/1/brick


--------------------
OPENDATAAPP02
--------------------
fdisk /dev/sdc
----------
n -> p -> Enter (1) -> Enter -> Enter (full disk) -> t -> 8e -> w

mkfs.xfs /dev/sdc1

mkdir -p /glusterfs/bricks/2

vi /etc/fstab
----------
/dev/sdc1 /glusterfs/bricks/2 xfs defaults 0 0

mount -a
mkdir /glusterfs/bricks/2/brick


--------------------
OPENDATAAPP03
--------------------
fdisk /dev/sdc
----------
n -> p -> Enter (1) -> Enter -> Enter (full disk) -> t -> 8e -> w

mkfs.xfs /dev/sdc1

mkdir -p /glusterfs/bricks/3

vi /etc/fstab
----------
/dev/sdc1 /glusterfs/bricks/3 xfs defaults 0 0

mount -a
mkdir /glusterfs/bricks/3/brick


--------------------
OPENDATAAPP01 + OPENDATAAPP02 + OPENDATAAPP03
--------------------
yum -y install centos-release-gluster9
sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/CentOS-Gluster-9.repo
yum --enablerepo=centos-gluster9 -y install glusterfs-server
systemctl enable --now glusterd
gluster --version

firewall-cmd --add-service=glusterfs --permanent
firewall-cmd --reload


--------------------
OPENDATAAPP01
--------------------
gluster peer probe OPENDATAAPP02
gluster peer probe OPENDATAAPP03
gluster peer status

gluster volume create gfs replica 3 OPENDATAAPP01:/glusterfs/bricks/1/brick OPENDATAAPP02:/glusterfs/bricks/2/brick OPENDATAAPP03:/glusterfs/bricks/3/brick
gluster volume start gfs

--------------------
Setup security and authentication for this volume
--------------------
gluster volume set gfs auth.allow OPENDATAAPP01,OPENDATAAPP02,OPENDATAAPP03


--------------------
OPENDATAAPP01 + OPENDATAAPP02 + OPENDATAAPP03
--------------------
echo 'localhost:/gfs /mnt glusterfs defaults,_netdev,backupvolfile-server=localhost 0 0' >> /etc/fstab
mount.glusterfs localhost:/gfs /mnt




========================================
INSTALL DOCKER SWARM
========================================
--------------------
All node
--------------------
yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin
systemctl start docker
systemctl enable docker

firewall-cmd --permanent --add-port=2376/tcp
firewall-cmd --permanent --add-port=2377/tcp
firewall-cmd --permanent --add-port=7946/tcp
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --permanent --add-port=7946/udp
firewall-cmd --permanent --add-port=4789/udp
firewall-cmd --reload
systemctl restart docker


--------------------
OPENDATADB01
--------------------
docker swarm init
----------
docker swarm join --token SWMTKN-1-3793hvb71g0a6ubkgq8zgk9w99hlusajtmj5aqr3n2wrhzzf8z-1s38lymnir13hhso1qxt5pqru 10.30.6.101:2377

--------------------
OPENDATADB02 + OPENDATADB03
--------------------
docker swarm join --token SWMTKN-1-3793hvb71g0a6ubkgq8zgk9w99hlusajtmj5aqr3n2wrhzzf8z-1s38lymnir13hhso1qxt5pqru 10.30.6.101:2377

--------------------
OPENDATAAPP01
--------------------
docker swarm init
----------
docker swarm join --token SWMTKN-1-3793hvb71g0a6ubkgq8zgk9w99hlusajtmj5aqr3n2wrhzzf8z-1s38lymnir13hhso1qxt5pqru 10.30.6.105:2377

--------------------
OPENDATAAPP02 + OPENDATAAPP03
--------------------
docker swarm join --token SWMTKN-1-3793hvb71g0a6ubkgq8zgk9w99hlusajtmj5aqr3n2wrhzzf8z-1s38lymnir13hhso1qxt5pqru 10.30.6.105:2377